From 83f47fc59a8680b1eace13e5aa0d3f36011478ee Mon Sep 17 00:00:00 2001 From: "hao.jin" Date: Sun, 29 May 2022 22:01:18 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=B4=AF=E8=AE=A1=E5=8F=91=E8=B4=A7=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E8=AE=A1=E7=AE=97Bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs | 6 +++--- Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs index bea8d86..a1a39d2 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDA.cs @@ -255,9 +255,9 @@ namespace Stone.WinModule.Standard ); } - string PartNumber = dtData.Rows[0]["PartNumber"].ToString(); - int quantity = Convert.ToInt32(dtData.Rows[0]["quantity"]); //本次需求货数量 - int quantity_transit = Convert.ToInt32(dtData.Rows[0]["quantity_transit"]); //在途数量 + string PartNumber = drData["PartNumber"].ToString(); + int quantity = Convert.ToInt32(drData["quantity"]); //本次需求货数量 + int quantity_transit = Convert.ToInt32(drData["quantity_transit"]); //在途数量 if (quantity_transit > 0) { diff --git a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs index de1ecfc..854bf6d 100644 --- a/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs +++ b/Stone.WinForm/Stone.WinModule/Standard/frmJISVDAASN.cs @@ -239,7 +239,7 @@ namespace Stone.WinModule.Standard var code = drData["PartNumber"].ToString(); var outQty = decimal.Parse(drData["Qty"].ToString()); var asnNum = drData["AsnNumber"].ToString(); - strsql = CreatePartOutSql(code, outQty, dtPartOutQty, asnNum,out dtPartOutQty); + strsql = CreatePartOutSql(db,code, outQty, dtPartOutQty, asnNum,out dtPartOutQty); if (!string.IsNullOrEmpty(strsql)) { db.Exec_NonQuery(strsql); @@ -789,14 +789,14 @@ namespace Stone.WinModule.Standard } } - private static string CreatePartOutSql(string PartCode, decimal outQty, DataTable dt, string asnNum,out DataTable dtPartOutQty) + private static string CreatePartOutSql(LocalDBService db,string PartCode, decimal outQty, DataTable dt, string asnNum,out DataTable dtPartOutQty) { dtPartOutQty = dt; string strsql = ""; if (dtPartOutQty.Select(" Code = '" + PartCode + "'").Length > 0) { //继续校验该ASN是否维护累计发货数量信息 - if (dtPartOutQty.Select(" AsnNum = '" + asnNum + "'").Length > 0) + if (dtPartOutQty.Select(" Code = '" + PartCode + "' and AsnNum = '" + asnNum + "'").Length > 0) { strsql = "Update t_PartOutQty" + " set PartOutQty += " + outQty + "," + @@ -812,7 +812,6 @@ namespace Stone.WinModule.Standard " LastOutTime = getdate()," + " AsnNum = '" + asnNum + "'" + " where Code = '" + PartCode + "'"; - var db = new LocalDBService(); db.Exec_NonQuery(strsql); //DT重新赋值 strsql = "select * from t_PartOutQty"; @@ -825,7 +824,6 @@ namespace Stone.WinModule.Standard { //该零件未维护累计发货数量信息 strsql = "Insert into t_PartOutQty(Code,PartOutQty,LastOutQty,LastOutTime,AsnNum) values ('" + PartCode + "'," + outQty + "," + outQty + ",getdate(),'"+ asnNum + "')"; - var db = new LocalDBService(); db.Exec_NonQuery(strsql); //DT重新赋值 strsql = "select * from t_PartOutQty";