Эх сурвалжийг харах

抽样数据采集修改,放大镜勾选框修改

章政 8 жил өмнө
parent
commit
1727482789

+ 1 - 0
UAS-MES/CustomControl/CustomCheckBox/LockCheckBox.cs

@@ -29,6 +29,7 @@ namespace UAS_MES.CustomControl.CustomCheckBox
 
         public void LockCheckBox_CheckedChanged(object sender, EventArgs e)
         {
+            Console.WriteLine(Checked);
             if (Checked)
             {
                 if (MaCtl.Text != "")

+ 1 - 12
UAS-MES/CustomControl/TextBoxWithIcon/MaCodeSearchTextBox.cs

@@ -209,10 +209,6 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             }
         }
         #endregion
-        //DBFind赋值后触发的委托
-        public delegate void AfterDBFind(object sender, EventArgs e);
-        //事件
-        public event AfterDBFind AfterDbFind;
 
         #region 自定义事件
         public delegate void OnTextChange(object sender, EventArgs e);
@@ -248,11 +244,6 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             }
         }
 
-        public void AfterDBFindSetValue(object sender, EventArgs e)
-        {
-            AfterDbFind?.Invoke(sender, new EventArgs());
-        }
-
         public void SetLockCheckBox(CheckBox ctl)
         {
             LockCheckBox = ctl;
@@ -299,7 +290,6 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
                     LeaveFindData = false;
                 //不允许工单号为空的情况
                 LockCheckBox.Checked = true;
-                AfterDBFindSetValue(new object(), new EventArgs());
             }
         }
 
@@ -337,8 +327,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         public void TextBox_Leave(object sender, EventArgs e)
         {
             TextBox.BackColor = System.Drawing.Color.White;
-            if (Enabled)
-                GetData();
+            GetData();
         }
 
         private void SearchTextBox_Load(object sender, EventArgs e)

+ 0 - 2
UAS-MES/DataOperate/DataHelper.cs

