Browse Source

修改指定数据上传功能

章政 7 years ago
parent
commit
f405827041

+ 21 - 1
UAS-出货标签管理(吉利通)/PublicMethod/DataHelper.cs

@@ -813,6 +813,7 @@ namespace UAS_LabelMachine
         {
             object result = null;
             command = new OracleCommand(SQL, connection);
+            Console.WriteLine(SQL);
             //用来拼接参数的
             if (names.Length > 0)
             {
@@ -954,7 +955,26 @@ namespace UAS_LabelMachine
             //将第一个数组的下标固定为0作为循环添加的参数的名称
             for (int i = 1; i <= names[0].Length; i++)
             {
-                command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
+                if (names[0][i - 1].ToString().ToUpper().Contains("DATE"))
+                {
+                    try
+                    {
+                        DateTime[] time = new DateTime[names[i].Length];
+                        for (int j = 0; j < names[i].Length; j++)
+                        {
+                            time[j] = Convert.ToDateTime(names[i][j]);
+                        }
+                        command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Date, time, ParameterDirection.Input));
+                    }
+                    catch (Exception)
+                    {
+                        command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
+                    }
+                }
+                else
+                {
+                    command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
+                }
             }
             command.ExecuteNonQuery();
             command.Dispose();

+ 42 - 4
UAS-出货标签管理(吉利通)/PublicMethod/LogicHandler.cs

@@ -1,4 +1,5 @@
-using UAS_LabelMachine.Entity;
+using System.Data;
+using UAS_LabelMachine.Entity;
 
 namespace UAS_LabelMachine.PublicMethod
 {
@@ -6,13 +7,50 @@ namespace UAS_LabelMachine.PublicMethod
     {
         static AccessDBHelper adh = SystemInf.adh;
 
+        static DataHelper dh = SystemInf.dh;
+
+        /// <summary>
+        /// 更新为已复核
+        /// </summary>
+        /// <param name="iPibID"></param>
+        public static void UpdateRowRechecked(object iPibID)
+        {
+            adh.UpdateByCondition("prodiobarcode", "pib_ifcheck=-1", "pib_id=" + iPibID);
+        }
+
+        /// <summary>
+        /// 更新为已打印
+        /// </summary>
+        /// <param name="iPibID"></param>
+        public static void UpdateRowPrinted(object iPibID)
+        {
+            adh.UpdateByCondition("prodiobarcode", "pib_ifprint=-1", "pib_id=" + iPibID);
+        }
+
         /// <summary>
-        /// 更新本地数据库已采集
+        /// 更新已采集
         /// </summary>
         /// <param name="iPibID"></param>
-        public static void UpdateRowCollected(int iPibID)
+        public static void UpdateRowPicked(object iPibID)
+        {
+            adh.UpdateByCondition("prodiobarcode", "pib_ifpick=-1,pib_modify=-1", "pib_id=" + iPibID);
+        }
+
+        /// <summary>
+        /// 检测数据库未上传的数据,根据设置的上传条数上传数据
+        /// </summary>
+        /// <param name="iInoutno"></param>
+        public static void CheckUoloadData(string iInoutno, int iUploadNum)
         {
-            adh.UpdateByCondition("prodiobarcode", "pib_ifcheck=-1,pib_ifprint=-1", "pib_id=" + iPibID);
+            DataTable dt = (DataTable)adh.ExecuteSql("select pib_id,pib_lotno,pib_ifmodify,pib_datecode,pib_ifpick,-1 as pib_ifupload,pib_ifprint,pib_ifrecheck from prodiobarcode where pib_inoutno='" + iInoutno + "' and pib_ifmodify=-1 and pib_ifupload<>-1", "select");
+            //如果本地需要上传的数据已经达到了需要上传的条数
+            if (iUploadNum <= dt.Rows.Count)
+            {
+                //上传数据
+                dh.SaveDataTable(dt, "prodiobarcode", "pib_id");
+                //更新本地数据为已上传
+                adh.UpdateByCondition("prodiobarcode", "pib_ifupload=-1", "pib_inoutno='" + iInoutno + "' and pib_ifmodify=-1 and pib_ifupload<>-1");
+            }
         }
     }
 }

+ 247 - 247
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -122,32 +122,6 @@
             this.sg_code = 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.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.SingleLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
