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