章政 8 жил өмнө
parent
commit
c528d5a7f0

+ 15 - 16
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -277,14 +277,17 @@ namespace UAS_MES.Make
                             }
                             break;
                         case "S":
-                            sql.Clear();
-                            sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
-                            sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
-                            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows.Count == 0)
+                            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
                             {
-                                OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
-                                return;
+                                sql.Clear();
+                                sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
+                                sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
+                                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt.Rows.Count == 0)
+                                {
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                    return;
+                                }
                             }
                             break;
                         case "":
@@ -411,17 +414,13 @@ namespace UAS_MES.Make
 
         private void Packing_Click(object sender, EventArgs e)
         {
-            if (float.Parse(weight.Text) > MinWeight && int.Parse(weight.Text) < MaxWeight)
+            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and pa_status<>1"))
             {
-                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and pa_status<>1"))
-                {
-                    dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    pa_status.Text = "1";
-                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
-                }
-                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);
+                dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                pa_status.Text = "1";
+                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
             }
-            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量,不允许封箱\n", Color.Red);
+            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);
         }
 
         private void SendCheck_Click(object sender, EventArgs e)