添加其他入库单

This commit is contained in:
admin
2021-01-12 16:10:37 +08:00
parent c130f3815d
commit e80d9390cd
10 changed files with 213 additions and 7 deletions

View File

@@ -72,6 +72,10 @@
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Store\MaterielStoreOut.cs" /> <Compile Include="Store\MaterielStoreOut.cs" />
<Compile Include="Store\MaterielStoreOutDetail.cs" /> <Compile Include="Store\MaterielStoreOutDetail.cs" />
<Compile Include="Store\OtherStoreIn.cs" />
<Compile Include="Store\OtherStoreInDetail.cs" />
<Compile Include="Store\OtherStoreOut.cs" />
<Compile Include="Store\OtherStoreOutDetail.cs" />
<Compile Include="Store\PuStoreIn.cs" /> <Compile Include="Store\PuStoreIn.cs" />
<Compile Include="Store\PuStoreInDetail.cs" /> <Compile Include="Store\PuStoreInDetail.cs" />
</ItemGroup> </ItemGroup>

View File

@@ -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<OtherStoreInDetail> details = new List<OtherStoreInDetail>();
}
}

View File

@@ -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; }
}
}

View File

@@ -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<OtherStoreOutDetail> details = new List<OtherStoreOutDetail>();
}
}

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.Model.Store
{
public class OtherStoreOutDetail
{
}
}

View File

@@ -34,6 +34,7 @@ namespace U8AppMain
this.BtnReadExcel = new System.Windows.Forms.ToolStripMenuItem(); this.BtnReadExcel = new System.Windows.Forms.ToolStripMenuItem();
this.登录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.登录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = 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.导入ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ImportBom = new System.Windows.Forms.ToolStripMenuItem(); this.ImportBom = new System.Windows.Forms.ToolStripMenuItem();
this.BtnPurchaseImport = 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.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.richTextBox1 = new System.Windows.Forms.RichTextBox(); 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.menuStrip1.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@@ -71,7 +72,8 @@ namespace U8AppMain
this.BtnReadExcel, this.BtnReadExcel,
this.登录ToolStripMenuItem, this.登录ToolStripMenuItem,
this.toolStripMenuItem2, this.toolStripMenuItem2,
this.材料出库单ToolStripMenuItem}); this.材料出库单ToolStripMenuItem,
this.其他入库ToolStripMenuItem});
this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem"; this.操作ToolStripMenuItem.Name = "操作ToolStripMenuItem";
this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19); this.操作ToolStripMenuItem.Size = new System.Drawing.Size(45, 19);
this.操作ToolStripMenuItem.Text = "文件"; this.操作ToolStripMenuItem.Text = "文件";
@@ -97,6 +99,13 @@ namespace U8AppMain
this.toolStripMenuItem2.Text = "采购入库单"; this.toolStripMenuItem2.Text = "采购入库单";
this.toolStripMenuItem2.Click += new System.EventHandler(this.toolStripMenuItem2_Click); 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 // 导入ToolStripMenuItem
// //
this.导入ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.导入ToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -195,12 +204,12 @@ namespace U8AppMain
this.richTextBox1.Text = ""; this.richTextBox1.Text = "";
this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged); this.richTextBox1.TextChanged += new System.EventHandler(this.richTextBox1_TextChanged);
// //
// 材料出库单ToolStripMenuItem // 其他入库ToolStripMenuItem
// //
this.材料出库单ToolStripMenuItem.Name = "材料出库单ToolStripMenuItem"; this.其他入库ToolStripMenuItem.Name = "其他入库ToolStripMenuItem";
this.材料出库单ToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.其他入库ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.材料出库单ToolStripMenuItem.Text = "材料出库单"; this.其他入库ToolStripMenuItem.Text = "其他入库";
this.材料出库单ToolStripMenuItem.Click += new System.EventHandler(this.材料出库单ToolStripMenuItem_Click); this.其他入库ToolStripMenuItem.Click += new System.EventHandler(this.其他入库ToolStripMenuItem_Click);
// //
// FrmMain // FrmMain
// //
@@ -241,6 +250,7 @@ namespace U8AppMain
private System.Windows.Forms.ToolStripMenuItem 登录ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 登录ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2;
private System.Windows.Forms.ToolStripMenuItem 材料出库单ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem 材料出库单ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 其他入库ToolStripMenuItem;
} }
} }

View File

@@ -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<NX.ERP.Model.Store.OtherStoreInDetail>()
{
new NX.ERP.Model.Store.OtherStoreInDetail()
{
InvCode="218174",
Quantity=2,
Position="002070206"
}
}
}); ;
} }
} }
} }

View File

@@ -46,6 +46,8 @@
<Compile Include="Mom\MomOrderDetailDAL.cs" /> <Compile Include="Mom\MomOrderDetailDAL.cs" />
<Compile Include="Purchase\ArrivalDAL.cs" /> <Compile Include="Purchase\ArrivalDAL.cs" />
<Compile Include="Store\MaterielStoreOutDAL.cs" /> <Compile Include="Store\MaterielStoreOutDAL.cs" />
<Compile Include="Store\OtherStoreInDAL.cs" />
<Compile Include="Store\OtherStoreOutDAL.cs" />
<Compile Include="Store\PuStoreInDAL.cs" /> <Compile Include="Store\PuStoreInDAL.cs" />
<Compile Include="Store\VoucherBase.cs" /> <Compile Include="Store\VoucherBase.cs" />
<Compile Include="STVocher.cs" /> <Compile Include="STVocher.cs" />

View File

@@ -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;
}
}
}
}

View File

@@ -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")
{
}
}
}