@@ -310,7 +310,6 @@ namespace UAS_MES.DataOperate
                 {
                     //获取参数的个数
                     int paramsNum = sql[0].Split(':').Length - 1;
-
                     //解析参数的数据
                     string[] param = GetParamFromSQL(sql[0]);
                     //新建一个二维数组去
@@ -749,7 +748,6 @@ namespace UAS_MES.DataOperate
                 {
                     //获取参数的个数
                     int paramsNum = sql[0].Split(':').Length - 1;
-
                     //解析参数的数据
                     string[] param = GetParamFromSQL(sql[0]);
                     //新建一个二维数组去

+ 0 - 9
UAS-MES/DbFind.cs

@@ -209,8 +209,6 @@ namespace UAS_MES
                 {
                     MaCodeSearchTextBox ctl = (MainControl as MaCodeSearchTextBox);
                     ctl.GetData();
-                    ctl.AfterDbFind += DbFind_AfterDbFind;
-                    ctl.AfterDBFindSetValue(new object(), new EventArgs());
                 }
                 if (MainControl is SearchTextBox)
                 {
@@ -237,13 +235,6 @@ namespace UAS_MES
             }
         }
 
-        private void DbFind_AfterDbFind(object sender, EventArgs e)
-        {
-            string MainControlText = MainControl.Text;
-            MainControl.Text = "";
-            MainControl.Text = MainControlText;
-        }
-
         //列宽发生变化的时候TextBox的宽度也发生变化
         private void DbFindGridView_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
         {

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

@@ -130,7 +130,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(21, 88);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(21, 84);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(58, 21);
             this.ob_batchqty_label.TabIndex = 159;
@@ -140,7 +140,7 @@
             // 
             this.ob_source_label.AutoSize = true;
             this.ob_source_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_source_label.Location = new System.Drawing.Point(268, 90);
+            this.ob_source_label.Location = new System.Drawing.Point(268, 86);
             this.ob_source_label.Name = "ob_source_label";
             this.ob_source_label.Size = new System.Drawing.Size(58, 21);
             this.ob_source_label.TabIndex = 161;
@@ -150,7 +150,7 @@
             // 
             this.pr_kind_label.AutoSize = true;
             this.pr_kind_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_kind_label.Location = new System.Drawing.Point(526, 91);
+            this.pr_kind_label.Location = new System.Drawing.Point(526, 87);
             this.pr_kind_label.Name = "pr_kind_label";
             this.pr_kind_label.Size = new System.Drawing.Size(74, 21);
             this.pr_kind_label.TabIndex = 165;
@@ -180,7 +180,7 @@
             // 
             this.ob_status_label.AutoSize = true;
             this.ob_status_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_status_label.Location = new System.Drawing.Point(789, 91);
+            this.ob_status_label.Location = new System.Drawing.Point(789, 87);
             this.ob_status_label.Name = "ob_status_label";
             this.ob_status_label.Size = new System.Drawing.Size(42, 21);
             this.ob_status_label.TabIndex = 178;
@@ -210,7 +210,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(268, 129);
+            this.label1.Location = new System.Drawing.Point(268, 126);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(74, 21);
             this.label1.TabIndex = 186;
@@ -220,7 +220,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(21, 129);
+            this.pr_detail_label.Location = new System.Drawing.Point(21, 126);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
@@ -260,7 +260,7 @@
             this.pr_detail.BackColor = System.Drawing.Color.White;
             this.pr_detail.Enabled = false;
             this.pr_detail.ID = null;
-            this.pr_detail.Location = new System.Drawing.Point(101, 129);
+            this.pr_detail.Location = new System.Drawing.Point(101, 126);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(2);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Power = null;
@@ -279,7 +279,7 @@
             this.ob_projectcode.Condition = null;
             this.ob_projectcode.DBTitle = null;
             this.ob_projectcode.FormName = null;
-            this.ob_projectcode.Location = new System.Drawing.Point(347, 129);
+            this.ob_projectcode.Location = new System.Drawing.Point(347, 126);
             this.ob_projectcode.Margin = new System.Windows.Forms.Padding(2);
             this.ob_projectcode.Name = "ob_projectcode";
             this.ob_projectcode.Power = null;
@@ -297,7 +297,7 @@
             this.ob_status.BackColor = System.Drawing.Color.White;
             this.ob_status.Enabled = false;
             this.ob_status.ID = null;
-            this.ob_status.Location = new System.Drawing.Point(872, 91);
+            this.ob_status.Location = new System.Drawing.Point(872, 87);
             this.ob_status.Name = "ob_status";
             this.ob_status.Power = null;
             this.ob_status.Size = new System.Drawing.Size(136, 21);
@@ -359,7 +359,7 @@
             this.GetBatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.GetBatch.Image = ((System.Drawing.Image)(resources.GetObject("GetBatch.Image")));
             this.GetBatch.IsShowBorder = true;
-            this.GetBatch.Location = new System.Drawing.Point(460, 164);
+            this.GetBatch.Location = new System.Drawing.Point(460, 160);
             this.GetBatch.MoveImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.MoveImage")));
             this.GetBatch.Name = "GetBatch";
             this.GetBatch.NormalImage = ((System.Drawing.Image)(resources.GetObject("GetBatch.NormalImage")));
@@ -496,7 +496,7 @@
             this.pr_kind.BackColor = System.Drawing.Color.White;
             this.pr_kind.Enabled = false;
             this.pr_kind.ID = null;
-            this.pr_kind.Location = new System.Drawing.Point(608, 91);
+            this.pr_kind.Location = new System.Drawing.Point(608, 87);
             this.pr_kind.Name = "pr_kind";
             this.pr_kind.Power = null;
             this.pr_kind.ReadOnly = true;
@@ -529,7 +529,7 @@
             this.ob_source.BackColor = System.Drawing.Color.White;
             this.ob_source.Enabled = false;
             this.ob_source.ID = null;
-            this.ob_source.Location = new System.Drawing.Point(347, 90);
+            this.ob_source.Location = new System.Drawing.Point(347, 86);
             this.ob_source.Name = "ob_source";
             this.ob_source.Power = null;
             this.ob_source.Size = new System.Drawing.Size(136, 21);
@@ -545,7 +545,7 @@
             this.ob_batchqty.BackColor = System.Drawing.Color.White;
             this.ob_batchqty.Enabled = false;
             this.ob_batchqty.ID = null;
-            this.ob_batchqty.Location = new System.Drawing.Point(101, 90);
+            this.ob_batchqty.Location = new System.Drawing.Point(101, 86);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Power = null;
             this.ob_batchqty.ReadOnly = true;

+ 146 - 149
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -29,7 +29,7 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OQC_SamplingDataCollection));
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             this.ob_checkno_label = new System.Windows.Forms.Label();
             this.obd_outboxcode_label = new System.Windows.Forms.Label();
             this.ms_sncode_label = new System.Windows.Forms.Label();
@@ -39,33 +39,31 @@
             this.label5 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.label9 = new System.Windows.Forms.Label();
-            this.ChooseAll = new System.Windows.Forms.CheckBox();
             this.label10 = new System.Windows.Forms.Label();
             this.ob_remark_label = new System.Windows.Forms.Label();
             this.obd_makecode_label = new System.Windows.Forms.Label();
             this.ob_prodcode_label = new System.Windows.Forms.Label();
             this.ob_status = new System.Windows.Forms.Label();
-            this.勾选 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.ob_batchqty_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.obd_outboxcode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.ob_makecode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.obd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ob_aqlcode_label = new System.Windows.Forms.Label();
+            this.ob_maxngacceptqty_label = new System.Windows.Forms.Label();
+            this.ob_maxngacceptqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ob_aqlcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_projectcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.ob_prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ob_makecode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ChoosedDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
-            this.bc_code1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bc_name1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_code1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_name1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.WaitChooseDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
             this.Column3 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.bc_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bc_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bg_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ob_remark = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.CheckTypeDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewExpand();
-            this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.oi_itemcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.oi_ng = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.oi_leveldefect = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -87,10 +85,12 @@
             this.ob_checkno = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.obd_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ob_aqlcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ob_aqlcode_label = new System.Windows.Forms.Label();
