Browse Source

添加OQC计数,大写时清除输入框内容

章政 7 years ago
parent
commit
00791eac9b

+ 2 - 1
UAS-MES/CustomControl/TextBoxWithIcon/SNCodeEnterTextBox.cs

@@ -98,7 +98,8 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             { 
                 if (CapsLockStatus)
                 {
-                    BaseUtil.ShowError("大写锁定打开,开启大写锁定会使采集内容不准确,请按Caps Lock关闭大写锁定");
+                    Text = "";
+                    BaseUtil.ShowError("请关闭大写锁定键[Caps Lock]");
                 }
             }
         }

+ 7 - 14
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -69,7 +69,7 @@ namespace UAS_MES.OQC
                 {
                     if (ErrorMessage == "")
                     {
-                        ad_qty.Text = "";
+                        ob_sampleqty.Text = "";
                         ob_maxngacceptqty.Text = "";
                         BaseUtil.SetFormValue(Controls, dt[0]);
                         BaseUtil.FillDgvWithDataTable(CheckTypeDGV, dt[1]);
@@ -107,7 +107,7 @@ namespace UAS_MES.OQC
                 List<string> ci_kind_update = new List<string>();
                 List<string> oi_sampleqty_update = new List<string>();
                 int ChooseCount = 0;
-                if (int.Parse(ob_maxngacceptqty.Text == "" ? "0" : ob_maxngacceptqty.Text) > int.Parse(ad_qty.Text == "" ? "0" : ad_qty.Text))
+                if (int.Parse(ob_maxngacceptqty.Text == "" ? "0" : ob_maxngacceptqty.Text) > int.Parse(ob_sampleqty.Text == "" ? "0" : ob_sampleqty.Text))
                 {
                     OperateResult.AppendText(">>最大不合格通过数不允许大于抽检数\n", Color.Red);
                     return;
@@ -185,15 +185,8 @@ namespace UAS_MES.OQC
             }
             else
             {
-                int result = (int)dh.ExecuteSql("update OQCBatch set ob_projectcode='" + ob_projectcode.Text + "',ob_remark = '" + ob_remark.Text + "',ob_aqlcode='" + ob_aqlcode.Text + "',ob_maxngacceptqty='" + ob_maxngacceptqty.Text + "' where ob_checkno='" + ob_checkno.Text + "' ", "update");
-                if (result > 0)
-                {
-                    return true;
-                }
-                else
-                {
-                    return false;
-                }
+                int result = (int)dh.ExecuteSql("update OQCBatch set ob_projectcode='" + ob_projectcode.Text + "',ob_remark = '" + ob_remark.Text + "',ob_aqlcode='" + ob_aqlcode.Text + "',ob_maxngacceptqty='" + ob_maxngacceptqty.Text + "',ob_actsampleqty='" + ob_sampleqty.Text + "' where ob_checkno='" + ob_checkno.Text + "' ", "update");
+                return result > 0;
             }
         }
 
@@ -236,7 +229,7 @@ namespace UAS_MES.OQC
                         if (batchqty > minqty && batchqty <= maxqty)
                         {
                             ob_maxngacceptqty.Text = dt.Rows[i]["ad_maxngacceptqty"].ToString();
-                            ad_qty.Text = dt.Rows[i]["ad_qty"].ToString();
+                            ob_sampleqty.Text = dt.Rows[i]["ad_qty"].ToString();
                             Find = true;
                         }
                     }
@@ -244,7 +237,7 @@ namespace UAS_MES.OQC
                 if (!Find)
                 {
                     ob_maxngacceptqty.Text = "";
-                    ad_qty.Text = "";
+                    ob_sampleqty.Text = "";
                 }
             }
         }
@@ -253,7 +246,7 @@ namespace UAS_MES.OQC
         {
             for (int i = 0; i < CheckTypeDGV.Rows.Count; i++)
             {
-                CheckTypeDGV.Rows[i].Cells["oi_sampleqty"].Value = ad_qty.Text;
+                CheckTypeDGV.Rows[i].Cells["oi_sampleqty"].Value = ob_sampleqty.Text;
             }
         }
 

+ 72 - 72
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.designer.cs

@@ -43,8 +43,8 @@
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
             this.ob_maxngacceptqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ad_qty = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
