Browse Source

代码调整

章政 6 years ago
parent
commit
62f1b2b31d

+ 45 - 8
UAS-出货标签管理(标签复核)/PublicMethod/DataHelper.cs

@@ -826,6 +826,7 @@ namespace UAS_LabelMachine
         public object ExecuteSql(string SQL, string Type, params object[] names)
         {
             object result = null;
+            Console.WriteLine(SQL);
             command = new OracleCommand(SQL, connection);
             //用来拼接参数的
             if (names.Length > 0)
@@ -858,23 +859,59 @@ namespace UAS_LabelMachine
             switch (Type.ToUpper())
             {
                 case "SELECT":
-                    result = new DataTable();
                     OracleDataAdapter ad = new OracleDataAdapter(command);
-                    ad.Fill((DataTable)result);
-                    ad.Dispose();
-                    //成功执行后将重复连接数置为0
+                    result = new DataTable();
+                    try
+                    {
+                        ad.Fill((DataTable)result);
+                    }
+                    catch (Exception)
+                    {
+                        connection = new OracleConnection(DBConnectionString);
+                        connection.Open();
+                        command = new OracleCommand(SQL, connection);
+                        ad = new OracleDataAdapter();
+                        ad.SelectCommand = command;
+                        ad.Fill((DataTable)result);
+                    }
                     break;
                 case "DELETE":
-                    result = command.ExecuteNonQuery();
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(DBConnectionString);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
                     break;
                 case "UPDATE":
-                    result = command.ExecuteNonQuery();
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(DBConnectionString);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
                     break;
                 case "INSERT":
-                    command.ExecuteNonQuery();
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(DBConnectionString);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
                     break;
             }
-
             command.Dispose();
             return result;
         }

+ 185 - 194
UAS-出货标签管理(标签复核)/UAS_出货标签管理.Designer.cs

@@ -38,7 +38,6 @@
             this.pr_code_label = new System.Windows.Forms.Label();
             this.label24 = new System.Windows.Forms.Label();
             this.CollectionUnit = new System.Windows.Forms.ComboBox();
-            this.CollectionUnit_label = new System.Windows.Forms.Label();
             this.GenerateBarCode = new System.Windows.Forms.Button();
             this.SaveGrid = new System.Windows.Forms.Button();
             this.sg_separator_label = new System.Windows.Forms.Label();
@@ -58,8 +57,6 @@
             this.Fresh = new System.Windows.Forms.LinkLabel();
             this.label3 = new System.Windows.Forms.Label();
             this.CleanInputAfterCollect = new System.Windows.Forms.CheckBox();
-            this.AllCollected = new System.Windows.Forms.Button();
-            this.RefreshDBConnect = new System.Windows.Forms.Timer(this.components);
             this.GetGridOnly = new System.Windows.Forms.CheckBox();
             this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -110,28 +107,30 @@
             this.sg_separator = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.Input = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.griddetno = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.sg_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
+            this.sg_brand = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.MessageLog = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
             this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.CollectionUnit_label = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.CollectionProcess.SuspendLayout();
@@ -225,20 +224,10 @@
             this.CollectionUnit.Size = new System.Drawing.Size(54, 25);
             this.CollectionUnit.TabIndex = 41;
             // 
-            // CollectionUnit_label
-            // 
-            this.CollectionUnit_label.AutoSize = true;
-            this.CollectionUnit_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CollectionUnit_label.Location = new System.Drawing.Point(228, 182);
-            this.CollectionUnit_label.Name = "CollectionUnit_label";
-            this.CollectionUnit_label.Size = new System.Drawing.Size(65, 20);
-            this.CollectionUnit_label.TabIndex = 56;
-            this.CollectionUnit_label.Text = "采集单位";
-            // 
             // GenerateBarCode
             // 
             this.GenerateBarCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.GenerateBarCode.Location = new System.Drawing.Point(374, 178);
+            this.GenerateBarCode.Location = new System.Drawing.Point(374, 180);
             this.GenerateBarCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.GenerateBarCode.Name = "GenerateBarCode";
             this.GenerateBarCode.Size = new System.Drawing.Size(68, 26);
@@ -429,22 +418,6 @@
             this.CleanInputAfterCollect.Text = "采集后清除输入框";
             this.CleanInputAfterCollect.UseVisualStyleBackColor = true;
             // 
-            // AllCollected
-            // 
-            this.AllCollected.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AllCollected.Location = new System.Drawing.Point(522, 216);
-            this.AllCollected.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.AllCollected.Name = "AllCollected";
-            this.AllCollected.Size = new System.Drawing.Size(68, 26);
-            this.AllCollected.TabIndex = 75;
-            this.AllCollected.Text = "全部已采";
-            this.AllCollected.UseVisualStyleBackColor = true;
-            this.AllCollected.Click += new System.EventHandler(this.AllCollected_Click);
-            // 
-            // RefreshDBConnect
-            // 
-            this.RefreshDBConnect.Tick += new System.EventHandler(this.RefreshDBConnect_Tick);
-            // 
             // GetGridOnly
             // 
             this.GetGridOnly.AutoSize = true;