-            this.ob_maxngacceptqty = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ob_maxngacceptqty_label = new System.Windows.Forms.Label();
+            this.勾选 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.ob_batchqty_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.obd_outboxcode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ob_makecode_dgv = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.obd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.ChooseAll = new System.Windows.Forms.CheckBox();
             ((System.ComponentModel.ISupportInitialize)(this.ChoosedDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.WaitChooseDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.CheckTypeDGV)).BeginInit();
@@ -202,17 +202,6 @@
             this.label9.TabIndex = 192;
             this.label9.Text = "待选不良";
             // 
-            // ChooseAll
-            // 
-            this.ChooseAll.AutoSize = true;
-            this.ChooseAll.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseAll.Location = new System.Drawing.Point(16, 502);
-            this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(61, 25);
-            this.ChooseAll.TabIndex = 199;
-            this.ChooseAll.Text = "全选";
-            this.ChooseAll.UseVisualStyleBackColor = true;
-            // 
             // label10
             // 
             this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
@@ -268,40 +257,61 @@
             this.ob_status.TabIndex = 212;
             this.ob_status.Visible = false;
             // 
-            // 勾选
-            // 
-            this.勾选.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.勾选.HeaderText = "勾选";
-            this.勾选.Name = "勾选";
-            this.勾选.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.勾选.Width = 42;
-            // 
-            // ob_batchqty_dgv
+            // ob_aqlcode_label
             // 
-            this.ob_batchqty_dgv.DataPropertyName = "ob_batchqty";
-            this.ob_batchqty_dgv.HeaderText = "检验类型";
-            this.ob_batchqty_dgv.Name = "ob_batchqty_dgv";
-            this.ob_batchqty_dgv.Width = 110;
+            this.ob_aqlcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.ob_aqlcode_label.AutoSize = true;
+            this.ob_aqlcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_aqlcode_label.Location = new System.Drawing.Point(807, 7);
+            this.ob_aqlcode_label.Name = "ob_aqlcode_label";
+            this.ob_aqlcode_label.Size = new System.Drawing.Size(42, 21);
+            this.ob_aqlcode_label.TabIndex = 214;
+            this.ob_aqlcode_label.Text = "AQL";
             // 
-            // obd_outboxcode_dgv
+            // ob_maxngacceptqty_label
             // 
-            this.obd_outboxcode_dgv.DataPropertyName = "obd_outboxcode";
-            this.obd_outboxcode_dgv.HeaderText = "已检数";
-            this.obd_outboxcode_dgv.Name = "obd_outboxcode_dgv";
+            this.ob_maxngacceptqty_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.ob_maxngacceptqty_label.AutoSize = true;
+            this.ob_maxngacceptqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_maxngacceptqty_label.Location = new System.Drawing.Point(641, 7);
+            this.ob_maxngacceptqty_label.Name = "ob_maxngacceptqty_label";
+            this.ob_maxngacceptqty_label.Size = new System.Drawing.Size(138, 21);
+            this.ob_maxngacceptqty_label.TabIndex = 216;
+            this.ob_maxngacceptqty_label.Text = "最大不合格通过数";
             // 
-            // ob_makecode_dgv
+            // ob_maxngacceptqty
             // 
-            this.ob_makecode_dgv.DataPropertyName = "ob_makecode";
-            this.ob_makecode_dgv.HeaderText = "应检数";
-            this.ob_makecode_dgv.Name = "ob_makecode_dgv";
-            this.ob_makecode_dgv.Width = 190;
+            this.ob_maxngacceptqty.AllPower = null;
+            this.ob_maxngacceptqty.BackColor = System.Drawing.Color.White;
+            this.ob_maxngacceptqty.Enabled = false;
+            this.ob_maxngacceptqty.ID = null;
+            this.ob_maxngacceptqty.Location = new System.Drawing.Point(645, 41);
+            this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
+            this.ob_maxngacceptqty.Power = null;
+            this.ob_maxngacceptqty.Size = new System.Drawing.Size(146, 21);
+            this.ob_maxngacceptqty.Str = null;
+            this.ob_maxngacceptqty.Str1 = null;
+            this.ob_maxngacceptqty.Str2 = null;
+            this.ob_maxngacceptqty.TabIndex = 217;
+            this.ob_maxngacceptqty.Tag = "ob_maxngacceptqty";
             // 
-            // obd_id
+            // ob_aqlcode
             // 
-            this.obd_id.DataPropertyName = "obd_id";
-            this.obd_id.HeaderText = "ob_id";
-            this.obd_id.Name = "obd_id";
-            this.obd_id.Visible = false;
+            this.ob_aqlcode.AllPower = null;
+            this.ob_aqlcode.BackColor = System.Drawing.Color.White;
+            this.ob_aqlcode.Enabled = false;
+            this.ob_aqlcode.ID = null;
+            this.ob_aqlcode.Location = new System.Drawing.Point(908, 7);
+            this.ob_aqlcode.Name = "ob_aqlcode";
+            this.ob_aqlcode.Power = null;
+            this.ob_aqlcode.Size = new System.Drawing.Size(146, 21);
+            this.ob_aqlcode.Str = null;
+            this.ob_aqlcode.Str1 = null;
+            this.ob_aqlcode.Str2 = null;
+            this.ob_aqlcode.TabIndex = 215;
+            this.ob_aqlcode.Tag = "ob_aqlcode";
             // 
             // ob_projectcode
             // 
