瀏覽代碼

产品重量设置保存按钮修改

shim 8 年之前
父節點
當前提交
4f3bda91d2

+ 5 - 5
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.Designer.cs

@@ -184,6 +184,7 @@
             this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel4.Controls.Add(this.errorValue);
             this.panel4.Controls.Add(this.standardWeight);
+            this.panel4.Controls.Add(this.confirm);
             this.panel4.Controls.Add(this.label7);
             this.panel4.Controls.Add(this.unit);
             this.panel4.Controls.Add(this.label6);
@@ -230,9 +231,9 @@
             this.unit.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.unit.Location = new System.Drawing.Point(371, 22);
             this.unit.Name = "unit";
-            this.unit.Size = new System.Drawing.Size(25, 27);
+            this.unit.Size = new System.Drawing.Size(36, 27);
             this.unit.TabIndex = 47;
-            this.unit.Text = "g";
+            this.unit.Text = "kg";
             // 
             // label6
             // 
@@ -318,14 +319,14 @@
             this.confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("confirm.DownImage")));
             this.confirm.Image = null;
             this.confirm.IsShowBorder = true;
-            this.confirm.Location = new System.Drawing.Point(332, 526);
+            this.confirm.Location = new System.Drawing.Point(370, 86);
             this.confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("confirm.MoveImage")));
             this.confirm.Name = "confirm";
             this.confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("confirm.NormalImage")));
             this.confirm.Power = null;
             this.confirm.Size = new System.Drawing.Size(75, 28);
             this.confirm.TabIndex = 227;
-            this.confirm.Text = "确认";
+            this.confirm.Text = "保存";
             this.confirm.UseVisualStyleBackColor = false;
             this.confirm.Click += new System.EventHandler(this.confirm_Click);
             // 
@@ -436,7 +437,6 @@
             this.ClientSize = new System.Drawing.Size(1120, 596);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.sncode);
-            this.Controls.Add(this.confirm);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.ComList);
             this.Controls.Add(this.BaudRate);

+ 9 - 2
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

@@ -190,7 +190,7 @@ namespace UAS_MES.Packing
             string serialNum = dh.GetSerialNumberByCaller("ProdWeightSample");
             sql.Clear();
             sql.Append("insert into PRODWEIGHTSAMPLE(PWS_CODE,PWS_SNCODE,PWS_MAKECODE,PWS_PRODCODE,PWS_INDATE,PWS_WEIGHT,PWS_UNIT) ");
-            sql.Append("values ('"+serialNum+"',:sncode,'"+ma_code.Text+"','"+pr_code.Text+ "',TO_Date(:indate,'YYYY-MM-dd HH24:mi:ss'),:weight,'" + pr_cartonunit.Text+"')");
+            sql.Append("values ('"+serialNum+"',:sncode,'"+ma_code.Text+"','"+pr_code.Text+ "',TO_Date(:indate,'YYYY-MM-dd HH24:mi:ss'),:weight,'" + unit.Text+"')");
             dh.BatchInsert(sql.GetString(), new string[] { "sncode", "indate" , "weight" },sncodes.ToArray(),indates.ToArray(),weights.ToArray());
         }
 
@@ -341,7 +341,14 @@ namespace UAS_MES.Packing
                 //取二者平均值来
                 standardWeight.Text = (double.Parse(d.Rows[0]["PR_COLORBOXMAXW"].ToString()) + double.Parse(d.Rows[0]["PR_COLORBOXMINW"].ToString())) / 2 + "";
             }
-            unit.Text = d.Rows[0]["PR_COLORBOXUNIT"].ToString();
+            if (d.Rows[0]["PR_COLORBOXUNIT"].ToString() != "")
+            {
+                unit.Text = d.Rows[0]["PR_COLORBOXUNIT"].ToString();
+            }
+            else
+            {
+                unit.Text = "kg";
+            }
             //取误差值
             errorValue.Text = dh.GetConfig("prodWeightErrorValue", "MESSetting").ToString();
             //查询重量设置采样个数