@@ -698,7 +671,6 @@
             // 
             // ExportData
             // 
-            this.ExportData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.ExportData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ExportData.Location = new System.Drawing.Point(522, 180);
             this.ExportData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
@@ -920,25 +892,25 @@
             this.griddetno.TabIndex = 50;
             this.griddetno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.griddetno_KeyDown);
             // 
-            // sg_code
-            // 
-            this.sg_code.AllPower = null;
-            this.sg_code.Caller = null;
-            this.sg_code.Condition = null;
-            this.sg_code.DBTitle = null;
-            this.sg_code.FormName = null;
-            this.sg_code.Location = new System.Drawing.Point(76, 66);
-            this.sg_code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.sg_code.Name = "sg_code";
-            this.sg_code.Power = null;
-            this.sg_code.ReturnData = null;
-            this.sg_code.SelectField = null;
-            this.sg_code.SetValueField = null;
-            this.sg_code.Size = new System.Drawing.Size(149, 24);
-            this.sg_code.TabIndex = 32;
-            this.sg_code.TableName = null;
-            this.sg_code.TextBoxEnable = false;
-            this.sg_code.UserControlTextChanged += new UAS_LabelMachine.CustomControl.SearchTextBox.OnTextChange(this.sg_code_UserControlTextChanged);
+            // sg_brand
+            // 
+            this.sg_brand.AllPower = null;
+            this.sg_brand.Caller = null;
+            this.sg_brand.Condition = null;
+            this.sg_brand.DBTitle = null;
+            this.sg_brand.FormName = null;
+            this.sg_brand.Location = new System.Drawing.Point(76, 66);
+            this.sg_brand.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.sg_brand.Name = "sg_brand";
+            this.sg_brand.Power = null;
+            this.sg_brand.ReturnData = null;
+            this.sg_brand.SelectField = null;
+            this.sg_brand.SetValueField = null;
+            this.sg_brand.Size = new System.Drawing.Size(149, 24);
+            this.sg_brand.TabIndex = 32;
+            this.sg_brand.TableName = null;
+            this.sg_brand.TextBoxEnable = false;
+            this.sg_brand.UserControlTextChanged += new UAS_LabelMachine.CustomControl.SearchTextBox.OnTextChange(this.sg_code_UserControlTextChanged);
             // 
             // MessageLog
             // 
@@ -948,7 +920,7 @@
             this.MessageLog.Location = new System.Drawing.Point(4, 610);
             this.MessageLog.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MessageLog.Name = "MessageLog";
-            this.MessageLog.Size = new System.Drawing.Size(1249, 97);
+            this.MessageLog.Size = new System.Drawing.Size(1299, 97);
             this.MessageLog.TabIndex = 28;
             this.MessageLog.Text = "";
             // 
@@ -967,11 +939,12 @@
             this.pib_id1,
             this.pib_pdno,
             this.pib_prodcode,
+            this.pr_detail,
+            this.pr_spec,
             this.pr_orispeccode,
             this.pd_custprodcode,
             this.pd_pocode,
             this.pd_custprodspec,
-            this.pr_spec,
             this.pib_brand,
             this.pib_madein,
             this.pr_zxbzs,
@@ -983,84 +956,107 @@
             this.LabelInf.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.LabelInf.Name = "LabelInf";
             this.LabelInf.RowTemplate.Height = 23;
-            this.LabelInf.Size = new System.Drawing.Size(959, 326);
+            this.LabelInf.Size = new System.Drawing.Size(1009, 326);
             this.LabelInf.TabIndex = 27;
             this.LabelInf.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.LabelInf_CellPainting);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
             // 
-            // pi_inoutno
-            // 
-            this.pi_inoutno.ID = null;
-            this.pi_inoutno.Location = new System.Drawing.Point(76, 10);
-            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.pi_inoutno.Name = "pi_inoutno";
-            this.pi_inoutno.Size = new System.Drawing.Size(150, 21);
-            this.pi_inoutno.Str = null;
-            this.pi_inoutno.Str1 = null;
-            this.pi_inoutno.Str2 = null;
-            this.pi_inoutno.TabIndex = 2;
-            this.pi_inoutno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_inoutno_KeyDown);
-            // 
-            // pib_qty
+            // Choose
             // 
-            this.pib_qty.DataPropertyName = "pib_qty";
-            this.pib_qty.HeaderText = "数量";
-            this.pib_qty.Name = "pib_qty";
-            this.pib_qty.ReadOnly = true;
-            this.pib_qty.Width = 54;
+            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.True;
+            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.Choose.Width = 55;
             // 