@@ -386,8 +396,8 @@
             this.ChoosedDGV.AllowUserToAddRows = false;
             this.ChoosedDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.ChoosedDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.bc_code1,
-            this.bc_name1});
+            this.bg_code1,
+            this.bg_name1});
             this.ChoosedDGV.Location = new System.Drawing.Point(810, 204);
             this.ChoosedDGV.Name = "ChoosedDGV";
             this.ChoosedDGV.RowHeadersWidth = 20;
@@ -395,21 +405,19 @@
             this.ChoosedDGV.Size = new System.Drawing.Size(244, 257);
             this.ChoosedDGV.TabIndex = 205;
             // 
-            // bc_code1
+            // bg_code1
             // 
-            this.bc_code1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.bc_code1.DataPropertyName = "bc_code";
-            this.bc_code1.HeaderText = "不良代码";
-            this.bc_code1.Name = "bc_code1";
-            this.bc_code1.Width = 78;
+            this.bg_code1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.bg_code1.DataPropertyName = "bg_code";
+            this.bg_code1.HeaderText = "不良代码";
+            this.bg_code1.Name = "bg_code1";
             // 
-            // bc_name1
+            // bg_name1
             // 
-            this.bc_name1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.bc_name1.DataPropertyName = "bc_name";
-            this.bc_name1.HeaderText = "不良原因";
-            this.bc_name1.Name = "bc_name1";
-            this.bc_name1.Width = 78;
+            this.bg_name1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.bg_name1.DataPropertyName = "bg_name";
+            this.bg_name1.HeaderText = "不良原因";
+            this.bg_name1.Name = "bg_name1";
             // 
             // WaitChooseDGV
             // 
@@ -417,8 +425,8 @@
             this.WaitChooseDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.WaitChooseDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Column3,
-            this.bc_code,
-            this.bc_name});
+            this.bg_code,
+            this.bg_name});
             this.WaitChooseDGV.Location = new System.Drawing.Point(472, 204);
             this.WaitChooseDGV.Name = "WaitChooseDGV";
             this.WaitChooseDGV.RowHeadersWidth = 20;
@@ -437,21 +445,19 @@
             this.Column3.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column3.Width = 60;
             // 
-            // bc_code
+            // bg_code
             // 
-            this.bc_code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.bc_code.DataPropertyName = "pb_badgroup";
-            this.bc_code.HeaderText = "不良分组";
-            this.bc_code.Name = "bc_code";
-            this.bc_code.Width = 78;
+            this.bg_code.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.bg_code.DataPropertyName = "bg_code";
+            this.bg_code.HeaderText = "不良分组";
+            this.bg_code.Name = "bg_code";
             // 
-            // bc_name
+            // bg_name
             // 
-            this.bc_name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
-            this.bc_name.DataPropertyName = "bg_name";
-            this.bc_name.HeaderText = "分组名称";
-            this.bc_name.Name = "bc_name";
-            this.bc_name.Width = 78;
+            this.bg_name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.bg_name.DataPropertyName = "bg_name";
+            this.bg_name.HeaderText = "分组名称";
+            this.bg_name.Name = "bg_name";
             // 
             // ob_remark
             // 
@@ -489,7 +495,7 @@
             this.CheckTypeDGV.AllowUserToAddRows = false;
             this.CheckTypeDGV.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.CheckTypeDGV.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.dataGridViewCheckBoxColumn1,
+            this.choose,
             this.oi_itemcode,
             this.oi_ng,
             this.oi_leveldefect,
@@ -507,13 +513,14 @@
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             this.CheckTypeDGV.RowHeaderMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.CheckTypeDGV_RowHeaderMouseClick);
             // 
-            // dataGridViewCheckBoxColumn1
+            // choose
             // 
-            this.dataGridViewCheckBoxColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewCheckBoxColumn1.HeaderText = "勾选";
-            this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
-            this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.False;
-            this.dataGridViewCheckBoxColumn1.Width = 60;
+            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_itemcode
             // 
@@ -527,8 +534,8 @@
             // 
             this.oi_ng.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
             this.oi_ng.DataPropertyName = "oi_count";
-            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
-            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle2;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+            this.oi_ng.DefaultCellStyle = dataGridViewCellStyle1;
             this.oi_ng.HeaderText = "样本数量";
             this.oi_ng.Name = "oi_ng";
             this.oi_ng.Width = 78;
@@ -805,61 +812,51 @@
             this.ms_sncode.Tag = "NoAuto";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_sncode_KeyDown);
             // 
-            // ob_aqlcode
+            // 勾选
             // 
