|
|
@@ -145,6 +145,7 @@ namespace UAS_MES.Make
|
|
|
sql.Append("sysdate,'" + User.UserCode + "','" + Barremain + "','" + Barremain + "','" + sp_oneuseqty + "','" + sp_soncode + "','" + ma_id + "','" + User.UserSourceCode + "')");
|
|
|
dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
dh.UpdateByCondition("barcode", "bar_place='" + ma_code.Text + "'", "bar_code='" + pr_batchnum.Text + "'");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "岗位备料", "上料物料" + pr_batchnum.Text, "", "");
|
|
|
//数据插入成功后加载Grid的数据
|
|
|
FillDataGridView();
|
|
|
OperateResult.AppendText(">>物料批号" + pr_batchnum.Text + "备料成功\n", Color.Green, pr_batchnum);
|
|
|
@@ -196,11 +197,18 @@ namespace UAS_MES.Make
|
|
|
if (e.RowIndex >= 0)
|
|
|
{
|
|
|
string id = BatchProductDGV.Rows[e.RowIndex].Cells["mss_id"].Value.ToString();
|
|
|
+ string useqty = BatchProductDGV.Rows[e.RowIndex].Cells["mss_useqty"].Value.ToString();
|
|
|
+ string soncode = BatchProductDGV.Rows[e.RowIndex].Cells["sp_soncode"].Value.ToString();
|
|
|
if (id != "0")
|
|
|
{
|
|
|
- BatchProductDGV.Rows.RemoveAt(e.RowIndex);
|
|
|
- dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
|
|
|
- OperateResult.AppendText(">>删除成功\n");
|
|
|
+ if (useqty == "0")
|
|
|
+ {
|
|
|
+ BatchProductDGV.Rows.RemoveAt(e.RowIndex);
|
|
|
+ dh.ExecuteSql("delete from makesourcestock where mss_id='" + id + "'", "delete");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "岗位备料", "删除物料" + soncode, "", "");
|
|
|
+ OperateResult.AppendText(">>料号" + soncode + "删除成功\n");
|
|
|
+ }
|
|
|
+ else OperateResult.AppendText(">>料号" + soncode + "已被使用,不允许删除\n", Color.Red);
|
|
|
}
|
|
|
}
|
|
|
}
|