-            this.ad_qty_label = new System.Windows.Forms.Label();
+            this.ob_sampleqty = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
+            this.ob_sampleqty_label = new System.Windows.Forms.Label();
             this.ob_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_aqlcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.pr_detail = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -55,17 +55,17 @@
             this.GetBatch = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Save = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.CheckTypeDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.oi_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ci_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ci_kind = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.oi_sampleqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_nowcheckqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.obd_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ChooseAll = new UAS_MES.CustomControl.ButtonUtil.ChooseAllButton();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.oi_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ci_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ci_kind = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.oi_sampleqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
@@ -209,8 +209,8 @@
             // 
             this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel1.Controls.Add(this.ob_maxngacceptqty);
-            this.panel1.Controls.Add(this.ad_qty);
-            this.panel1.Controls.Add(this.ad_qty_label);
+            this.panel1.Controls.Add(this.ob_sampleqty);
+            this.panel1.Controls.Add(this.ob_sampleqty_label);
             this.panel1.Controls.Add(this.ob_remark);
             this.panel1.Controls.Add(this.ob_remark_label);
             this.panel1.Controls.Add(this.ob_aqlcode);
@@ -238,26 +238,26 @@
             this.ob_maxngacceptqty.TabIndex = 195;
             this.ob_maxngacceptqty.Tag = "NoAuto";
             // 
-            // ad_qty
+            // ob_sampleqty
             // 
-            this.ad_qty.Location = new System.Drawing.Point(100, 74);
-            this.ad_qty.Margin = new System.Windows.Forms.Padding(4);
-            this.ad_qty.Name = "ad_qty";
-            this.ad_qty.Size = new System.Drawing.Size(204, 25);
-            this.ad_qty.TabIndex = 194;
-            this.ad_qty.Text = "0";
-            this.ad_qty.TextChanged += new System.EventHandler(this.ad_qty_TextChanged_1);
+            this.ob_sampleqty.Location = new System.Drawing.Point(100, 74);
+            this.ob_sampleqty.Margin = new System.Windows.Forms.Padding(4);
+            this.ob_sampleqty.Name = "ob_sampleqty";
+            this.ob_sampleqty.Size = new System.Drawing.Size(204, 25);
+            this.ob_sampleqty.TabIndex = 194;
+            this.ob_sampleqty.Text = "0";
+            this.ob_sampleqty.TextChanged += new System.EventHandler(this.ad_qty_TextChanged_1);
             // 
-            // ad_qty_label
+            // ob_sampleqty_label
             // 
-            this.ad_qty_label.AutoSize = true;
-            this.ad_qty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ad_qty_label.Location = new System.Drawing.Point(16, 74);
-            this.ad_qty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ad_qty_label.Name = "ad_qty_label";
-            this.ad_qty_label.Size = new System.Drawing.Size(72, 27);
-            this.ad_qty_label.TabIndex = 193;
-            this.ad_qty_label.Text = "样本数";
+            this.ob_sampleqty_label.AutoSize = true;
+            this.ob_sampleqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_sampleqty_label.Location = new System.Drawing.Point(16, 74);
+            this.ob_sampleqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_sampleqty_label.Name = "ob_sampleqty_label";
+            this.ob_sampleqty_label.Size = new System.Drawing.Size(72, 27);
+            this.ob_sampleqty_label.TabIndex = 193;
+            this.ob_sampleqty_label.Text = "样本数";
             // 
             // ob_remark
             // 
@@ -441,6 +441,50 @@
             this.CheckTypeDGV.Size = new System.Drawing.Size(993, 398);
             this.CheckTypeDGV.TabIndex = 167;
             // 
+            // Choose
+            // 
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Choose.DataPropertyName = "Choose";
+            this.Choose.HeaderText = "勾选";
+            this.Choose.Name = "Choose";
+            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.Choose.Width = 60;
+            // 
+            // oi_id
+            // 
+            this.oi_id.DataPropertyName = "oi_id";
+            this.oi_id.HeaderText = "oi_id";
+            this.oi_id.Name = "oi_id";
+            this.oi_id.Visible = false;
+            // 
+            // ci_id
+            // 
+            this.ci_id.DataPropertyName = "ci_id";
+            this.ci_id.HeaderText = "ci_id";
+            this.ci_id.Name = "ci_id";
+            this.ci_id.ReadOnly = true;
+            this.ci_id.Visible = false;
+            // 
+            // ci_kind
+            // 
+            this.ci_kind.DataPropertyName = "ci_kind";
+            this.ci_kind.HeaderText = "检验类型";
+            this.ci_kind.Name = "ci_kind";
+            this.ci_kind.ReadOnly = true;
+            this.ci_kind.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.ci_kind.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.ci_kind.Width = 150;
+            // 
+            // oi_sampleqty
+            // 
+            this.oi_sampleqty.DataPropertyName = "oi_sampleqty";
+            this.oi_sampleqty.HeaderText = "样本数量";
+            this.oi_sampleqty.Name = "oi_sampleqty";
+            this.oi_sampleqty.ReadOnly = true;
+            this.oi_sampleqty.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.oi_sampleqty.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.oi_sampleqty.Width = 150;
+            // 
             // ob_prodcode
             // 
             this.ob_prodcode.AllPower = null;
