From 2f91ac58c802d7c99d3ebb6670f0622b7193f9a3 Mon Sep 17 00:00:00 2001 From: admin Date: Wed, 13 Jan 2021 09:02:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=85=A5=E5=BA=93=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NX.ERP.U8.App/FrmMain.cs | 7 +++--- NX.ERP.U8/Store/MaterielStoreOutDAL.cs | 4 +-- NX.ERP.U8/Store/OtherStoreInDAL.cs | 12 ++++----- NX.ERP.U8/Store/PuStoreInDAL.cs | 8 +++--- NX.ERP.U8/U8LoginContext.cs | 35 ++++++++------------------ 5 files changed, 27 insertions(+), 39 deletions(-) diff --git a/NX.ERP.U8.App/FrmMain.cs b/NX.ERP.U8.App/FrmMain.cs index 8d241ab..f6bcf37 100644 --- a/NX.ERP.U8.App/FrmMain.cs +++ b/NX.ERP.U8.App/FrmMain.cs @@ -298,7 +298,7 @@ namespace U8AppMain private void toolStripMenuItem2_Click(object sender, EventArgs e) { var a = new NX.ERP.U8.Store.PuStoreInDAL(); - a.AddPuStoreIn(new NX.ERP.Model.Store.PuStoreIn() + var id= a.AddPuStoreIn(new NX.ERP.Model.Store.PuStoreIn() { Code = "0001", //PersonCode = "wx065", @@ -321,7 +321,8 @@ namespace U8AppMain } } - }); ; ; + }); + } private void 材料出库单ToolStripMenuItem_Click(object sender, EventArgs e) @@ -364,7 +365,7 @@ namespace U8AppMain { Date=DateTime.Today, Code="111", - + WhCode="2", details = new List() { new NX.ERP.Model.Store.OtherStoreInDetail() diff --git a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs index 9117b49..a0e8967 100644 --- a/NX.ERP.U8/Store/MaterielStoreOutDAL.cs +++ b/NX.ERP.U8/Store/MaterielStoreOutDAL.cs @@ -21,7 +21,7 @@ namespace NX.ERP.U8.Store - public void AddMaterielStoreOut(MaterielStoreOut storeOut) + public string AddMaterielStoreOut(MaterielStoreOut storeOut) { VoucherParameter voucherParameter = new VoucherParameter { @@ -118,7 +118,7 @@ namespace NX.ERP.U8.Store try { - U8LoginContext.Instance.AddRdVoucher("U8API/MaterialOut/Add", voucherParameter); + return U8LoginContext.Instance.AddRdVoucher("U8API/MaterialOut/Add", voucherParameter); } catch (Exception err) { diff --git a/NX.ERP.U8/Store/OtherStoreInDAL.cs b/NX.ERP.U8/Store/OtherStoreInDAL.cs index 4018739..3c4e5ce 100644 --- a/NX.ERP.U8/Store/OtherStoreInDAL.cs +++ b/NX.ERP.U8/Store/OtherStoreInDAL.cs @@ -14,7 +14,7 @@ namespace NX.ERP.U8.Store } - public void AddVocher(Model.Store.OtherStoreIn storeIn) + public string AddVocher(Model.Store.OtherStoreIn storeIn) { VoucherParameter voucherParameter = new VoucherParameter @@ -37,7 +37,7 @@ namespace NX.ERP.U8.Store headXml.setAttribute("brdflag", 1); headXml.setAttribute("ccode", storeIn.Code); headXml.setAttribute("ddate", storeIn.Date); - headXml.setAttribute("cmaker","/"); + headXml.setAttribute("cmaker", "/"); headXml.setAttribute("cvouchtype", this.VoucherID); headXml.setAttribute("vt_id", ""); headXml.setAttribute("editprop", "A"); @@ -45,7 +45,7 @@ namespace NX.ERP.U8.Store headXml.setAttribute("cpersoncode", ""); headXml.setAttribute("crdcode", ""); - headXml.setAttribute("csource","库存"); + headXml.setAttribute("csource", "库存"); headXml.setAttribute("cwhcode", storeIn.WhCode); headXml.setAttribute("cbustype", "其他入库"); headXml.setAttribute("cmemo", ""); @@ -61,12 +61,12 @@ namespace NX.ERP.U8.Store bodyXml = domBody.createElement("z:row"); bodyXml.setAttribute("cinvcode", detail.InvCode); bodyXml.setAttribute("iquantity", detail.Quantity); - bodyXml.setAttribute("irowno",n+1); + bodyXml.setAttribute("irowno", n + 1); bodyXml.setAttribute("cbatch", ""); bodyXml.setAttribute("cposition", detail.Position); - bodyXml.setAttribute("cvmivencode",""); + bodyXml.setAttribute("cvmivencode", ""); bodyXml.setAttribute("dmadedate", ""); bodyXml.setAttribute("dvdate", ""); bodyXml.setAttribute("iexpiratdatecalcu", ""); @@ -86,7 +86,7 @@ namespace NX.ERP.U8.Store Console.WriteLine(str); try { - U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter); + return U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter); } catch (Exception err) { diff --git a/NX.ERP.U8/Store/PuStoreInDAL.cs b/NX.ERP.U8/Store/PuStoreInDAL.cs index c4b913f..01e4ca2 100644 --- a/NX.ERP.U8/Store/PuStoreInDAL.cs +++ b/NX.ERP.U8/Store/PuStoreInDAL.cs @@ -19,7 +19,7 @@ namespace NX.ERP.U8.Store /// 保存一个采购到货单 /// /// - public void AddPuStoreIn(Model.Store.PuStoreIn puStoreIn) + public string AddPuStoreIn(Model.Store.PuStoreIn puStoreIn) { VoucherParameter voucherParameter = new VoucherParameter @@ -63,7 +63,7 @@ namespace NX.ERP.U8.Store headXml.setAttribute("darvdate", Arrival.Date); headXml.setAttribute("itaxrate", Arrival.TaxRate); headXml.setAttribute("cptcode", Arrival.PTCode); - + IXMLDOMElement bodyXml; for (var n = 0; n < puStoreIn.PuStoreInDetails.Count; n++) { @@ -110,7 +110,7 @@ namespace NX.ERP.U8.Store Console.WriteLine(str); try { - U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter); + return U8LoginContext.Instance.AddRdVoucher("U8API/PuStoreIn/Add", voucherParameter); } catch (Exception err) { @@ -122,6 +122,6 @@ namespace NX.ERP.U8.Store } - + } } diff --git a/NX.ERP.U8/U8LoginContext.cs b/NX.ERP.U8/U8LoginContext.cs index f97b5d5..21bad90 100644 --- a/NX.ERP.U8/U8LoginContext.cs +++ b/NX.ERP.U8/U8LoginContext.cs @@ -175,8 +175,9 @@ namespace NX.ERP.U8 } - public void AddRdVoucher(string URL, VoucherParameter para) + public string AddRdVoucher(string URL, VoucherParameter para) { + string VoucherId; try { U8EnvContext u8EnvContext = new U8EnvContext(); @@ -230,48 +231,34 @@ namespace NX.ERP.U8 para.ReturnValue = false; u8ApiBroker.Release(); - return; + } para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue()); para.DOMMsg = u8ApiBroker.GetResult("domMsg") as DOMDocument; - + para.ErrMsg = u8ApiBroker.GetResult("errMsg") as string; if (para.ReturnValue) { para.VoucherId = u8ApiBroker.GetResult("VouchId") as string; - if (para.VoucherType.Equals("12")) - { - //para.VoucherCode = base.Util.GetTransVoucherCode(para.VoucherId); - } - else if (para.VoucherType.Equals("18")) - { - //para.VoucherCode = base.Util.GetCheckVoucherCode(para.VoucherId); - } - else if (para.VoucherType.Equals("19")) - { - // para.VoucherCode = base.Util.GetAdjustVoucherCode(para.VoucherId); - //if (base.Util.dbHelper.U8ExcuteNoneQuery("Update AdjustPVouchs Set cVouchCode = '" + para.VoucherCode + "' Where id = " + para.VoucherId) == 0) - //{ - // para.ErrMsg = "更新货位调整单子表单号失败!"; - // para.ReturnValue = false; - //} - } - else - { - //para.VoucherCode = base.Util.GetSTVoucherCode(para.VoucherId, para.VoucherType); - } + VoucherId = para.VoucherId; + } else { throw new Exception(para.ErrMsg); } u8ApiBroker.Release(); + return VoucherId; } catch (Exception ex3) { throw ex3; } + finally + { + + } }