添加其他入库单
This commit is contained in:
@@ -72,6 +72,10 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Store\MaterielStoreOut.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\PuStoreInDetail.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
15
NX.ERP.Model/Store/OtherStoreIn.cs
Normal file
15
NX.ERP.Model/Store/OtherStoreIn.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
15
NX.ERP.Model/Store/OtherStoreInDetail.cs
Normal file
15
NX.ERP.Model/Store/OtherStoreInDetail.cs
Normal 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; }
|
||||
}
|
||||
|
||||
}
|
||||
12
NX.ERP.Model/Store/OtherStoreOut.cs
Normal file
12
NX.ERP.Model/Store/OtherStoreOut.cs
Normal 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>();
|
||||
}
|
||||
}
|
||||
11
NX.ERP.Model/Store/OtherStoreOutDetail.cs
Normal file
11
NX.ERP.Model/Store/OtherStoreOutDetail.cs
Normal 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
|
||||
{
|
||||
}
|
||||
}
|
||||
24
NX.ERP.U8.App/FrmMain.Designer.cs
generated
24
NX.ERP.U8.App/FrmMain.Designer.cs
generated
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
}); ;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
<Compile Include="Mom\MomOrderDetailDAL.cs" />
|
||||
<Compile Include="Purchase\ArrivalDAL.cs" />
|
||||
<Compile Include="Store\MaterielStoreOutDAL.cs" />
|
||||
<Compile Include="Store\OtherStoreInDAL.cs" />
|
||||
<Compile Include="Store\OtherStoreOutDAL.cs" />
|
||||
<Compile Include="Store\PuStoreInDAL.cs" />
|
||||
<Compile Include="Store\VoucherBase.cs" />
|
||||
<Compile Include="STVocher.cs" />
|
||||
|
||||
100
NX.ERP.U8/Store/OtherStoreInDAL.cs
Normal file
100
NX.ERP.U8/Store/OtherStoreInDAL.cs
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
15
NX.ERP.U8/Store/OtherStoreOutDAL.cs
Normal file
15
NX.ERP.U8/Store/OtherStoreOutDAL.cs
Normal 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")
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user