修改
This commit is contained in:
52
NX.ERP.U8/Store/BinChangeDAL.cs
Normal file
52
NX.ERP.U8/Store/BinChangeDAL.cs
Normal file
@@ -0,0 +1,52 @@
|
||||
using MSXML2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace NX.ERP.U8.Store
|
||||
{
|
||||
public class BinChangeDAL : VoucherBase
|
||||
{
|
||||
public BinChangeDAL() : base("19", "U8API/BinChange")
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string AddVocher(Model.Request.BinChange binChange)
|
||||
{
|
||||
VoucherParameter voucherParameter = new VoucherParameter
|
||||
{
|
||||
VoucherType = this.VoucherID,
|
||||
DomHead = new DOMDocumentClass(),
|
||||
DomBody = new DOMDocumentClass()
|
||||
};
|
||||
DOMDocument domHead = voucherParameter.DomHead;
|
||||
DOMDocument domBody = voucherParameter.DomBody;
|
||||
voucherParameter.DomHead.loadXML(HeadTemplate);
|
||||
voucherParameter.DomBody.loadXML(BodyTemplate);
|
||||
IXMLDOMElement headXml = domHead.createElement("z:row");
|
||||
headXml.setAttribute("id", 0);
|
||||
headXml.setAttribute("ddate", DateTime.Now.ToShortDateString());
|
||||
headXml.setAttribute("ddate", DateTime.Now.ToShortDateString());
|
||||
headXml.setAttribute("cwhcode", binChange.whCode);
|
||||
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0313"));
|
||||
headXml.setAttribute("cvouchcode", "00000009998");
|
||||
foreach (var item in binChange.binChangeDetails)
|
||||
{
|
||||
var bodyXml = domBody.createElement("z:row");
|
||||
bodyXml.setAttribute("cinvcode", item.InvCode);
|
||||
bodyXml.setAttribute("cbposcode", item.SoucePositon);
|
||||
|
||||
bodyXml.setAttribute("caposcode", item.DestPostion);
|
||||
bodyXml.setAttribute("iquantity", item.Qty);
|
||||
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
|
||||
|
||||
}
|
||||
domHead.selectSingleNode("//rs:data").appendChild(headXml);
|
||||
|
||||
return this.AddRdVoucher(voucherParameter);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user