Browse Source

修改字符为空的处理

章政 8 years ago
parent
commit
5aabf4571a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

+ 3 - 3
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -206,7 +206,7 @@ namespace UAS_MES.Make
                                 pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
                             }
                         }
-                        else if (pa_outboxcode.Text == "" || pa_status.Text == "1" && AutoOutBoxCode.Checked)
+                        else if (pa_outboxcode.Text != "" && pa_status.Text == "1" && AutoOutBoxCode.Checked)
                         {
                             pa_outboxcode.Text = LogicHandler.GetOutBoxCode("PALLET", "", pa_prodcode.Text, User.UserCode);
                         }
@@ -233,7 +233,7 @@ namespace UAS_MES.Make
                         {
                             pa_id = dt.Rows[0]["pa_id"].ToString();
                         }
-                        if (int.Parse(pa_totalqty.Text) > 0)
+                        if (int.Parse(pa_totalqty.Text == "" ? "0" : pa_totalqty.Text) > 0)
                         {
                             if (!LogicHandler.CheckPackRule(pr_packrule.Text, pa_outboxcode.Text, outboxcode.Text, pa_makecode.Text, pa_salecode.Text, pa_prodcode.Text, out ErrorMessage))
                             {
@@ -353,7 +353,7 @@ namespace UAS_MES.Make
             }
             else if (dt.Rows.Count == 1)
             {
-                dh.ExecuteSql("update package set pa_prodcode='"+ pd_prodcode.Text + "',pa_salecode='"+ pd_salecode.Text + "',pa_makecode='"+ pd_makecode.Text + "' where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
+                dh.ExecuteSql("update package set pa_prodcode='" + pd_prodcode.Text + "',pa_salecode='" + pd_salecode.Text + "',pa_makecode='" + pd_makecode.Text + "' where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
             }
             BaseUtil.FillDgvWithDataTable(PackageInf, dt);
         }