-            this.SingleLabelPrint = new System.Windows.Forms.Button();
-            this.SingleLabelAutoPrint = new System.Windows.Forms.CheckBox();
-            this.SingleLabelCombox = new System.Windows.Forms.ComboBox();
-            this.MidLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.MidLabelNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label5 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
-            this.MidLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
-            this.label15 = new System.Windows.Forms.Label();
-            this.MidBoxCapacity = new System.Windows.Forms.NumericUpDown();
-            this.MidLabelPrint = new System.Windows.Forms.Button();
-            this.MidLabelAutoPrint = new System.Windows.Forms.CheckBox();
-            this.MidLabelCombox = new System.Windows.Forms.ComboBox();
-            this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.LogingOut = new System.Windows.Forms.LinkLabel();
-            this.OutBoxNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.label10 = new System.Windows.Forms.Label();
-            this.label6 = new System.Windows.Forms.Label();
-            this.OutBoxPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
-            this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
-            this.OutBoxLabelPrint = new System.Windows.Forms.Button();
-            this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
-            this.OutBoxCombox = new System.Windows.Forms.ComboBox();
             this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -174,6 +148,32 @@
             this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.SingleLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
+            this.SingleLabelPrint = new System.Windows.Forms.Button();
+            this.SingleLabelAutoPrint = new System.Windows.Forms.CheckBox();
+            this.SingleLabelCombox = new System.Windows.Forms.ComboBox();
+            this.MidLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.MidLabelNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.MidLabelPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
+            this.label15 = new System.Windows.Forms.Label();
+            this.MidBoxCapacity = new System.Windows.Forms.NumericUpDown();
+            this.MidLabelPrint = new System.Windows.Forms.Button();
+            this.MidLabelAutoPrint = new System.Windows.Forms.CheckBox();
+            this.MidLabelCombox = new System.Windows.Forms.ComboBox();
+            this.OutBoxLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.LogingOut = new System.Windows.Forms.LinkLabel();
+            this.OutBoxNum = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.label10 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.OutBoxPrinter = new UAS_LabelMachine.CustomControl.PrinterCombox();
+            this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
+            this.OutBoxLabelPrint = new System.Windows.Forms.Button();
+            this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
+            this.OutBoxCombox = new System.Windows.Forms.ComboBox();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -331,7 +331,7 @@
             this.si_expression,
             this.si_item,
             this.si_expressionitem});
-            this.Si_ItemDGV.Location = new System.Drawing.Point(1119, 316);
+            this.Si_ItemDGV.Location = new System.Drawing.Point(1250, 273);
             this.Si_ItemDGV.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Si_ItemDGV.Name = "Si_ItemDGV";
             this.Si_ItemDGV.RowTemplate.Height = 23;
@@ -768,7 +768,7 @@
             this.groupBoxWithBorder1.Controls.Add(this.SingleBoxBegin);
             this.groupBoxWithBorder1.Controls.Add(this.label12);
             this.groupBoxWithBorder1.Controls.Add(this.label7);
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(598, 6);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(599, 6);
             this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
             this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
@@ -1096,7 +1096,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(1383, 97);
             this.MessageLog.TabIndex = 28;
             this.MessageLog.Text = "";
             // 
@@ -1137,13 +1137,224 @@
             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(1251, 326);
+            this.LabelInf.Size = new System.Drawing.Size(1385, 326);
             this.LabelInf.TabIndex = 27;
             this.LabelInf.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellEndEdit);
             this.LabelInf.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.LabelInf_CellPainting);
             this.LabelInf.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellValueChanged);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
             // 
