Browse Source

封箱和解除进行提示

章政 8 years ago
parent
commit
f8f60abc53

+ 24 - 16
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -339,20 +339,24 @@ namespace UAS_MES.Make
             {
                 if (dh.getFieldDataByCondition("package", "pa_mothercode", "pa_outboxcode='" + bigoutboxcode.Text + "'").ToString() == "")
                 {
-                    if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + bigoutboxcode.Text + "'").ToString() != "")
-                        LogicHandler.OutBoxDrawStepPass(bigoutboxcode.Text, pa_makecode.Text, User.UserSourceCode);
-                    else
+                    string Delete = MessageBox.Show(this.ParentForm, "是否确认拆箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                    if (Delete == "Yes")
                     {
-                        List<string> SQLS = new List<string>();
-                        SQLS.Add("delete from packagedetail where pd_outboxcode='" + bigoutboxcode.Text + "'");
-                        SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + bigoutboxcode.Text + "'");
-                        SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + bigoutboxcode.Text + "'");
-                        dh.ExecuteSQLTran(SQLS.ToArray());
+                        if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + bigoutboxcode.Text + "'").ToString() != "")
+                            LogicHandler.OutBoxDrawStepPass(bigoutboxcode.Text, pa_makecode.Text, User.UserSourceCode);
+                        else
+                        {
+                            List<string> SQLS = new List<string>();
+                            SQLS.Add("delete from packagedetail where pd_outboxcode='" + bigoutboxcode.Text + "'");
+                            SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + bigoutboxcode.Text + "'");
+                            SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + bigoutboxcode.Text + "'");
+                            dh.ExecuteSQLTran(SQLS.ToArray());
+                        }
+                        //将子箱的母箱编号置成空
+                        OperateResult.AppendText(">>箱号" + bigoutboxcode.Text + "解除成功\n", Color.Green);
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "解除大箱" + bigoutboxcode.Text + "成功", bigoutboxcode.Text, "");
+                        palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                     }
-                    //将子箱的母箱编号置成空
-                    OperateResult.AppendText(">>箱号" + bigoutboxcode.Text + "解除成功\n", Color.Green);
-                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "解除大箱" + bigoutboxcode.Text + "成功", bigoutboxcode.Text, "");
-                    palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                 }
                 else OperateResult.AppendText(">>箱号" + bigoutboxcode.Text + "已装箱,不能取消解除装箱\n", Color.Red);
             }
@@ -376,10 +380,14 @@ namespace UAS_MES.Make
                 {
                     if (dt.Rows[0]["pa_status"].ToString() == "0")
                     {
-                        OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "装大箱成功\n", Color.Green);
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "装箱" + bigoutboxcode.Text + "成功", outboxcode.Text, "");
-                        dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
-                        pa_status.Text = "1";
+                        string Seal = MessageBox.Show(this.ParentForm, "是否确认封箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        if (Seal == "Yes")
+                        {
+                            OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "装大箱成功\n", Color.Green);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "装箱" + bigoutboxcode.Text + "成功", outboxcode.Text, "");
+                            dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
+                            pa_status.Text = "1";
+                        }
                     }
                     else OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "已封大箱\n", Color.Red);
                 }

+ 24 - 16
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -301,20 +301,24 @@ namespace UAS_MES.Make
         {
             if (dh.getRowCount("packagedetail", "pd_outboxcode='" + palletcode.Text + "'") > 0)
             {
-                //如果含有下一执行步骤的撤销过站,否则直接删除
-                if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + palletcode.Text + "'").ToString() != "")
-                    LogicHandler.OutBoxDrawStepPass(palletcode.Text, pa_makecode.Text, User.UserSourceCode);
-                else
+                string Delete = MessageBox.Show(this.ParentForm, "是否确认拆栈板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                if (Delete == "Yes")
                 {
-                    List<string> SQLS = new List<string>();
-                    SQLS.Add("delete from packagedetail where pd_outboxcode='" + palletcode.Text + "'");
-                    SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + palletcode.Text + "'");
-                    SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + palletcode.Text + "'");
-                    dh.ExecuteSQLTran(SQLS.ToArray());
+                    //如果含有下一执行步骤的撤销过站,否则直接删除
+                    if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + palletcode.Text + "'").ToString() != "")
+                        LogicHandler.OutBoxDrawStepPass(palletcode.Text, pa_makecode.Text, User.UserSourceCode);
+                    else
+                    {
+                        List<string> SQLS = new List<string>();
+                        SQLS.Add("delete from packagedetail where pd_outboxcode='" + palletcode.Text + "'");
+                        SQLS.Add("update package set pa_packageqty=0,pa_totalqty=0,pa_currentqty=0,pa_status=0 where pa_outboxcode='" + palletcode.Text + "'");
+                        SQLS.Add("update package set pa_mothercode='' where pa_mothercode='" + palletcode.Text + "'");
+                        dh.ExecuteSQLTran(SQLS.ToArray());
+                    }
+                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "解除栈板" + palletcode.Text + "成功", palletcode.Text, "");
+                    OperateResult.AppendText(">>栈板号" + palletcode.Text + "解除成功\n", Color.Green);
+                    palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
                 }
-                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "解除栈板" + palletcode.Text + "成功", palletcode.Text, "");
-                OperateResult.AppendText(">>栈板号" + palletcode.Text + "解除成功\n", Color.Green);
-                palletcode_KeyDown(new object(), new KeyEventArgs(Keys.Enter));
             }
             else OperateResult.AppendText(">>栈板号" + palletcode.Text + "未采集箱\n", Color.Red);
         }
@@ -336,10 +340,14 @@ namespace UAS_MES.Make
                 {
                     if (dt.Rows[0]["pa_status"].ToString() == "0")
                     {
-                        OperateResult.AppendText(">>栈板号" + palletcode.Text + "装栈板成功\n", Color.Green);
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "装栈板" + palletcode.Text + "成功", outboxcode.Text, "");
-                        dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + palletcode.Text + "'", "update");
-                        pa_status.Text = "1";
+                        string Seal = MessageBox.Show(this.ParentForm, "是否确认封栈板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                        if (Seal == "Yes")
+                        {
+                            OperateResult.AppendText(">>栈板号" + palletcode.Text + "装栈板成功\n", Color.Green);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "装栈板" + palletcode.Text + "成功", outboxcode.Text, "");
+                            dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + palletcode.Text + "'", "update");
+                            pa_status.Text = "1";
+                        }
                     }
                     else OperateResult.AppendText(">>栈板号" + palletcode.Text + "已封栈板\n", Color.Red);
                 }