-            // pib_datecode
+            // pib_ifpick
             // 
-            this.pib_datecode.DataPropertyName = "pib_datecode";
-            this.pib_datecode.HeaderText = "DC";
-            this.pib_datecode.Name = "pib_datecode";
-            this.pib_datecode.Width = 42;
+            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifpick.DataPropertyName = "pib_ifpick";
+            this.pib_ifpick.HeaderText = "已采集";
+            this.pib_ifpick.Name = "pib_ifpick";
+            this.pib_ifpick.Width = 60;
             // 
-            // pib_lotno
+            // pib_ifprint
             // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.Width = 60;
+            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifprint.DataPropertyName = "pib_ifprint";
+            this.pib_ifprint.HeaderText = "已打印";
+            this.pib_ifprint.Name = "pib_ifprint";
+            this.pib_ifprint.Visible = false;
+            this.pib_ifprint.Width = 60;
             // 
-            // pr_unit
+            // pib_id1
             // 
-            this.pr_unit.DataPropertyName = "pr_unit";
-            this.pr_unit.HeaderText = "单位";
-            this.pr_unit.Name = "pr_unit";
-            this.pr_unit.Visible = false;
-            this.pr_unit.Width = 54;
+            this.pib_id1.DataPropertyName = "pib_id";
+            this.pib_id1.HeaderText = "pib_id";
+            this.pib_id1.Name = "pib_id1";
+            this.pib_id1.Visible = false;
+            this.pib_id1.Width = 66;
             // 
-            // pr_zxbzs
+            // pib_pdno
             // 
-            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
-            this.pr_zxbzs.HeaderText = "最小包装数";
-            this.pr_zxbzs.Name = "pr_zxbzs";
-            this.pr_zxbzs.Visible = false;
-            this.pr_zxbzs.Width = 90;
+            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_pdno.DataPropertyName = "pib_pdno";
+            this.pib_pdno.HeaderText = "明细序号";
+            this.pib_pdno.Name = "pib_pdno";
+            this.pib_pdno.ReadOnly = true;
+            this.pib_pdno.Width = 96;
             // 
-            // pib_madein
+            // pib_prodcode
             // 
-            this.pib_madein.DataPropertyName = "pib_madein";
-            this.pib_madein.HeaderText = "产地";
-            this.pib_madein.Name = "pib_madein";
-            this.pib_madein.Width = 54;
+            this.pib_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
+            this.pib_prodcode.DataPropertyName = "pib_prodcode";
+            this.pib_prodcode.HeaderText = "物料编号";
+            this.pib_prodcode.MinimumWidth = 150;
+            this.pib_prodcode.Name = "pib_prodcode";
+            this.pib_prodcode.ReadOnly = true;
+            this.pib_prodcode.Width = 150;
             // 
-            // pib_brand
+            // pr_detail
             // 
-            this.pib_brand.DataPropertyName = "pib_brand";
-            this.pib_brand.HeaderText = "品牌";
-            this.pib_brand.Name = "pib_brand";
-            this.pib_brand.ReadOnly = true;
-            this.pib_brand.Width = 54;
+            this.pr_detail.DataPropertyName = "pr_detail";
+            this.pr_detail.HeaderText = "物料名称";
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Width = 78;
             // 
             // pr_spec
             // 
             this.pr_spec.DataPropertyName = "pr_spec";
             this.pr_spec.HeaderText = "规格";
+            this.pr_spec.MinimumWidth = 150;
             this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Visible = false;
-            this.pr_spec.Width = 54;
+            this.pr_spec.Width = 150;
+            // 
+            // pr_orispeccode
+            // 
+            this.pr_orispeccode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
+            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode.HeaderText = "MPN";
+            this.pr_orispeccode.MinimumWidth = 150;
+            this.pr_orispeccode.Name = "pr_orispeccode";
+            this.pr_orispeccode.ReadOnly = true;
+            this.pr_orispeccode.Width = 150;
+            // 
+            // pd_custprodcode
+            // 
+            this.pd_custprodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
+            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
+            this.pd_custprodcode.HeaderText = "客户料号";
+            this.pd_custprodcode.MinimumWidth = 100;
+            this.pd_custprodcode.Name = "pd_custprodcode";
+            this.pd_custprodcode.ReadOnly = true;
+            // 
+            // pd_pocode
+            // 
+            this.pd_pocode.DataPropertyName = "pd_pocode";
+            this.pd_pocode.HeaderText = "客户PO";
+            this.pd_pocode.MinimumWidth = 150;
+            this.pd_pocode.Name = "pd_pocode";
+            this.pd_pocode.ReadOnly = true;
+            this.pd_pocode.Width = 150;
             // 
             // pd_custprodspec
             // 
@@ -1070,98 +1066,94 @@
             this.pd_custprodspec.ReadOnly = true;
             this.pd_custprodspec.Width = 78;
             // 