-            this.ob_aqlcode.AllPower = null;
-            this.ob_aqlcode.BackColor = System.Drawing.Color.White;
-            this.ob_aqlcode.Enabled = false;
-            this.ob_aqlcode.ID = null;
-            this.ob_aqlcode.Location = new System.Drawing.Point(908, 7);
-            this.ob_aqlcode.Name = "ob_aqlcode";
-            this.ob_aqlcode.Power = null;
-            this.ob_aqlcode.Size = new System.Drawing.Size(146, 21);
-            this.ob_aqlcode.Str = null;
-            this.ob_aqlcode.Str1 = null;
-            this.ob_aqlcode.Str2 = null;
-            this.ob_aqlcode.TabIndex = 215;
-            this.ob_aqlcode.Tag = "ob_aqlcode";
+            this.勾选.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.勾选.HeaderText = "勾选";
+            this.勾选.Name = "勾选";
+            this.勾选.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.勾选.Width = 42;
             // 
-            // ob_aqlcode_label
+            // ob_batchqty_dgv
             // 
-            this.ob_aqlcode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.ob_aqlcode_label.AutoSize = true;
-            this.ob_aqlcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_aqlcode_label.Location = new System.Drawing.Point(807, 7);
-            this.ob_aqlcode_label.Name = "ob_aqlcode_label";
-            this.ob_aqlcode_label.Size = new System.Drawing.Size(42, 21);
-            this.ob_aqlcode_label.TabIndex = 214;
-            this.ob_aqlcode_label.Text = "AQL";
+            this.ob_batchqty_dgv.DataPropertyName = "ob_batchqty";
+            this.ob_batchqty_dgv.HeaderText = "检验类型";
+            this.ob_batchqty_dgv.Name = "ob_batchqty_dgv";
+            this.ob_batchqty_dgv.Width = 110;
             // 
-            // ob_maxngacceptqty
+            // obd_outboxcode_dgv
             // 
-            this.ob_maxngacceptqty.AllPower = null;
-            this.ob_maxngacceptqty.BackColor = System.Drawing.Color.White;
-            this.ob_maxngacceptqty.Enabled = false;
-            this.ob_maxngacceptqty.ID = null;
-            this.ob_maxngacceptqty.Location = new System.Drawing.Point(645, 42);
-            this.ob_maxngacceptqty.Name = "ob_maxngacceptqty";
-            this.ob_maxngacceptqty.Power = null;
-            this.ob_maxngacceptqty.Size = new System.Drawing.Size(146, 21);
-            this.ob_maxngacceptqty.Str = null;
-            this.ob_maxngacceptqty.Str1 = null;
-            this.ob_maxngacceptqty.Str2 = null;
-            this.ob_maxngacceptqty.TabIndex = 217;
-            this.ob_maxngacceptqty.Tag = "ob_maxngacceptqty";
+            this.obd_outboxcode_dgv.DataPropertyName = "obd_outboxcode";
+            this.obd_outboxcode_dgv.HeaderText = "已检数";
+            this.obd_outboxcode_dgv.Name = "obd_outboxcode_dgv";
             // 
-            // ob_maxngacceptqty_label
+            // ob_makecode_dgv
             // 
-            this.ob_maxngacceptqty_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.ob_maxngacceptqty_label.AutoSize = true;
-            this.ob_maxngacceptqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_maxngacceptqty_label.Location = new System.Drawing.Point(641, 9);
-            this.ob_maxngacceptqty_label.Name = "ob_maxngacceptqty_label";
-            this.ob_maxngacceptqty_label.Size = new System.Drawing.Size(138, 21);
-            this.ob_maxngacceptqty_label.TabIndex = 216;
-            this.ob_maxngacceptqty_label.Text = "最大不合格通过数";
+            this.ob_makecode_dgv.DataPropertyName = "ob_makecode";
+            this.ob_makecode_dgv.HeaderText = "应检数";
+            this.ob_makecode_dgv.Name = "ob_makecode_dgv";
+            this.ob_makecode_dgv.Width = 190;
+            // 
+            // obd_id
+            // 
+            this.obd_id.DataPropertyName = "obd_id";
+            this.obd_id.HeaderText = "ob_id";
+            this.obd_id.Name = "obd_id";
+            this.obd_id.Visible = false;
+            // 
+            // ChooseAll
+            // 
+            this.ChooseAll.AutoSize = true;
+            this.ChooseAll.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChooseAll.Location = new System.Drawing.Point(16, 502);
+            this.ChooseAll.Name = "ChooseAll";
+            this.ChooseAll.Size = new System.Drawing.Size(61, 25);
+            this.ChooseAll.TabIndex = 199;
+            this.ChooseAll.Text = "全选";
+            this.ChooseAll.UseVisualStyleBackColor = true;
             // 
             // OQC_SamplingDataCollection
             // 
@@ -951,7 +948,6 @@
         private CustomControl.ButtonUtil.ArrowLeftButton WaitReject;
         private System.Windows.Forms.Label label9;
         private CustomControl.DataGrid_View.DataGridViewExpand CheckTypeDGV;
