Browse Source

简化代码

章政 8 years ago
parent
commit
17c25491b1
1 changed files with 2 additions and 9 deletions
  1. 2 9
      UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

+ 2 - 9
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -97,13 +97,13 @@ namespace UAS_MES.Make
                     int ActualWeight = int.Parse(weight.Text == "" ? "0" : weight.Text);
                     if (ActualWeight >= MinWeight && ActualWeight <= MaxWeight)
                     {
-                        OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
                         if (AutoPrint.Checked)
                         {
                             OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green);
                             Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                         }
-                        AfterWeighPass();
+                        dh.ExecuteSql("update package set pa_weight=" + weight.Text + ", pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
+                        OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测合格\n", Color.Green, outboxcode);
                     }
                     else OperateResult.AppendText(">>箱号" + outboxcode.Text + "检测未通过\n", Color.Red, outboxcode);
                 }
@@ -139,13 +139,6 @@ namespace UAS_MES.Make
             }
         }
 
-        private void AfterWeighPass()
-        {
-            string ErrorMessage;
-            dh.ExecuteSql("update package set pa_weight=" + weight.Text + ", pa_printcount= nvl(pa_printcount,0)+1 where pa_outboxcode='" + outboxcode.Text + "'", "update");
-            outboxcode.Text = "";
-        }
-
         //确认打印
         private void Confirm_Click(object sender, EventArgs e)
         {