@@ -536,50 +580,6 @@
             this.ChooseAll.Text = "全选";
             this.ChooseAll.UseVisualStyleBackColor = true;
             // 
-            // Choose
-            // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.Choose.DataPropertyName = "Choose";
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.Choose.Width = 60;
-            // 
-            // oi_id
-            // 
-            this.oi_id.DataPropertyName = "oi_id";
-            this.oi_id.HeaderText = "oi_id";
-            this.oi_id.Name = "oi_id";
-            this.oi_id.Visible = false;
-            // 
-            // ci_id
-            // 
-            this.ci_id.DataPropertyName = "ci_id";
-            this.ci_id.HeaderText = "ci_id";
-            this.ci_id.Name = "ci_id";
-            this.ci_id.ReadOnly = true;
-            this.ci_id.Visible = false;
-            // 
-            // ci_kind
-            // 
-            this.ci_kind.DataPropertyName = "ci_kind";
-            this.ci_kind.HeaderText = "检验类型";
-            this.ci_kind.Name = "ci_kind";
-            this.ci_kind.ReadOnly = true;
-            this.ci_kind.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.ci_kind.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.ci_kind.Width = 150;
-            // 
-            // oi_sampleqty
-            // 
-            this.oi_sampleqty.DataPropertyName = "oi_sampleqty";
-            this.oi_sampleqty.HeaderText = "样本数量";
-            this.oi_sampleqty.Name = "oi_sampleqty";
-            this.oi_sampleqty.ReadOnly = true;
-            this.oi_sampleqty.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.oi_sampleqty.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.oi_sampleqty.Width = 150;
-            // 
             // OQC_PlanMaintain
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -655,8 +655,8 @@
         private CustomControl.TextBoxWithIcon.SearchTextBox ob_aqlcode;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_status;
         private System.Windows.Forms.Panel panel1;
-        private System.Windows.Forms.Label ad_qty_label;
-        private CustomControl.TextBoxWithIcon.TextBoxNumOnly ad_qty;
+        private System.Windows.Forms.Label ob_sampleqty_label;
+        private CustomControl.TextBoxWithIcon.TextBoxNumOnly ob_sampleqty;
         private CustomControl.ButtonUtil.ChooseAllButton ChooseAll;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_maxngacceptqty;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;

+ 2 - 1
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -322,7 +322,8 @@ namespace UAS_MES.OQC
                         sql.Append("select count(1)from (select ois_sncode from OQCITEMSAMPLES where ");
                         sql.Append("ois_checkno = '" + ob_checkno.Text + "' and ois_ifng = 1 group by ois_sncode)");
                         string ngqty = (dh.ExecuteSql(sql.GetString(), "select") as DataTable).Rows[0][0].ToString();
-                        dh.ExecuteSql("update OQCBATCH set ob_ngqty='" + ngqty + "',ob_okqty=(select max(oi_checkqty)-'" + ngqty + "' from OQCItems where oi_checkno ='" + ob_checkno.Text + "') where ob_checkno ='" + ob_checkno.Text + "'", "update");
+                        string checkqty = dh.getFieldDataByCondition("OQCItems", "max(oi_checkqty)", "oi_checkno ='" + ob_checkno.Text + "'").ToString();
+                        dh.ExecuteSql("update OQCBATCH set ob_ngqty='" + ngqty + "',ob_actsampleqty='" + checkqty + "',ob_okqty=('" + checkqty + "'-'" + ngqty + "') where ob_checkno ='" + ob_checkno.Text + "'", "update");
                         OperateResult.AppendText(">>序列号 " + sncode.Text + "操作成功\n", Color.Green);
                         LogicHandler.DoCommandLog(User.UserCode, "", User.UserLineCode, User.UserSourceCode, "抽样数据采集", "检验项目采集成功", sncode.Text, ob_checkno.Text);
                         GetBatch.PerformClick();