-            // pd_pocode
+            // pib_brand
             // 
-            this.pd_pocode.DataPropertyName = "pd_pocode";
-            this.pd_pocode.HeaderText = "客户PO";
-            this.pd_pocode.Name = "pd_pocode";
-            this.pd_pocode.ReadOnly = true;
-            this.pd_pocode.Width = 66;
+            this.pib_brand.DataPropertyName = "pib_brand";
+            this.pib_brand.HeaderText = "品牌";
+            this.pib_brand.Name = "pib_brand";
+            this.pib_brand.ReadOnly = true;
+            this.pib_brand.Width = 54;
             // 
-            // pd_custprodcode
+            // pib_madein
             // 
-            this.pd_custprodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
-            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
-            this.pd_custprodcode.HeaderText = "客户料号";
-            this.pd_custprodcode.MinimumWidth = 100;
-            this.pd_custprodcode.Name = "pd_custprodcode";
-            this.pd_custprodcode.ReadOnly = true;
+            this.pib_madein.DataPropertyName = "pib_madein";
+            this.pib_madein.HeaderText = "产地";
+            this.pib_madein.Name = "pib_madein";
+            this.pib_madein.Width = 54;
             // 
-            // pr_orispeccode
+            // pr_zxbzs
             // 
-            this.pr_orispeccode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
-            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
-            this.pr_orispeccode.HeaderText = "MPN";
-            this.pr_orispeccode.MinimumWidth = 100;
-            this.pr_orispeccode.Name = "pr_orispeccode";
-            this.pr_orispeccode.ReadOnly = true;
+            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
+            this.pr_zxbzs.HeaderText = "最小包装数";
+            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Visible = false;
+            this.pr_zxbzs.Width = 90;
             // 
-            // pib_prodcode
+            // pr_unit
             // 
-            this.pib_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
-            this.pib_prodcode.DataPropertyName = "pib_prodcode";
-            this.pib_prodcode.HeaderText = "物料编号";
-            this.pib_prodcode.MinimumWidth = 100;
-            this.pib_prodcode.Name = "pib_prodcode";
-            this.pib_prodcode.ReadOnly = true;
+            this.pr_unit.DataPropertyName = "pr_unit";
+            this.pr_unit.HeaderText = "单位";
+            this.pr_unit.Name = "pr_unit";
+            this.pr_unit.Visible = false;
+            this.pr_unit.Width = 54;
             // 
-            // pib_pdno
+            // pib_lotno
             // 
-            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_pdno.DataPropertyName = "pib_pdno";
-            this.pib_pdno.HeaderText = "明细序号";
-            this.pib_pdno.Name = "pib_pdno";
-            this.pib_pdno.ReadOnly = true;
-            this.pib_pdno.Width = 96;
+            this.pib_lotno.DataPropertyName = "pib_lotno";
+            this.pib_lotno.HeaderText = "LotNo";
+            this.pib_lotno.Name = "pib_lotno";
+            this.pib_lotno.Width = 60;
             // 
-            // pib_id1
+            // pib_datecode
             // 
-            this.pib_id1.DataPropertyName = "pib_id";
-            this.pib_id1.HeaderText = "pib_id";
-            this.pib_id1.Name = "pib_id1";
-            this.pib_id1.Visible = false;
-            this.pib_id1.Width = 66;
+            this.pib_datecode.DataPropertyName = "pib_datecode";
+            this.pib_datecode.HeaderText = "DC";
+            this.pib_datecode.Name = "pib_datecode";
+            this.pib_datecode.Width = 42;
             // 
-            // pib_ifprint
+            // pib_qty
             // 
-            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifprint.DataPropertyName = "pib_ifprint";
-            this.pib_ifprint.HeaderText = "已打印";
-            this.pib_ifprint.Name = "pib_ifprint";
-            this.pib_ifprint.Visible = false;
-            this.pib_ifprint.Width = 60;
+            this.pib_qty.DataPropertyName = "pib_qty";
+            this.pib_qty.HeaderText = "数量";
+            this.pib_qty.MinimumWidth = 100;
+            this.pib_qty.Name = "pib_qty";
+            this.pib_qty.ReadOnly = true;
             // 
-            // pib_ifpick
+            // pi_inoutno
             // 
-            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifpick.DataPropertyName = "pib_ifpick";
-            this.pib_ifpick.HeaderText = "已采集";
-            this.pib_ifpick.Name = "pib_ifpick";
-            this.pib_ifpick.Width = 60;
+            this.pi_inoutno.ID = null;
+            this.pi_inoutno.Location = new System.Drawing.Point(76, 10);
+            this.pi_inoutno.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.pi_inoutno.Name = "pi_inoutno";
+            this.pi_inoutno.Size = new System.Drawing.Size(150, 21);
+            this.pi_inoutno.Str = null;
+            this.pi_inoutno.Str1 = null;
+            this.pi_inoutno.Str2 = null;
+            this.pi_inoutno.TabIndex = 2;
+            this.pi_inoutno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_inoutno_KeyDown);
             // 
