|
|
@@ -293,17 +293,24 @@ namespace UAS_MES.Make
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- List<string> SQLS = new List<string>();
|
|
|
- //删除明细
|
|
|
- SQLS.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "' and pd_innerboxcode='" + outboxcode.Text + "'");
|
|
|
- //减少箱内容量
|
|
|
- SQLS.Add("update package set pa_packageqty=pa_packageqty-1,pa_totalqty=pa_totalqty-(select pa_totalqty from package where pa_outboxcode='" + outboxcode.Text + "'),pa_currentqty=0,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
- SQLS.Add("update package set pa_mothercode='' where pa_outboxcode='" + outboxcode.Text + "'");
|
|
|
- dh.ExecuteSQLTran(SQLS.ToArray());
|
|
|
- OperateResult.AppendText(">>箱号" + outboxcode.Text + "取消采集成功\n", Color.Green);
|
|
|
- LoadCollectNum();
|
|
|
- LoadGridData();
|
|
|
- outboxcode.Clear();
|
|
|
+ if (dh.CheckExist("packagedetail", "pd_outboxcode='" + pa_outboxcode.Text + "' and pd_innerboxcode='" + outboxcode.Text + "'"))
|
|
|
+ {
|
|
|
+ List<string> SQLS = new List<string>();
|
|
|
+ //删除明细
|
|
|
+ SQLS.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "' and pd_innerboxcode='" + outboxcode.Text + "'");
|
|
|
+ //减少箱内容量
|
|
|
+ SQLS.Add("update package set pa_packageqty=pa_packageqty-1,pa_totalqty=pa_totalqty-(select pa_totalqty from package where pa_outboxcode='" + outboxcode.Text + "'),pa_currentqty=pa_currentqty-1,pa_status=0 where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ SQLS.Add("update package set pa_mothercode='' where pa_outboxcode='" + outboxcode.Text + "'");
|
|
|
+ dh.ExecuteSQLTran(SQLS.ToArray());
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "取消采集成功\n", Color.Green);
|
|
|
+ LoadCollectNum();
|
|
|
+ LoadGridData();
|
|
|
+ outboxcode.Clear();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "不在大箱" + pa_outboxcode.Text + "\n", Color.Green);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, outboxcode);
|