소스 검색

产品重量设置修改

shim 8 년 전
부모
커밋
ce3e9cdd2f
2개의 변경된 파일58개의 추가작업 그리고 17개의 파일을 삭제
  1. 20 17
      UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.Designer.cs
  2. 38 0
      UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

+ 20 - 17
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.Designer.cs

@@ -43,6 +43,8 @@
             this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.panel4 = new System.Windows.Forms.Panel();
+            this.errorValue = new System.Windows.Forms.TextBox();
+            this.standardWeight = new System.Windows.Forms.TextBox();
             this.label7 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
@@ -58,8 +60,6 @@
             this.stopWeigh = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.startWeigh = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
-            this.standardWeight = new System.Windows.Forms.TextBox();
-            this.errorValue = new System.Windows.Forms.TextBox();
             this.panel4.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -196,6 +196,24 @@
             this.panel4.Size = new System.Drawing.Size(515, 156);
             this.panel4.TabIndex = 221;
             // 
+            // errorValue
+            // 
+            this.errorValue.Location = new System.Drawing.Point(245, 19);
+            this.errorValue.Name = "errorValue";
+            this.errorValue.Size = new System.Drawing.Size(100, 28);
+            this.errorValue.TabIndex = 52;
+            this.errorValue.Enter += new System.EventHandler(this.standardWeight_Enter);
+            this.errorValue.Leave += new System.EventHandler(this.standardWeight_Leave);
+            // 
+            // standardWeight
+            // 
+            this.standardWeight.Location = new System.Drawing.Point(83, 19);
+            this.standardWeight.Name = "standardWeight";
+            this.standardWeight.Size = new System.Drawing.Size(100, 28);
+            this.standardWeight.TabIndex = 51;
+            this.standardWeight.Enter += new System.EventHandler(this.standardWeight_Enter);
+            this.standardWeight.Leave += new System.EventHandler(this.standardWeight_Leave);
+            // 
             // label7
             // 
             this.label7.AutoSize = true;
@@ -410,21 +428,6 @@
             this.ma_code.TextBoxEnable = false;
             this.ma_code.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox.OnTextChange(this.ma_code_UserControlTextChanged);
             // 
-            // standardWeight
-            // 
-            this.standardWeight.Location = new System.Drawing.Point(83, 19);
-            this.standardWeight.Name = "standardWeight";
-            this.standardWeight.Size = new System.Drawing.Size(100, 28);
-            this.standardWeight.TabIndex = 51;
-            this.standardWeight.TextChanged += new System.EventHandler(this.standardWeight_TextChanged);
-            // 
-            // errorValue
-            // 
-            this.errorValue.Location = new System.Drawing.Point(245, 19);
-            this.errorValue.Name = "errorValue";
-            this.errorValue.Size = new System.Drawing.Size(100, 28);
-            this.errorValue.TabIndex = 52;
-            // 
             // Packing_ProdWeightSet
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);

+ 38 - 0
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

@@ -44,6 +44,9 @@ namespace UAS_MES.Packing
         List<string> sncodes = new List<string>();//存序列号
         List<string> indates = new List<string>();//存时间
         List<string> weights = new List<string>();//存重量
+
+        string recordSW = ""; //存标准重量
+        string recordEV = "";//存误差值
         public Packing_ProdWeightSet()
         {
             InitializeComponent();
@@ -304,8 +307,43 @@ namespace UAS_MES.Packing
         }
 
         private void standardWeight_TextChanged(object sender, EventArgs e)
+        {
+        }
+
+        private void standardWeight_Leave(object sender, EventArgs e)
         {
             //在采样的时候不能更改
+            if (showResult.Items.Count > 0)
+            {
+                if ((sender as TextBox).Name == "standardWeight"&& standardWeight.Text == recordSW)
+                {
+                    return;
+                }
+                else if((sender as TextBox).Name == "errorValue" && errorValue.Text == recordEV)
+                {
+                    return;
+                }
+                if (MessageBox.Show("是否修改标准重量或误差值重新采样", "提示", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
+                {
+                    //选择取消,数据回退
+                    standardWeight.Text = recordSW;
+                    errorValue.Text = recordEV;
+                }
+                else
+                {
+                    //选择确认,重新采样
+                    showResult.Items.Clear();
+                    indates.Clear();
+                    sncodes.Clear();
+                    weights.Clear();
+                }
+            }
+        }
+
+        private void standardWeight_Enter(object sender, EventArgs e)
+        {
+            recordSW = standardWeight.Text;
+            recordEV = errorValue.Text;
         }
     }
 }