+            // Choose
+            // 
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            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_id1
+            // 
+            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;
+            // 
+            // pib_pdno
+            // 
+            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_prodcode
+            // 
+            this.pib_prodcode.DataPropertyName = "pib_prodcode";
+            this.pib_prodcode.HeaderText = "物料编号";
+            this.pib_prodcode.Name = "pib_prodcode";
+            this.pib_prodcode.ReadOnly = true;
+            this.pib_prodcode.Width = 78;
+            // 
+            // pib_ifmodify
+            // 
+            this.pib_ifmodify.DataPropertyName = "pib_ifmodify";
+            this.pib_ifmodify.HeaderText = "已修改";
+            this.pib_ifmodify.Name = "pib_ifmodify";
+            this.pib_ifmodify.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pib_ifmodify.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.pib_ifmodify.Width = 66;
+            // 
+            // pib_ifupload
+            // 
+            this.pib_ifupload.DataPropertyName = "pib_ifupload";
+            this.pib_ifupload.HeaderText = "已上传";
+            this.pib_ifupload.Name = "pib_ifupload";
+            this.pib_ifupload.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pib_ifupload.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.pib_ifupload.Width = 66;
+            // 
+            // pr_vendprodcode
+            // 
+            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
+            this.pr_vendprodcode.HeaderText = "MPN";
+            this.pr_vendprodcode.Name = "pr_vendprodcode";
+            this.pr_vendprodcode.ReadOnly = true;
+            this.pr_vendprodcode.Width = 48;
+            // 
+            // pib_brand
+            // 
+            this.pib_brand.DataPropertyName = "pib_brand";
+            this.pib_brand.HeaderText = "品牌";
+            this.pib_brand.Name = "pib_brand";
+            this.pib_brand.ReadOnly = true;
+            this.pib_brand.Visible = false;
+            this.pib_brand.Width = 54;
+            // 
+            // pib_madein
+            // 
+            this.pib_madein.DataPropertyName = "pib_madein";
+            this.pib_madein.HeaderText = "产地";
+            this.pib_madein.Name = "pib_madein";
+            this.pib_madein.Visible = false;
+            this.pib_madein.Width = 54;
+            // 
+            // pr_zxbzs
+            // 
+            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;
+            // 
+            // pr_unit
+            // 
+            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_lotno
+            // 
+            this.pib_lotno.DataPropertyName = "pib_lotno";
+            this.pib_lotno.HeaderText = "LotNo";
+            this.pib_lotno.Name = "pib_lotno";
+            this.pib_lotno.Width = 60;
+            // 
+            // pib_datecode
+            // 
+            this.pib_datecode.DataPropertyName = "pib_datecode";
+            this.pib_datecode.HeaderText = "DateCode";
+            this.pib_datecode.Name = "pib_datecode";
+            this.pib_datecode.Width = 78;
+            // 
+            // pib_ifpick
+            // 
+            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_ifprint
+            // 
+            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.Width = 60;
+            // 
+            // pib_ifrecheck
+            // 
+            this.pib_ifrecheck.DataPropertyName = "pib_ifrecheck";
+            this.pib_ifrecheck.HeaderText = "已复核";
+            this.pib_ifrecheck.Name = "pib_ifrecheck";
+            this.pib_ifrecheck.Width = 47;
+            // 
+            // pib_datecode1
+            // 
+            this.pib_datecode1.DataPropertyName = "pib_datecode1";
+            this.pib_datecode1.HeaderText = "DateCode1";
+            this.pib_datecode1.Name = "pib_datecode1";
+            this.pib_datecode1.Visible = false;
+            this.pib_datecode1.Width = 84;
+            // 
+            // pib_qty
+            // 
+            this.pib_qty.DataPropertyName = "pib_qty";
+            this.pib_qty.HeaderText = "数量";
+            this.pib_qty.Name = "pib_qty";
+            this.pib_qty.ReadOnly = true;
+            this.pib_qty.Visible = false;
+            this.pib_qty.Width = 54;
+            // 
+            // pib_barcode
+            // 
+            this.pib_barcode.DataPropertyName = "pib_barcode";
+            this.pib_barcode.HeaderText = "唯一条码";
+            this.pib_barcode.Name = "pib_barcode";
+            this.pib_barcode.ReadOnly = true;
+            this.pib_barcode.Width = 78;
+            // 
+            // pib_custbarcode
+            // 
+            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
+            this.pib_custbarcode.HeaderText = "客户条码";
+            this.pib_custbarcode.Name = "pib_custbarcode";
+            this.pib_custbarcode.ReadOnly = true;
+            this.pib_custbarcode.Width = 78;
+            // 
+            // pd_pocode
+            // 
+            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;
+            // 
+            // pd_custprodcode
+            // 
+            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
+            this.pd_custprodcode.HeaderText = "客户料号";
+            this.pd_custprodcode.Name = "pd_custprodcode";
+            this.pd_custprodcode.ReadOnly = true;
+            this.pd_custprodcode.Width = 78;
+            // 
+            // pd_custprodspec
+            // 
+            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
+            this.pd_custprodspec.HeaderText = "客户型号";
+            this.pd_custprodspec.Name = "pd_custprodspec";
+            this.pd_custprodspec.ReadOnly = true;
+            this.pd_custprodspec.Width = 78;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "规格";
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.Visible = false;
+            this.pr_spec.Width = 54;
+            // 
+            // pib_outboxcode1
+            // 
+            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
+            this.pib_outboxcode1.HeaderText = "中盒号";
+            this.pib_outboxcode1.Name = "pib_outboxcode1";
+            this.pib_outboxcode1.Width = 90;
+            // 
+            // pib_outboxcode2
+            // 
+            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
+            this.pib_outboxcode2.HeaderText = "外箱号";
+            this.pib_outboxcode2.Name = "pib_outboxcode2";
+            this.pib_outboxcode2.Width = 90;
+            // 
             // pi_inoutno
             // 
             this.pi_inoutno.ID = null;
