diff --git a/NX.ERP.Model/NX.ERP.Model.csproj b/NX.ERP.Model/NX.ERP.Model.csproj index cb392d9..558c514 100644 --- a/NX.ERP.Model/NX.ERP.Model.csproj +++ b/NX.ERP.Model/NX.ERP.Model.csproj @@ -72,6 +72,10 @@ + + + + diff --git a/NX.ERP.Model/Store/OtherStoreIn.cs b/NX.ERP.Model/Store/OtherStoreIn.cs new file mode 100644 index 0000000..2f7e298 --- /dev/null +++ b/NX.ERP.Model/Store/OtherStoreIn.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.Model.Store +{ + public class OtherStoreIn + { + public string Code { get; set; } + public DateTime Date { get; set; } + public string WhCode { get; set; } + public IList details = new List(); + } +} diff --git a/NX.ERP.Model/Store/OtherStoreInDetail.cs b/NX.ERP.Model/Store/OtherStoreInDetail.cs new file mode 100644 index 0000000..b58eb88 --- /dev/null +++ b/NX.ERP.Model/Store/OtherStoreInDetail.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.Model.Store +{ + public class OtherStoreInDetail + { + public string InvCode { get; set; } + public double Quantity { get; set; } + public string Position { get; set; } + } + +} diff --git a/NX.ERP.Model/Store/OtherStoreOut.cs b/NX.ERP.Model/Store/OtherStoreOut.cs new file mode 100644 index 0000000..8ceb512 --- /dev/null +++ b/NX.ERP.Model/Store/OtherStoreOut.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.Model.Store +{ + public class OtherStoreOut + { + public ICollection details = new List(); + } +} diff --git a/NX.ERP.Model/Store/OtherStoreOutDetail.cs b/NX.ERP.Model/Store/OtherStoreOutDetail.cs new file mode 100644 index 0000000..f265bf7 --- /dev/null +++ b/NX.ERP.Model/Store/OtherStoreOutDetail.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.Model.Store +{ + public class OtherStoreOutDetail + { + } +} diff --git a/NX.ERP.U8.App/FrmMain.Designer.cs b/NX.ERP.U8.App/FrmMain.Designer.cs index 3b7e898..7fbce76 100644 --- a/NX.ERP.U8.App/FrmMain.Designer.cs +++ b/NX.ERP.U8.App/FrmMain.Designer.cs @@ -34,6 +34,7 @@ namespace U8AppMain this.BtnReadExcel = new System.Windows.Forms.ToolStripMenuItem(); this.登录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.材料出库单ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.导入ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ImportBom = new System.Windows.Forms.ToolStripMenuItem(); this.BtnPurchaseImport = new System.Windows.Forms.ToolStripMenuItem(); @@ -43,7 +44,7 @@ namespace U8AppMain this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.richTextBox1 = new System.Windows.Forms.RichTextBox(); - this.材料出库单ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.其他入库ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -71,7 +72,8 @@ namespace U8AppMain this.BtnReadExcel, this.登录ToolStripMenuItem, this.toolStripMenuItem2, - this.材料出库单ToolStripMenuItem}); + this.材料出库单ToolStripMenuItem, + this.其他入库ToolStripMenuItem}); this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem"; this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19); this.操作ToolStripMenuItem.Text = "文件"; @@ -97,6 +99,13 @@ namespace U8AppMain this.toolStripMenuItem2.Text = "采购入库单"; this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); // + // 材料出库单ToolStripMenuItem + // + this.材料出库单ToolStripMenuItem.Name = "材料出库单ToolStripMenuItem"; + this.材料出库单ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.材料出库单ToolStripMenuItem.Text = "材料出库单"; + this.材料出库单ToolStripMenuItem.Click += new System.EventHandler(this.材料出库单ToolStripMenuItem_Click); + // // 导入ToolStripMenuItem // this.导入ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { @@ -195,12 +204,12 @@ namespace U8AppMain this.richTextBox1.Text = ""; this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged); // - // 材料出库单ToolStripMenuItem + // 其他入库ToolStripMenuItem // - this.材料出库单ToolStripMenuItem.Name = "材料出库单ToolStripMenuItem"; - this.材料出库单ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.材料出库单ToolStripMenuItem.Text = "材料出库单"; - this.材料出库单ToolStripMenuItem.Click += new System.EventHandler(this.材料出库单ToolStripMenuItem_Click); + this.其他入库ToolStripMenuItem.Name = "其他入库ToolStripMenuItem"; + this.其他入库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.其他入库ToolStripMenuItem.Text = "其他入库"; + this.其他入库ToolStripMenuItem.Click += new System.EventHandler(this.其他入库ToolStripMenuItem_Click); // // FrmMain // @@ -241,6 +250,7 @@ namespace U8AppMain private System.Windows.Forms.ToolStripMenuItem 登录ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem 材料出库单ToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem 其他入库ToolStripMenuItem; } } diff --git a/NX.ERP.U8.App/FrmMain.cs b/NX.ERP.U8.App/FrmMain.cs index c30a980..8d241ab 100644 --- a/NX.ERP.U8.App/FrmMain.cs +++ b/NX.ERP.U8.App/FrmMain.cs @@ -355,6 +355,28 @@ namespace U8AppMain + } + + private void 其他入库ToolStripMenuItem_Click(object sender, EventArgs e) + { + var a = new NX.ERP.U8.Store.OtherStoreInDAL(); + a.AddVocher(new NX.ERP.Model.Store.OtherStoreIn() + { + Date=DateTime.Today, + Code="111", + + details = new List() + { + new NX.ERP.Model.Store.OtherStoreInDetail() + { + InvCode="218174", + Quantity=2, + Position="002070206" + } + } + + }); ; + } } } diff --git a/NX.ERP.U8/NX.ERP.U8.csproj b/NX.ERP.U8/NX.ERP.U8.csproj index 570d29d..b8473dc 100644 --- a/NX.ERP.U8/NX.ERP.U8.csproj +++ b/NX.ERP.U8/NX.ERP.U8.csproj @@ -46,6 +46,8 @@ + + diff --git a/NX.ERP.U8/Store/OtherStoreInDAL.cs b/NX.ERP.U8/Store/OtherStoreInDAL.cs new file mode 100644 index 0000000..4018739 --- /dev/null +++ b/NX.ERP.U8/Store/OtherStoreInDAL.cs @@ -0,0 +1,100 @@ +using MSXML2; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.U8.Store +{ + public class OtherStoreInDAL : VoucherBase + { + public OtherStoreInDAL() : base("09") + { + + } + + + public void AddVocher(Model.Store.OtherStoreIn storeIn) + { + + 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("bpufirst", "0"); + headXml.setAttribute("bisstqc", "0"); + headXml.setAttribute("bomfirst", "0"); + headXml.setAttribute("biafirst", "0"); + headXml.setAttribute("brdflag", 1); + headXml.setAttribute("ccode", storeIn.Code); + headXml.setAttribute("ddate", storeIn.Date); + headXml.setAttribute("cmaker","/"); + headXml.setAttribute("cvouchtype", this.VoucherID); + headXml.setAttribute("vt_id", ""); + headXml.setAttribute("editprop", "A"); + headXml.setAttribute("cdepcode", ""); + headXml.setAttribute("cpersoncode", ""); + headXml.setAttribute("crdcode", ""); + + headXml.setAttribute("csource","库存"); + headXml.setAttribute("cwhcode", storeIn.WhCode); + headXml.setAttribute("cbustype", "其他入库"); + headXml.setAttribute("cmemo", ""); + + + IXMLDOMElement bodyXml; + for (var n = 0; n < storeIn.details.Count(); n++) + { + var detail = storeIn.details[n]; + //var arrivalDetail = Arrival.ArrivalDetails.First(m => { return m.Id == detail.SorceDetailId; }); + //headXml.setAttribute("cordercode", arrivalDetail.OrderCode); + // headXml.setAttribute("ipurorderid", arrivalDetail.PoId); + bodyXml = domBody.createElement("z:row"); + bodyXml.setAttribute("cinvcode", detail.InvCode); + bodyXml.setAttribute("iquantity", detail.Quantity); + bodyXml.setAttribute("irowno",n+1); + + bodyXml.setAttribute("cbatch", ""); + + bodyXml.setAttribute("cposition", detail.Position); + bodyXml.setAttribute("cvmivencode",""); + bodyXml.setAttribute("dmadedate", ""); + bodyXml.setAttribute("dvdate", ""); + bodyXml.setAttribute("iexpiratdatecalcu", ""); + bodyXml.setAttribute("cmassunit", ""); + bodyXml.setAttribute("imassdate", ""); + bodyXml.setAttribute("cexpirationdate", ""); + bodyXml.setAttribute("dexpirationdate", ""); + bodyXml.setAttribute("citem_class", ""); + bodyXml.setAttribute("citemcode", ""); + bodyXml.setAttribute("cbmemo", ""); + bodyXml.setAttribute("editprop", "A"); + domBody.selectSingleNode("//rs:data").appendChild(bodyXml); + + } + domHead.selectSingleNode("//rs:data").appendChild(headXml); + var str = voucherParameter.DomBody.xml; + Console.WriteLine(str); + try + { + U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter); + } + catch (Exception err) + { + + throw err; + } + + + } + } +} diff --git a/NX.ERP.U8/Store/OtherStoreOutDAL.cs b/NX.ERP.U8/Store/OtherStoreOutDAL.cs new file mode 100644 index 0000000..bc5be16 --- /dev/null +++ b/NX.ERP.U8/Store/OtherStoreOutDAL.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace NX.ERP.U8.Store +{ + public class OtherStoreOutDAL:VoucherBase + { + public OtherStoreOutDAL():base("09") + { + + } + } +}