-        private System.Windows.Forms.CheckBox ChooseAll;
         private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
         private System.Windows.Forms.Label label10;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_remark;
@@ -971,21 +967,22 @@
         private CustomControl.ButtonUtil.NormalButton Clean;
         private System.Windows.Forms.Label ob_status;
         private CustomControl.TextBoxWithIcon.EnterTextBox ob_projectcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn bc_code1;
-        private System.Windows.Forms.DataGridViewTextBoxColumn bc_name1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_aqlcode;
+        private System.Windows.Forms.Label ob_aqlcode_label;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ob_maxngacceptqty;
+        private System.Windows.Forms.Label ob_maxngacceptqty_label;
+        private System.Windows.Forms.DataGridViewTextBoxColumn bg_code1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn bg_name1;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Column3;
-        private System.Windows.Forms.DataGridViewTextBoxColumn bc_code;
-        private System.Windows.Forms.DataGridViewTextBoxColumn bc_name;
-        private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn bg_code;
+        private System.Windows.Forms.DataGridViewTextBoxColumn bg_name;
+        private System.Windows.Forms.DataGridViewCheckBoxColumn choose;
         private System.Windows.Forms.DataGridViewTextBoxColumn oi_itemcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn oi_ng;
         private System.Windows.Forms.DataGridViewTextBoxColumn oi_leveldefect;
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_remark;
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_status;
         private System.Windows.Forms.DataGridViewTextBoxColumn ois_id;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ob_aqlcode;
-        private System.Windows.Forms.Label ob_aqlcode_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox ob_maxngacceptqty;
-        private System.Windows.Forms.Label ob_maxngacceptqty_label;
+        private System.Windows.Forms.CheckBox ChooseAll;
     }
 }

+ 43 - 31
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -30,6 +30,14 @@ namespace UAS_MES.OQC
         private void 抽样数据采集_Load(object sender, EventArgs e)
         {
             asc.controllInitializeSize(this);
+            foreach (DataGridViewColumn item in CheckTypeDGV.Columns)
+            {
+                item.SortMode = DataGridViewColumnSortMode.NotSortable;
+            }
+            foreach (DataGridViewColumn item in WaitChooseDGV.Columns)
+            {
+                item.SortMode = DataGridViewColumnSortMode.NotSortable;
+            }
             dh = new DataHelper();
         }
 
@@ -76,13 +84,13 @@ namespace UAS_MES.OQC
                                 string oMakeCode = "";
                                 string oMsID = "";
                                 bool ifFirst;
-                                if (LogicHandler.CheckStepSNAndMacode(dt.Rows[0]["ob_makecode"].ToString(),User.UserSourceCode,sncode.Text, User.UserCode,out oMakeCode,out oMsID, out ErrorMessage))
+                                if (LogicHandler.CheckStepSNAndMacode(dt.Rows[0]["ob_makecode"].ToString(), User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                                     GetBatchTypeGridData();
                                 else
                                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             }
                         }
-                        else OperateResult.AppendText(">>序列号不属于当前抽检批次\n", Color.Red);
+                        else OperateResult.AppendText(">>序列号不属于当前抽检批次\n", Color.Red);
                     }
                     else OperateResult.AppendText(">>送检批次必须是待检验或者检验中\n", Color.Red);
                 }
@@ -92,10 +100,10 @@ namespace UAS_MES.OQC
 
         private void GetBatchTypeGridData()
         {
-            dt = (DataTable)dh.ExecuteSql("select 0,oi_checkkind,max(oi_sampleqty) oi_count,max(oi_checkqty) oi_checkedcount from OQCBatch  left join OQCItems on ob_checkno=oi_checkno  where oi_checkno='" + ob_checkno.Text + "' group by oi_checkkind ", "select");
+            dt = (DataTable)dh.ExecuteSql("select oi_checkkind,max(oi_sampleqty) oi_count,nvl(max(oi_checkqty),0) oi_checkedcount from OQCBatch  left join OQCItems on ob_checkno=oi_checkno  where oi_checkno='" + ob_checkno.Text + "' group by oi_checkkind ", "select");
             BaseUtil.FillExpandDgvWithDataTable(CheckTypeDGV, dt, true);
             sql.Clear();
-            sql.Append("select pb_badgroup,bg_name,bg_code from product left join productkind ");
+            sql.Append("select bg_code,bg_name from product left join productkind ");
             sql.Append("on pr_kind=pk_code left join PRODUCTBADGROUP on pk_code= pb_kindcode ");
             sql.Append("left join badgroup on  bg_code=pb_badgroup where pr_code='" + ob_prodcode.Text + "'");
             BadCode = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -142,8 +150,11 @@ namespace UAS_MES.OQC
                             }
                         }
                         //执行批量更新的SQL
