瀏覽代碼

拆箱SQL修改

Hcsy 7 年之前
父節點
當前提交
49ea59da52

+ 2 - 4
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -812,14 +812,12 @@ namespace UAS_MES.Make
                                 SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                                 //抽检批次不为空的时候进行移除
                                 dh.ExecuteSQLTran(SQLS1.ToArray());
-                                List<string> SQLS2 = new List<string>();
                                 string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + pr_code.Text + "'").ToString();
                                 //置空原箱
-                                SQLS2.Add("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = "+ standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = "+ standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'","update");
                                 pa_status.Text = "0";
                                 //删除箱的明细
-                                SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");
-                                dh.ExecuteSQLTran(SQLS2.ToArray());
+                                dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'", "delete");
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱拆解", "成功", pa_outboxcode.Text, ob_checkno.Text);
                                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "成功拆解!\n", Color.Green);
                                 LoadGridData();

+ 2 - 4
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -805,14 +805,12 @@ namespace UAS_MES.Make
                                 SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                                 //抽检批次不为空的时候进行移除
                                 dh.ExecuteSQLTran(SQLS1.ToArray());
-                                List<string> SQLS2 = new List<string>();
                                 string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + pr_code.Text + "'").ToString();
                                 //置空原箱
-                                SQLS2.Add("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = "+ standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = "+ standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'","update");
                                 pa_status.Text = "0";
                                 //删除箱的明细
-                                SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");
-                                dh.ExecuteSQLTran(SQLS2.ToArray());
+                                dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'","delete");
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱拆解", "成功", pa_outboxcode.Text, ob_checkno.Text);
                                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "成功拆解!\n", Color.Green);
                                 LoadGridData();

+ 3 - 5
UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -810,14 +810,12 @@ namespace UAS_MES_NEW.Packing
                                 SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                                 //抽检批次不为空的时候进行移除
                                 dh.ExecuteSQLTran(SQLS1.ToArray());
-                                List<string> SQLS2 = new List<string>();
-                                string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty","pr_code = '"+pr_code.Text+"'").ToString();
+                                string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + pr_code.Text + "'").ToString();
                                 //置空原箱
-                                SQLS2.Add("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY= "+ standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = " + standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                                 pa_status.Text = "0";
                                 //删除箱的明细
-                                SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");
-                                dh.ExecuteSQLTran(SQLS2.ToArray());
+                                dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'", "delete");
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱拆解", "成功", pa_outboxcode.Text, ob_checkno.Text);
                                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "成功拆解!\n", Color.Green);
                                 LoadGridData();

+ 2 - 4
UAS_MES_NEW/FunctionCode/Packing/Packing_PackageCollectionWeigh.cs

@@ -805,14 +805,12 @@ namespace UAS_MES_NEW.Packing
                                 SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                                 //抽检批次不为空的时候进行移除
                                 dh.ExecuteSQLTran(SQLS1.ToArray());
-                                List<string> SQLS2 = new List<string>();
                                 string standqty = dh.getFieldDataByCondition("product", "pr_outboxinnerqty", "pr_code = '" + pr_code.Text + "'").ToString();
                                 //置空原箱
-                                SQLS2.Add("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = " + standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                dh.ExecuteSql("update package set pa_checkno='',pa_prodcode='',pa_packtype='',pa_salecode='',pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0,PA_STANDARDQTY = " + standqty + " where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                                 pa_status.Text = "0";
                                 //删除箱的明细
-                                SQLS2.Add("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'");
-                                dh.ExecuteSQLTran(SQLS2.ToArray());
+                                dh.ExecuteSql("delete from packagedetail where pd_outboxcode='" + pa_outboxcode.Text + "'", "delete");
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "卡通箱拆解", "成功", pa_outboxcode.Text, ob_checkno.Text);
                                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "成功拆解!\n", Color.Green);
                                 LoadGridData();