@@ -1164,7 +1375,7 @@
             this.SingleLabel.Controls.Add(this.SingleLabelAutoPrint);
             this.SingleLabel.Controls.Add(this.SingleLabelCombox);
             this.SingleLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabel.Location = new System.Drawing.Point(754, 6);
+            this.SingleLabel.Location = new System.Drawing.Point(753, 6);
             this.SingleLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.SingleLabel.Name = "SingleLabel";
             this.SingleLabel.Padding = new System.Windows.Forms.Padding(2);
@@ -1231,11 +1442,11 @@
             this.MidLabel.Controls.Add(this.MidLabelAutoPrint);
             this.MidLabel.Controls.Add(this.MidLabelCombox);
             this.MidLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabel.Location = new System.Drawing.Point(912, 6);
+            this.MidLabel.Location = new System.Drawing.Point(914, 6);
             this.MidLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabel.Name = "MidLabel";
             this.MidLabel.Padding = new System.Windows.Forms.Padding(2);
-            this.MidLabel.Size = new System.Drawing.Size(158, 238);
+            this.MidLabel.Size = new System.Drawing.Size(293, 238);
             this.MidLabel.TabIndex = 78;
             this.MidLabel.TabStop = false;
             this.MidLabel.Text = "中盒标签";
@@ -1334,7 +1545,7 @@
             this.MidLabelCombox.Location = new System.Drawing.Point(7, 46);
             this.MidLabelCombox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MidLabelCombox.Name = "MidLabelCombox";
-            this.MidLabelCombox.Size = new System.Drawing.Size(143, 25);
+            this.MidLabelCombox.Size = new System.Drawing.Size(141, 25);
             this.MidLabelCombox.TabIndex = 40;
             this.MidLabelCombox.SelectedIndexChanged += new System.EventHandler(this.MidLabelCombox_SelectedIndexChanged);
             // 
@@ -1350,7 +1561,7 @@
             this.OutBoxLabel.Controls.Add(this.OutBoxLabelAutoPrint);
             this.OutBoxLabel.Controls.Add(this.OutBoxCombox);
             this.OutBoxLabel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLabel.Location = new System.Drawing.Point(1075, 6);
+            this.OutBoxLabel.Location = new System.Drawing.Point(1212, 6);
             this.OutBoxLabel.Margin = new System.Windows.Forms.Padding(2);
             this.OutBoxLabel.Name = "OutBoxLabel";
             this.OutBoxLabel.Padding = new System.Windows.Forms.Padding(2);
