Explorar o código

限制称量不能为空

章政 %!s(int64=6) %!d(string=hai) anos
pai
achega
8a2caf4a81
Modificáronse 1 ficheiros con 13 adicións e 5 borrados
  1. 13 5
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 13 - 5
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -109,6 +109,7 @@ namespace UAS_LabelMachine
             Type dgvType = this.LabelInf.GetType();
             PropertyInfo pi = dgvType.GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic);
             pi.SetValue(this.LabelInf, true, null);
+            pi.SetValue(this.GridPrcode, true, null);
             (new EnvironmentSettings()).ReportSettings.ShowProgress = false;
             Text = Text + "-" + Master;
         }
@@ -2025,11 +2026,18 @@ namespace UAS_LabelMachine
 
         private void ButtonWeigh_Click(object sender, EventArgs e)
         {
-            sql.Clear();
-            sql.Append("update prodiobarcode set pib_boxweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
-            sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
-            dh.ExecuteSql(sql.ToString(), "update");
-            LoadGridData(sender, e);
+            if (Weight.Text != "")
+            {
+                sql.Clear();
+                sql.Append("update prodiobarcode set pib_boxweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
+                sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
+                dh.ExecuteSql(sql.ToString(), "update");
+                LoadGridData(sender, e);
+            }
+            else
+            {
+                MessageBox.Show("请先连接电子秤!");
+            }
         }
         Regex reg = new Regex(@"\d+.\d+");
         ComInfoSet cis;