添加项目
This commit is contained in:
50
NX.ERP.Model/Request/MaterialAppVouch.cs
Normal file
50
NX.ERP.Model/Request/MaterialAppVouch.cs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace NX.ERP.Model.Request
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 领料申请单
|
||||||
|
/// </summary>
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 领料申请
|
||||||
|
/// </summary>
|
||||||
|
public class MaterialAppVouch
|
||||||
|
{
|
||||||
|
private string deptCode;
|
||||||
|
private DateTime date;
|
||||||
|
|
||||||
|
private IEnumerable<MaterialAppVouchDetail> details = new List<MaterialAppVouchDetail>();
|
||||||
|
private string sourceName;
|
||||||
|
|
||||||
|
public string DeptCode { get => deptCode; set => deptCode = value; }
|
||||||
|
public DateTime Date { get => date; set => date = value; }
|
||||||
|
public IEnumerable<MaterialAppVouchDetail> Details { get => details; set => details = value; }
|
||||||
|
public string SourceName { get => sourceName; set => sourceName = value; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class MaterialAppVouchDetail
|
||||||
|
{
|
||||||
|
private string sourceCode;
|
||||||
|
private int _sourceDetailId;
|
||||||
|
private decimal qty;
|
||||||
|
|
||||||
|
public string SourceCode { get => sourceCode; set => sourceCode = value; }
|
||||||
|
public int SourceDetailId { get => _sourceDetailId; set => _sourceDetailId = value; }
|
||||||
|
public decimal Qty { get => qty; set => qty = value; }
|
||||||
|
public DateTime Date { get => date; set => date = value; }
|
||||||
|
|
||||||
|
private DateTime date;
|
||||||
|
public string InvCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
19
U8Test/App.config
Normal file
19
U8Test/App.config
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
|
||||||
|
</startup>
|
||||||
|
<appSettings>
|
||||||
|
<add key="server" value="10.0.0.12" />
|
||||||
|
<add key="AccId" value="u8-2@001" />
|
||||||
|
<add key="UserId" value="wxapi" />
|
||||||
|
<add key="Password" value="1" />
|
||||||
|
</appSettings>
|
||||||
|
<runtime>
|
||||||
|
|
||||||
|
</runtime>
|
||||||
|
<system.web>
|
||||||
|
|
||||||
|
</system.web>
|
||||||
|
</configuration>
|
||||||
49
U8Test/MaterialAppVoucherTest.cs
Normal file
49
U8Test/MaterialAppVoucherTest.cs
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using NX.ERP.Model.Request;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace U8Test
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class MaterialAppVoucherTest
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public MaterialAppVoucherTest()
|
||||||
|
{
|
||||||
|
NX.ERP.U8.U8LoginContext.Instance.UserId = "wx997";
|
||||||
|
NX.ERP.U8.U8LoginContext.Instance.PassWord = "1";
|
||||||
|
NX.ERP.U8.U8LoginContext.Instance.Server = "10.0.0.12";
|
||||||
|
NX.ERP.U8.U8LoginContext.Instance.AccID = "u8-2@001";
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
|
||||||
|
public void Add()
|
||||||
|
{
|
||||||
|
var dal = new NX.ERP.U8.Store.MaterialAppVoucher();
|
||||||
|
dal.AddVoucher(new MaterialAppVouch()
|
||||||
|
{
|
||||||
|
|
||||||
|
Date = DateTime.Now,
|
||||||
|
DeptCode = "024",
|
||||||
|
Details = new List<MaterialAppVouchDetail>() { new MaterialAppVouchDetail() {
|
||||||
|
Date=DateTime.Now,
|
||||||
|
InvCode="317037",
|
||||||
|
Qty=5,
|
||||||
|
SourceCode="",
|
||||||
|
SourceDetailId=0,
|
||||||
|
|
||||||
|
} },
|
||||||
|
SourceName = "生产订单"
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user