@@ -1463,223 +1674,12 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // Choose
-            // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            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_id1
-            // 
-            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;
-            // 
-            // pib_pdno
-            // 
-            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_prodcode
-            // 
-            this.pib_prodcode.DataPropertyName = "pib_prodcode";
-            this.pib_prodcode.HeaderText = "物料编号";
-            this.pib_prodcode.Name = "pib_prodcode";
-            this.pib_prodcode.ReadOnly = true;
-            this.pib_prodcode.Width = 78;
-            // 
-            // pib_ifmodify
-            // 
-            this.pib_ifmodify.DataPropertyName = "pib_ifmodify";
-            this.pib_ifmodify.HeaderText = "已修改";
-            this.pib_ifmodify.Name = "pib_ifmodify";
-            this.pib_ifmodify.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pib_ifmodify.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.pib_ifmodify.Width = 66;
-            // 
-            // pib_ifupload
-            // 
-            this.pib_ifupload.DataPropertyName = "pib_ifupload";
-            this.pib_ifupload.HeaderText = "已上传";
-            this.pib_ifupload.Name = "pib_ifupload";
-            this.pib_ifupload.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.pib_ifupload.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.pib_ifupload.Width = 66;
-            // 
-            // pr_vendprodcode
-            // 
-            this.pr_vendprodcode.DataPropertyName = "pr_vendprodcode";
-            this.pr_vendprodcode.HeaderText = "MPN";
-            this.pr_vendprodcode.Name = "pr_vendprodcode";
-            this.pr_vendprodcode.ReadOnly = true;
-            this.pr_vendprodcode.Width = 48;
-            // 
-            // pib_brand
-            // 
-            this.pib_brand.DataPropertyName = "pib_brand";
-            this.pib_brand.HeaderText = "品牌";
-            this.pib_brand.Name = "pib_brand";
-            this.pib_brand.ReadOnly = true;
-            this.pib_brand.Visible = false;
-            this.pib_brand.Width = 54;
-            // 
-            // pib_madein
-            // 
-            this.pib_madein.DataPropertyName = "pib_madein";
-            this.pib_madein.HeaderText = "产地";
-            this.pib_madein.Name = "pib_madein";
-            this.pib_madein.Visible = false;
-            this.pib_madein.Width = 54;
-            // 
-            // pr_zxbzs
-            // 
-            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;
-            // 
-            // pr_unit
-            // 
-            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_lotno
-            // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.Width = 60;
-            // 
-            // pib_datecode
-            // 
-            this.pib_datecode.DataPropertyName = "pib_datecode";
-            this.pib_datecode.HeaderText = "DateCode";
-            this.pib_datecode.Name = "pib_datecode";
-            this.pib_datecode.Width = 78;
-            // 
-            // pib_ifpick
-            // 
-            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_ifprint
-            // 
-            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.Width = 60;
-            // 
-            // pib_ifrecheck
-            // 
-            this.pib_ifrecheck.DataPropertyName = "pib_ifrecheck";
-            this.pib_ifrecheck.HeaderText = "已复核";
-            this.pib_ifrecheck.Name = "pib_ifrecheck";
-            this.pib_ifrecheck.Width = 47;
-            // 
-            // pib_datecode1
-            // 
-            this.pib_datecode1.DataPropertyName = "pib_datecode1";
-            this.pib_datecode1.HeaderText = "DateCode1";
-            this.pib_datecode1.Name = "pib_datecode1";
-            this.pib_datecode1.Visible = false;
-            this.pib_datecode1.Width = 84;
-            // 
-            // pib_qty
-            // 
-            this.pib_qty.DataPropertyName = "pib_qty";
-            this.pib_qty.HeaderText = "数量";
-            this.pib_qty.Name = "pib_qty";
-            this.pib_qty.ReadOnly = true;
-            this.pib_qty.Visible = false;
-            this.pib_qty.Width = 54;
-            // 
-            // pib_barcode
-            // 
-            this.pib_barcode.DataPropertyName = "pib_barcode";
-            this.pib_barcode.HeaderText = "唯一条码";
-            this.pib_barcode.Name = "pib_barcode";
-            this.pib_barcode.ReadOnly = true;
-            this.pib_barcode.Width = 78;
-            // 
-            // pib_custbarcode
-            // 
-            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
-            this.pib_custbarcode.HeaderText = "客户条码";
-            this.pib_custbarcode.Name = "pib_custbarcode";
-            this.pib_custbarcode.ReadOnly = true;
-            this.pib_custbarcode.Width = 78;
-            // 
-            // pd_pocode
-            // 
-            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;
-            // 
-            // pd_custprodcode
-            // 
-            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
-            this.pd_custprodcode.HeaderText = "客户料号";
-            this.pd_custprodcode.Name = "pd_custprodcode";
-            this.pd_custprodcode.ReadOnly = true;
-            this.pd_custprodcode.Width = 78;
-            // 
-            // pd_custprodspec
-            // 
-            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
-            this.pd_custprodspec.HeaderText = "客户型号";
-            this.pd_custprodspec.Name = "pd_custprodspec";
-            this.pd_custprodspec.ReadOnly = true;
-            this.pd_custprodspec.Width = 78;
-            // 
-            // pr_spec
-            // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "规格";
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Visible = false;
-            this.pr_spec.Width = 54;
-            // 
-            // pib_outboxcode1
-            // 
-            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
-            this.pib_outboxcode1.HeaderText = "中盒号";
-            this.pib_outboxcode1.Name = "pib_outboxcode1";
-            this.pib_outboxcode1.Width = 90;
-            // 
-            // pib_outboxcode2
-            // 
-            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
-            this.pib_outboxcode2.HeaderText = "外箱号";
-            this.pib_outboxcode2.Name = "pib_outboxcode2";
-            this.pib_outboxcode2.Width = 90;
-            // 
             // 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(1257, 711);