-            // Choose
+            // CollectionUnit_label
             // 
-            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.True;
-            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.Choose.Width = 55;
+            this.CollectionUnit_label.AutoSize = true;
+            this.CollectionUnit_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.CollectionUnit_label.Location = new System.Drawing.Point(228, 182);
+            this.CollectionUnit_label.Name = "CollectionUnit_label";
+            this.CollectionUnit_label.Size = new System.Drawing.Size(65, 20);
+            this.CollectionUnit_label.TabIndex = 56;
+            this.CollectionUnit_label.Text = "采集单位";
             // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(233)))), ((int)(((byte)(206)))));
-            this.ClientSize = new System.Drawing.Size(962, 709);
+            this.ClientSize = new System.Drawing.Size(1012, 709);
             this.Controls.Add(this.ExportData);
             this.Controls.Add(this.cu_code);
             this.Controls.Add(this.CleanBarCode);
             this.Controls.Add(this.pi_date);
             this.Controls.Add(this.ChooseAll);
             this.Controls.Add(this.GetGridOnly);
-            this.Controls.Add(this.AllCollected);
             this.Controls.Add(this.CleanInputAfterCollect);
             this.Controls.Add(this.Fresh);
             this.Controls.Add(this.pi_cardcode_label);
@@ -1184,7 +1176,7 @@
             this.Controls.Add(this.AutoMatch);
             this.Controls.Add(this.label22);
             this.Controls.Add(this.label2);
-            this.Controls.Add(this.sg_code);
+            this.Controls.Add(this.sg_brand);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.MessageLog);
@@ -1242,7 +1234,6 @@
         private CustomControl.EnterTextBox Input;
         private System.Windows.Forms.Label label24;
         private System.Windows.Forms.ComboBox CollectionUnit;
-        private System.Windows.Forms.Label CollectionUnit_label;
         private System.Windows.Forms.Button GenerateBarCode;
         private System.Windows.Forms.Button SaveGrid;
         private System.Windows.Forms.Label sg_separator_label;
@@ -1259,7 +1250,7 @@
         private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder CollectionProcess;
         private System.Windows.Forms.DataGridView Si_ItemDGV;
         private System.Windows.Forms.Button CleanDetail;
-        private CustomControl.SearchTextBox sg_code;
+        private CustomControl.SearchTextBox sg_brand;
         private CustomControl.SearchTextBox pr_code;
         private System.Windows.Forms.Label pib_id;
         private System.Windows.Forms.Label Process_midboxcode;
@@ -1269,8 +1260,6 @@
         private System.Windows.Forms.LinkLabel Fresh;
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.CheckBox CleanInputAfterCollect;
-        private System.Windows.Forms.Button AllCollected;
-        private System.Windows.Forms.Timer RefreshDBConnect;
         private System.Windows.Forms.CheckBox GetGridOnly;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn17;
@@ -1301,11 +1290,12 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_id1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_pdno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_custprodspec;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_madein;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
@@ -1313,5 +1303,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
+        private System.Windows.Forms.Label CollectionUnit_label;
     }
 }

+ 87 - 74
UAS-出货标签管理(标签复核)/UAS_出货标签管理.cs

@@ -54,10 +54,6 @@ namespace UAS_LabelMachine
 
         Dictionary<string, string> CollectData;
         /// <summary>
-        /// 全部采集
-        /// </summary>
-        bool AllCollect = false;
-        /// <summary>
         /// 是否全选
         /// </summary>
         bool AllChecked = false;
@@ -103,11 +99,11 @@ namespace UAS_LabelMachine
             CloumnCount = LabelInf.Columns.Count;
             pi_inoutno.Focus();
             //将本地读取的打印机设置进Combox,并选中默认打印机
-            sg_code.FormName = Name;
-            sg_code.SetValueField = new string[] { "sg_code" };
-            sg_code.SelectField = "sg_code # 策略编号 ,sg_name # 策略名称,sg_brand # 品牌,sg_separator # 分隔符";
-            sg_code.TableName = "scangroup";
-            sg_code.DbChange += Sg_code_DbChange;
+            sg_brand.FormName = Name;
+            sg_brand.SetValueField = new string[] { "sg_brand" };
+            sg_brand.SelectField = "sg_code # 策略编号 ,sg_name # 策略名称,sg_brand # 品牌,sg_separator # 分隔符";
+            sg_brand.TableName = "scangroup";
+            sg_brand.DbChange += Sg_code_DbChange;
 
             pr_code.FormName = Name;
             pr_code.SetValueField = new string[] { "pr_code" };