-                        dh.BatchInsert("update OQCItemSamples set ois_ifng=:ois_ifng,ois_defectlevel=:ois_defectlevel,ois_remark=:ois_remark where ois_id=:ois_id",
-                            new string[] { "ois_ifng", "ois_defectlevel", "ois_remark", "ois_id" }, ois_ifng_update.ToArray(), ois_defectlevel_update.ToArray(), ois_remark_update.ToArray(), ois_id_update.ToArray());
+                        if (ois_id_update.Count > 0)
+                        {
+                            dh.BatchInsert("update OQCItemSamples set ois_ifng=:ois_ifng,ois_defectlevel=:ois_defectlevel,ois_remark=:ois_remark where ois_id=:ois_id",
+                         new string[] { "ois_ifng", "ois_defectlevel", "ois_remark", "ois_id" }, ois_ifng_update.ToArray(), ois_defectlevel_update.ToArray(), ois_remark_update.ToArray(), ois_id_update.ToArray());
+                        }
                         //如果主键为空,并且存在需要插入的数据则执行插入操作
                         if (oi_itemcode_insert.Count > 0)
                         {
@@ -178,18 +189,11 @@ namespace UAS_MES.OQC
                         dh.ExecuteSql("update OQCBATCH set (ob_ngqty,ob_okqty)=(select nvl(max(oi_ngqty), 0), max(oi_checkqty) - nvl(max(oi_ngqty), 0) from OQCItems where oi_checkno ='" + ob_checkno.Text + "') where ob_checkno ='" + ob_checkno.Text + "'", "update");
                         OperateResult.AppendText(">>操作成功\n", Color.Green);
                     }
-                    else
-                        OperateResult.AppendText(">>请勾选不良明细\n", Color.Red);
+                    else OperateResult.AppendText(">>请勾选不良明细\n", Color.Red);
                 }
-                else
-                {
-                    OperateResult.AppendText(">>请勾选送检明细\n", Color.Red);
-                }
-            }
-            else
-            {
-                OperateResult.AppendText(">>必须是待检验或者检测中的送检批才能进行此操作\n", Color.Red);
+                else OperateResult.AppendText(">>请勾选送检明细\n", Color.Red);
             }
+            else OperateResult.AppendText(">>必须是待检验或者检测中的送检批才能进行此操作\n", Color.Red);
         }
 
         private void Cancel_Click(object sender, EventArgs e)
@@ -273,9 +277,10 @@ namespace UAS_MES.OQC
             if (!dgvr.Contains(CheckTypeDGV.Rows[e.RowIndex]))
             {
                 sql.Clear();
-                sql.Append("select nvl(ois_id,0) ois_ id ,oi_itemcode ,nvl(ois_ifng,1) oi_ng,nvl(ois_defectlevel,'-1') oi_leveldefect,");
-                sql.Append("ois_remark,case ois_id when  0 then '未检验' else '已检验'  end ois_status from OQCItems left join OQCItemSamples on ois_checkno=oi_checkno ");
-                sql.Append("and ois_itemcode=oi_itemcode where ois_projectcode = oi_projectcode and oi_checkno ='" + ob_checkno.Text + "' and ois_sncode ='" + sncode.Text + "'");
+                sql.Append("select ois_sncode,nvl(ois_id,0) ois_id ,oi_itemcode ,nvl(ois_ifng,1) oi_ng,nvl(ois_defectlevel,'-1')");
+                sql.Append("oi_leveldefect,ois_remark,case ois_id when 0 then '未检验' else '已检验' end ois_status from OQCItems ");
+                sql.Append("left join OQCItemSamples on  ois_sncode='" + sncode.Text + "' and ois_checkno=oi_checkno and ");
+                sql.Append("ois_itemcode=oi_itemcode and ois_projectcode = oi_projectcode where oi_checkno ='" + ob_checkno.Text + "'");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 DataGridViewRow headerRow = new DataGridViewRow();
 
@@ -319,15 +324,14 @@ namespace UAS_MES.OQC
                     dataRow.Cells.Add(textcell);
                     textcell.ReadOnly = true;
 
-                    checkcell = new DataGridViewCheckBoxCell();
-                    checkcell.Value = dt.Rows[i]["oi_ng"].ToString() != "0" ? true : false;
-                    dataRow.Cells.Add(checkcell);
+                    DataGridViewCheckBoxCell checkcel2 = new DataGridViewCheckBoxCell();
+                    checkcel2.Value = dt.Rows[i]["oi_ng"].ToString() != "0" ? true : false;
+                    dataRow.Cells.Add(checkcel2);
                     textcell.ReadOnly = false;
 
                     DataGridViewComboBoxCell combocell = new DataGridViewComboBoxCell();
                     BaseUtil.SetDGVCellComboxData(combocell, "display", "value", LevelDefect);
                     combocell.Value = dt.Rows[i]["oi_leveldefect"].ToString();
-
                     dataRow.Cells.Add(combocell);
                     textcell.ReadOnly = false;
 
@@ -357,7 +361,8 @@ namespace UAS_MES.OQC
         {
             if (!dgvr.Contains(WaitChooseDGV.Rows[e.RowIndex]))
             {
-                DataTable dt = (DataTable)dh.ExecuteSql("select bc_code,bc_name  from BADCODE  where bc_groupcode='2015040001'", "select");
+                string bg_code = WaitChooseDGV.Rows[e.RowIndex].Cells["bg_code"].Value.ToString();
+                DataTable dt = (DataTable)dh.ExecuteSql("select bc_code,bc_name  from BADCODE  where bc_groupcode='" + bg_code + "'", "select");
                 DataGridViewRow headerRow = new DataGridViewRow();
                 DataGridViewTextBoxCell textcell = new DataGridViewTextBoxCell();
                 textcell.Value = "";
@@ -419,15 +424,17 @@ namespace UAS_MES.OQC
         {
             if (e.KeyCode == Keys.Enter)
             {
-                dt = (DataTable)dh.ExecuteSql("select bc_code,bc_name from badcode where bc_code='" + bccode.Text + "'", "select");
-                try
-                {
-                    dt.Merge(ChoosedDGV.DataSource as DataTable);
-                    ChoosedDGV.DataSource = dt;
-                }
-                catch (Exception)
+                dt = (DataTable)dh.ExecuteSql("select bc_code bg_code,bc_name bg_name from badgroup left join badcode on bg_code=bc_groupcode where bc_code='" + bccode.Text + "'", "select");
+                if (dt.Rows.Count > 0)
                 {
+                    try
+                    {
+                        dt.Merge(ChoosedDGV.DataSource as DataTable);
+                        BaseUtil.FillDgvWithDataTable(ChoosedDGV, dt);
+                    }
+                    catch (Exception) { }
                 }
+                else OperateResult.AppendText(">>不良代码不存在\n", Color.Red);
             }
         }
 
@@ -446,5 +453,10 @@ namespace UAS_MES.OQC
                 GetBatch.PerformClick();
             }
         }
+
+        private void ChooseAll_CheckedChanged(object sender, EventArgs e)
+        {
+
+        }
     }
 }