+            this.ClientSize = new System.Drawing.Size(1389, 711);
             this.Controls.Add(this.ButtonSetting);
             this.Controls.Add(this.ListButtonMenu);
             this.Controls.Add(this.CleanBarCode);

+ 9 - 8
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -137,8 +137,6 @@ namespace UAS_LabelMachine
 
         DataTable Attach;
 
-
-
         public UAS_出货标签打印(string Master)
         {
             InitializeComponent();
@@ -228,10 +226,11 @@ namespace UAS_LabelMachine
 
         private void GenerateBarCode_Click(object sender, EventArgs e)
         {
-            生成条码 form = new 生成条码(pi_inoutno.Text);
-            form.FormClosed += LoadGridData;
-            BaseUtil.SetFormCenter(form);
-            form.ShowDialog();
+            LogicHandler.CheckUoloadData(pi_inoutno.Text, UploadNum);
+            //生成条码 form = new 生成条码(pi_inoutno.Text);
+            //form.FormClosed += LoadGridData;
+            //BaseUtil.SetFormCenter(form);
+            //form.ShowDialog();
         }
 
         private void LabelMaintain_Click(object sender, EventArgs e)
@@ -505,7 +504,6 @@ namespace UAS_LabelMachine
                                 PaintCell.Add(LabelInf.Rows[i].Cells["pib_qty"], true);
                                 LabelInf.Refresh();
                                 LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
-                                adh.UpdateByCondition("prodiobarcode", "pib_ifpick=-1", "pib_id='" + LabelInf.Rows[i].Cells["pib_id"].Value + "'");
                                 LabelInf.Rows[i].Cells["Choose"].Value = true;
                                 //当前行的索引随循环增长
                                 CurrentRowIndex = i;
@@ -546,6 +544,7 @@ namespace UAS_LabelMachine
                     else
                     {
                         LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
+                        LogicHandler.UpdateRowPicked(LabelInf.Rows[CurrentRowIndex].Cells["pib_id"].Value);
                         LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
                         //勾选了单盘自动打印
                         if (SingleLabelAutoPrint.Checked)
@@ -651,6 +650,7 @@ namespace UAS_LabelMachine
             }
             SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
             SingleDoc.PrintDocument();
+            LogicHandler.UpdateRowPrinted(pib_id);
             LabelInf.Rows[CurrentRowIndex].Cells["pib_ifprint"].Value = true;
         }
 
@@ -1186,6 +1186,7 @@ namespace UAS_LabelMachine
                             }
                             SingleDoc.Printer.SwitchTo(SingleLabelPrinter.Text);
                             SingleDoc.PrintDocument();
+                            LogicHandler.UpdateRowPrinted(pib_id);
                             if (MidLabelAutoPrint.Checked)
                             {
                                 //判断当前行的盒号和下一行不相等或者已经是最后一行了
@@ -1583,7 +1584,7 @@ namespace UAS_LabelMachine
             if (dt.Rows.Count == 0)
             {
                 sql.Clear();
-                sql.Append("select pd_custprodcode,pib_inoutno,pd_custprodspec,pib_ifrecheck,pib_ifupload,pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,pib_pdid,pib_piid,pib_pdno,pib_prodcode,nvl(nvl(pd_brand,pib_brand),pr_brand)pib_brand, pr_vendprodcode,");
+                sql.Append("select pd_custprodcode,pib_inoutno,pd_custprodspec,nvl(pib_ifrecheck,0)pib_ifrecheck,nvl(pib_ifupload,0)pib_ifupload,nvl(pib_ifmodify,0)pib_ifmodify,pd_pocode,pib_madein,pib_custbarcode,pib_custoutboxcode,pib_id,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(" 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 ");