@@ -136,13 +132,11 @@ namespace UAS_LabelMachine
             Height = ScreenArea.Height;
             asc.controllInitializeSize(this);
             asc.controlAutoSize(this);
-            RefreshDBConnect.Interval = 60000;
-            RefreshDBConnect.Start();
         }
 
         private void Sg_code_DbChange(object sender, EventArgs e)
         {
-            DataTable dt = sg_code.ReturnData;
+            DataTable dt = sg_brand.ReturnData;
             BaseUtil.SetFormValue(this.Controls, dt);
         }
 
@@ -167,7 +161,7 @@ namespace UAS_LabelMachine
 
         private void CollectionSetting_Click(object sender, EventArgs e)
         {
-            采集策略 form = new 采集策略(sg_code.Text);
+            采集策略 form = new 采集策略(sg_brand.Text);
             form.WindowState = FormWindowState.Maximized;
             form.FormClosed += sg_code_UserControlTextChanged;
             BaseUtil.SetFormCenter(form);
@@ -198,7 +192,11 @@ namespace UAS_LabelMachine
         private void sg_code_UserControlTextChanged(object sender, EventArgs e)
         {
             //取已启用的的按照采集次序排序
-            dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_code='" + sg_code.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_brand='" + sg_brand.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
+            if (dt.Rows.Count == 0)
+            {
+                dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where nvl(sg_brand,' ')=' ' and si_enable<>0 order by si_detno,si_innerdetno", "select");
+            }
             BaseUtil.FillDgvWithDataTable(Si_ItemDGV, dt);
             if (dt.Rows.Count > 0)
             {
@@ -317,7 +315,7 @@ namespace UAS_LabelMachine
         /// </summary>
         private void CollectInputData()
         {
-            LogManager.DoLog("采集数据【" + Input.Text + "】,使用采集策略编号【" + sg_code.Text + "】");
+            LogManager.DoLog("采集数据【" + Input.Text + "】,使用采集策略编号【" + sg_brand.Text + "】");
             //按DetNo排列之后的采集项
             ScanData = new ArrayList<ArrayList<string>>();
             //每个采集项目的子项
@@ -444,12 +442,18 @@ namespace UAS_LabelMachine
                     {
                         LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
                         LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
+                        string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
+                        string lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
+                        string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
+                        ErrorType.Clear();
+                        dh.ExecuteSql("update prodiobarcode set pib_datecode='" + datecode + "',pib_lotno='" + lotno + "',pib_ifpick=-1 where pib_id='" + pib_id + "'", "update");
                         LabelInf.Invalidate();
                     }
                 }
                 //采集未通过的时候
                 else
                 {
+                    ErrorType.Clear();
                     //如果自动采集采集未成功需要移动到下一行
                     if (!AutoMatch.Checked)
                         SetRowIndexToCollectRow();
@@ -460,36 +464,19 @@ namespace UAS_LabelMachine
                 if (!AutoMatch.Checked)
                     SetRowIndexToCollectRow();
             }
+            RemindUser();
             //提醒用户需要采集的数据
             MessageLog.AppendText(">>扫描到数据" + Input.Text + "\n", Color.Blue);
-            RemindUser();
             //如果所采集的行的物料不一样的话,重新计算箱内容量
             if (CurrentRowIndex - 1 > 0)
             {
                 string LastRowProd = LabelInf.Rows[CurrentRowIndex - 1].Cells["pib_prodcode"].Value.ToString();
                 string CurrentRowProd = LabelInf.Rows[CurrentRowIndex].Cells["pib_prodcode"].Value.ToString();
-                //如果两行的物料资料不相等的话
-                if (LastRowProd != CurrentRowProd)
-                    SetOutBoxCapacity(CurrentRowProd);
             }
             if (CleanInputAfterCollect.Checked)
                 Input.Text = "";
         }
 
-        /// <summary>
-        /// 根据物料资料的参数设置外箱容量
-        /// </summary>
-        /// <param name="pr_code"></param>
-        private void SetOutBoxCapacity(string pr_code)
-        {
-            DataTable temp = (DataTable)dh.ExecuteSql("select pr_qtyperplace,pr_zxbzs from product where pr_code='" + pr_code + "'", "select");
-            if (temp.Rows.Count > 0)
-            {
-                //try { OutboxCapacity.Value = (decimal)temp.Rows[0]["pr_qtyperplace"] / (decimal)temp.Rows[0]["pr_zxbzs"]; }
-                //catch (Exception) { }
-            }
-        }
-
         //设置行的索引到当前需要采集的行
         private void SetRowIndexToCollectRow()
         {
@@ -524,6 +511,7 @@ namespace UAS_LabelMachine
             }
         }
 
+        List<string> ErrorType = new List<string>();
         /// <summary>
         /// 自定义函数 将匹配之后的值设置到Cell中,传递引用,每次赋值之后从List中移除已使用过的
         /// </summary>
@@ -563,6 +551,7 @@ namespace UAS_LabelMachine
                             //采集的供应商号不匹配的话
                             if (cell.Value.ToString() != Matchstr)
                             {
+                                ErrorType.Add("NG_MPN");
                                 CollectVeProdCodePass = false;
                                 //添加需要重绘的Cell
                                 LabelInf.Refresh();
@@ -570,6 +559,7 @@ namespace UAS_LabelMachine
                             }
                             else
                             {
+                                ErrorType.Add("OK_MPN");
                                 LabelInf.Refresh();
                                 CollectVeProdCodePass = true;
                             }
@@ -600,12 +590,14 @@ namespace UAS_LabelMachine
                             //如果采集的数量不相等的话
                             if (cell.Value.ToString() != Matchstr)
                             {
+                                ErrorType.Add("NG_CPN");
                                 CollectQTYPass = false;
                                 LabelInf.Refresh();
                                 MessageLog.AppendText(">>CPN不匹配\n", Color.Red);
                             }
                             else
                             {
+                                ErrorType.Add("OK_CPN");
                                 LabelInf.Refresh();
                                 CollectQTYPass = true;
                             }
@@ -697,18 +689,6 @@ namespace UAS_LabelMachine
                     }
                     catch (Exception e) { LogManager.DoLog(e.StackTrace); }
                     break;