+ 20 - 56
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.resx

@@ -117,21 +117,6 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="勾选.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ob_batchqty_dgv.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="obd_outboxcode_dgv.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ob_makecode_dgv.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="obd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
@@ -264,58 +249,22 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
-  <metadata name="bc_code1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="bg_code1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bc_code1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bc_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="bg_name1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="bc_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bc_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="bg_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="bc_code.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="bg_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="bc_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="dataGridViewCheckBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_itemcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_ng.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="oi_leveldefect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ois_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ois_status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="ois_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="dataGridViewCheckBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="choose.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="oi_itemcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -1029,4 +978,19 @@
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
+  <metadata name="勾选.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ob_batchqty_dgv.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="obd_outboxcode_dgv.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="ob_makecode_dgv.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="obd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
 </root>

+ 5 - 3
UAS-MES/PublicMethod/BaseUtil.cs

@@ -555,10 +555,10 @@ namespace UAS_MES.PublicMethod
                     DataGridViewCheckBoxCell checkcell = new DataGridViewCheckBoxCell();
                     collapseRow.Cells.Add(checkcell);
                     //因为DGV中可能有空置的列多出,所以需要用DataTable的列进行循环
-                    for (int j = 1; j < dt.Columns.Count; j++)
+                    for (int j = 0; j < dt.Columns.Count; j++)
                     {
                         DataGridViewTextBoxCell textcell = new DataGridViewTextBoxCell();
-                        textcell.Value = dt.Rows[i][j - 1].ToString();
+                        textcell.Value = dt.Rows[i][j].ToString();
                         collapseRow.Cells.Add(textcell);
                         textcell.ReadOnly = true;
                     }
@@ -767,13 +767,15 @@ namespace UAS_MES.PublicMethod
             {
                 if (dgv.Rows[i].Cells[0].Value != null)
                 {
-                    if (dgv.Rows[i].Cells[0].Value.ToString() == "True")
+                    if (dgv.Rows[i].Cells[0].FormattedValue.ToString() == "True")
                     {
                         if (dgv.Rows[i].Tag.ToString() == "SonRow")
                         {
                             DataRow dr = dt.NewRow();
+                        
                             for (int j = 1; j < dgv.ColumnCount; j++)
                             {
+                                Console.WriteLine(dgv.Rows[i].Cells[j].FormattedValue);
                                 dr[dgv.Columns[j].Name] = dgv.Rows[i].Cells[j].FormattedValue;
                             }
                             dt.Rows.Add(dr);

+ 1 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -675,7 +675,7 @@ namespace UAS_MES.PublicMethod
                 return GetBatch(iCheckNo, iOQCStep, out oErrorMessage);
             else if (iSnCode != "")
             {
-                SQL = "select  ms_checkno  from makeserial where ms_sncode='" + iSnCode + "' or ms_psn='" + iSnCode + "'";
+                SQL = "select ms_checkno from makeserial where ms_sncode='" + iSnCode + "' or ms_psn='" + iSnCode + "'";
                 dt = (DataTable)dh.ExecuteSql(SQL, "select");
                 if (dt.Rows.Count == 0)
                 {

+ 1 - 1
UAS-MES/UAS-MES.csproj

@@ -41,7 +41,7 @@
     <MinimumRequiredVersion>1.0.0.201</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
-    <ApplicationRevision>222</ApplicationRevision>
+    <ApplicationRevision>224</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>