-                case "二次解析":
-                    if (SiItem[item]["si_indexstring"] != "")
-                    {
-                        //长度不为空的时候按照指定的长度去取数据
-                        if (SiItem[item]["si_length"] != "")
-                            str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1, int.Parse(SiItem[item]["si_length"]));
-                        //长度为空的时候取index之后的全部数据
-                        else
-                            str = str.Substring(str.IndexOf(SiItem[item]["si_indexstring"]) + 1);
-                    }
-                    str = Analysis.AnalysisData(Brand, item, str);
-                    break;
                 case "全部":
                     break;
                 default:
@@ -760,14 +740,17 @@ namespace UAS_LabelMachine
                 sql.Clear();
                 sql.Append("select pi_id,pi_cardcode,to_char(pi_date,'yyyymmdd')pi_date from prodinout where pi_inoutno='" + pi_inoutno.Text + "' ");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                ErrorType.Clear();
                 if (dt.Rows.Count > 0)
                 {
                     cu_code.Text = dt.Rows[0]["pi_cardcode"].ToString();
                     pi_date.Text = dt.Rows[0]["pi_date"].ToString();
                     PI_ID = dt.Rows[0]["pi_id"].ToString();
-                    if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "")
+                    dt = (DataTable)dh.ExecuteSql("select 1 from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "select");
+                    if (dh.GetConfig("AutoBarcode", "ProdInOut!Sale").ToString() != "" && dt.Rows.Count == 0)
                     {
-                        string[] param = new string[] { PI_ID, "" };
+                        string Error = "";
+                        string[] param = new string[] { PI_ID, "", Error };
                         dh.CallProcedure("GetCustBarcode", param);
                     }
                     LoadGridData(sender, e);
@@ -815,10 +798,9 @@ namespace UAS_LabelMachine
         /// <param name="e"></param>
         private void LoadGridData(object sender, EventArgs e)
         {
-            AllCollect = false;
             sql.Clear();
             sql.Append("select 0 choose,pd_custprodcode,pd_custprodspec,pr_orispeccode,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_datecode1,pib_pdid,pib_piid,pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand, pr_vendprodcode,");
-            sql.Append("pib_lotno,pib_datecode,pib_qty,pr_spec,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint");
+            sql.Append("pib_lotno,pib_datecode,pib_qty,pr_spec,pr_detail,pr_zxbzs,pr_unit,pib_barcode,pib_outboxcode1,pib_outboxcode2,nvl(pib_ifpick,0)pib_ifpick,nvl(pib_ifprint,0)pib_ifprint");
             sql.Append(" from prodiobarcode left join prodiodetail on pib_piid=pd_piid and pd_pdno=pib_pdno and ");
             sql.Append(" pd_prodcode=pib_prodcode left join product on pr_code=pib_prodcode left join sale on sa_code=pib_ordercode ");
             sql.Append("where pib_piid='" + PI_ID + "' order by pd_pdno");
@@ -831,8 +813,7 @@ namespace UAS_LabelMachine
             {
                 Brand = LabelInf.Rows[0].Cells["pib_brand"].FormattedValue.ToString();
                 if (Brand != "")
-                    sg_code.Text = dh.getFieldDataByCondition("scangroup", "sg_code", "sg_brand='" + Brand + "'").ToString();
-                SetOutBoxCapacity(LabelInf.Rows[0].Cells["pib_prodcode"].Value.ToString());
+                    sg_brand.Text = Brand;
             }
             //绑定数据之后往下找到未采集的数据显示在当前采集的栏目
             for (int i = 0; i < LabelInf.RowCount; i++)
@@ -872,7 +853,7 @@ namespace UAS_LabelMachine
                 {
                     if (LabelInf.Rows[e.RowIndex].Cells["pib_ifpick"].FormattedValue.ToString() == "True")
                     {
-                        if (LabelInf.Columns[e.ColumnIndex].Name == "pib_lotno" || LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode")
+                        if (LabelInf.Columns[e.ColumnIndex].Name == "pr_orispeccode" || LabelInf.Columns[e.ColumnIndex].Name == "pd_custprodcode")
                         {
                             SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
                             e.Graphics.FillRectangle(Brushes.ForestGreen, e.CellBounds);
@@ -884,6 +865,60 @@ namespace UAS_LabelMachine
                         }
                     }
                 }
+                if (e.RowIndex == CurrentRowIndex)
+                {
+                    if (LabelInf.Columns[e.ColumnIndex].Name == "pr_orispeccode")
+                    {
+                        SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
+                        if (ErrorType.Count > 0)
+                        {
+                            if (ErrorType.Contains("OK_MPN"))
+                            {
+                                e.Graphics.FillRectangle(Brushes.ForestGreen, e.CellBounds);
+                                Rectangle border = e.CellBounds;
+                                border.Width -= 1;
+                                e.Graphics.DrawRectangle(Pens.Black, border);
+                                e.PaintContent(e.CellBounds);
+                                e.Handled = true;
+                            }
+                            else if (ErrorType.Contains("NG_MPN"))
+                            {
+                                e.Graphics.FillRectangle(Brushes.Red, e.CellBounds);
+                                Rectangle border = e.CellBounds;
+                                border.Width -= 1;
+                                e.Graphics.DrawRectangle(Pens.Black, border);
+                                e.PaintContent(e.CellBounds);
+                                e.Handled = true;
+                            }
+                        }
+                    }
+                    if (LabelInf.Columns[e.ColumnIndex].Name == "pd_custprodcode")
+                    {
+                        SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
+                        if (ErrorType.Count > 0)
+                        {
+                            if (ErrorType.Contains("OK_CPN"))
+                            {
+                                e.Graphics.FillRectangle(Brushes.ForestGreen, e.CellBounds);
+                                Rectangle border = e.CellBounds;
+                                border.Width -= 1;
+                                e.Graphics.DrawRectangle(Pens.Black, border);
+                                e.PaintContent(e.CellBounds);
+                                e.Handled = true;
+                            }
+                            else if (ErrorType.Contains("NG_CPN"))
+                            {
+                                e.Graphics.FillRectangle(Brushes.Red, e.CellBounds);
+                                Rectangle border = e.CellBounds;
+                                border.Width -= 1;
+                                e.Graphics.DrawRectangle(Pens.Black, border);
+                                e.PaintContent(e.CellBounds);
+                                e.Handled = true;
+                            }
+
+                        }
+                    }
+                }
             }
         }
 
@@ -895,7 +930,6 @@ namespace UAS_LabelMachine
         private void pr_code_UserControlTextChanged(object sender, EventArgs e)
         {
             //用户在重新勾选后重置采集项目的索引
-            CurrentItemIndex = 0;
             for (int i = 0; i < LabelInf.RowCount; i++)
             {
                 if (pr_code.Text == LabelInf.Rows[i].Cells["pib_prodcode"].Value.ToString() && LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
@@ -941,22 +975,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void AllCollected_Click(object sender, EventArgs e)
-        {
-            if (AllCollect == false)
-            {
-                foreach (DataGridViewRow dr in LabelInf.Rows)
-                    dr.Cells[1].Value = true;
-                AllCollect = true;
-            }
-            else
-            {
-                foreach (DataGridViewRow dr in LabelInf.Rows)
-                    dr.Cells[1].Value = false;
-                AllCollect = false;
-            }
-        }
-
         private void LogingOut_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
         {
             string close = MessageBox.Show(this.ParentForm, "是否注销", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
@@ -1036,11 +1054,6 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void RefreshDBConnect_Tick(object sender, EventArgs e)
-        {
-            dh.ExecuteSql("select sysdate from dual", "select");
-        }
-
         private void CleanBarCode_Click(object sender, EventArgs e)
         {
             string close = MessageBox.Show(this.ParentForm, "是否清除该出货单条码", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();

+ 6 - 6
UAS-出货标签管理(标签复核)/UAS_出货标签管理.resx

@@ -141,22 +141,22 @@
   <metadata name="si_expressionitem.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="RefreshDBConnect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
   <metadata name="MidSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>179, 17</value>
   </metadata>
   <metadata name="ExportFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     <value>294, 17</value>
   </metadata>
-  <metadata name="pd_custprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pd_custprodspec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pd_custprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_custprodspec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">