Sfoglia il codice sorgente

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

caosy 6 anni fa
parent
commit
146f8d7a6d

File diff suppressed because it is too large
+ 220 - 239
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs


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

@@ -289,7 +289,7 @@ namespace UAS_LabelMachine
                 int len = port.BytesToRead;
                 byte[] readBuffer = new byte[len];
                 port.Read(readBuffer, 0, len); //将数据读入缓存
-                string msg = Encoding.ASCII.GetString(readBuffer, 0, len); //获取出入库产品编号
+                string msg = Encoding.ASCII.GetString(readBuffer, 0, len).Replace("\n", "").Replace("\r", "").Replace("\t", ""); //获取出入库产品编号
                 int pib_pdno = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["pib_pdno"].Value.ToString());
                 if (DetailRange.Checked)
                 {
@@ -554,9 +554,9 @@ namespace UAS_LabelMachine
                     {
                         ErrorMsg = "订单号不匹配";
                     }
+                    //如果匹配到的行的品牌和当前正则的品牌不相等结束本次循环
                     if (LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"].Value.ToString() != sg_brand)
                     {
-                        ErrorMsg = "";
                         continue;
                     }
                     else
@@ -592,7 +592,6 @@ namespace UAS_LabelMachine
             {
                 //获取当前最大的箱号
                 LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value = DateCode;
-
                 LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value = LotNo;
                 LabelInf.Rows[CurrentRowIndex].Cells["pib_ifmodify"].Value = true;
                 SetOutboxBarcode();
@@ -968,39 +967,7 @@ namespace UAS_LabelMachine
                     string[] param = new string[] { PI_ID, "" };
                     dh.CallProcedure("GetCustBarcode", ref param);
                     //}
-                    //获取客户自定义设置
-                    sql.Clear();
-                    sql.Append("select cu_print_middc,cu_print_limiteddate,cu_print_outdc,cu_print_dateformat,cu_print_checkdatecode,cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
-                    sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression,cu_print_recheck from customer where cu_code='" + pi_cardcode.Text + "'");
-                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                    if (dt.Rows.Count > 0)
-                    {
-                        BaseUtil.SetFormValue(this.Controls, dt);
-                        switch (dt.Rows[0]["cu_print_custprodmatchmodel"].ToString())
-                        {
-                            case "Equal":
-                                Equal.Checked = true;
-                                break;
-                            case "Expression":
-                                Expression.Checked = true;
-                                break;
-                            default:
-                                Equal.Checked = true;
-                                break;
-                        }
-                        switch (dt.Rows[0]["cu_print_recheck"].ToString())
-                        {
-                            case "CP":
-                                RecheckCuprodcode.Checked = true;
-                                break;
-                            case "BR":
-                                RecheckBarcode.Checked = true;
-                                break;
-                            default:
-                                RecheckCuprodcode.Checked = true;
-                                break;
-                        }
-                    }
+                    RefreshParamData();
                     //查询所有的采集策略
                     sql.Clear();
                     sql.Append("select sg_id,sg_brand,si_item ,sg_script,max(si_expression)si_expression,instr(sg_name,si_name)itemindex,sg_name,si_name,sg_step from prodiodetail left join ");
@@ -1390,7 +1357,7 @@ namespace UAS_LabelMachine
             //查询参数名称相同的获取到取值字段
             for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
             {
-                DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                 if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
                 {
                     sql.Append(dr1[0]["lp_sql"].ToString() + ",");
@@ -1400,7 +1367,7 @@ namespace UAS_LabelMachine
             DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + (pib_outboxcode1 == "" ? "0" : pib_outboxcode1), "select");
             for (int j = 0; j < MidDoc.Variables.FormVariables.Count; j++)
             {
-                DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                DataRow[] dr1 = MidLabelParam.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                 if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
                 {
                     MidDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
@@ -1444,7 +1411,7 @@ namespace UAS_LabelMachine
                 }
                 if (MidDoc.Variables.FormVariables.Item(j + 1).Value == "")
                 {
-                    dr1 = Attach.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                    dr1 = Attach.Select("lp_name='" + MidDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                     if (dr1.Length > 0)
                         MidDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
                 }
@@ -1475,7 +1442,7 @@ namespace UAS_LabelMachine
             sql.Clear();
             for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
             {
-                DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                 if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
                 {
                     sql.Append(dr1[0]["lp_sql"].ToString() + ",");
@@ -1487,7 +1454,7 @@ namespace UAS_LabelMachine
             {
                 for (int j = 0; j < OutBoxDoc.Variables.FormVariables.Count; j++)
                 {
-                    DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                    DataRow[] dr1 = OutLabelParam.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                     if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "字符串")
                     {
                         OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
@@ -1531,7 +1498,7 @@ namespace UAS_LabelMachine
                     }
                     if (OutBoxDoc.Variables.FormVariables.Item(j + 1).Value == "")
                     {
-                        dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                        dr1 = Attach.Select("lp_name='" + OutBoxDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                         if (dr1.Length > 0)
                             OutBoxDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
                     }
@@ -1584,6 +1551,14 @@ namespace UAS_LabelMachine
         }
 
         private void LoadGridData()
+        {
+            thread = new Thread(LoadGridData1);
+            stw = new SetLoadingWindow(thread, "正在获取条码");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+        }
+
+        private void LoadGridData1()
         {
             LoadGridData(new object(), new EventArgs());
         }
@@ -1872,12 +1847,12 @@ namespace UAS_LabelMachine
                     for (int j = 0; j < LabelInf.Columns.Count; j++)
                     {
                         //去除ID列
-                        if (dt.Columns[i].ColumnName.ToLower().Contains("id") || dt.Columns[i].ColumnName.ToLower() == "pib_barcode" || dt.Columns[i].ColumnName.ToLower() == "pib_pdno" || dt.Columns[i].ColumnName.ToLower() == "pib_ifpick" || dt.Columns[i].ColumnName.ToLower() == "pib_ifprint" || dt.Columns[i].ColumnName.ToLower() == "pib_datecode1" || dt.Columns[i].ColumnName.ToLower() == "pr_vendprodcode")
+                        if (dt.Columns[i].ColumnName.Contains("id") || dt.Columns[i].ColumnName == "pib_barcode" || dt.Columns[i].ColumnName == "pib_pdno" || dt.Columns[i].ColumnName == "pib_ifpick" || dt.Columns[i].ColumnName == "pib_ifprint" || dt.Columns[i].ColumnName == "pib_datecode1" || dt.Columns[i].ColumnName == "pr_vendprodcode")
                         {
                             dt.Columns.RemoveAt(i);
                             break;
                         }
-                        switch (dt.Columns[i].ColumnName.ToLower())
+                        switch (dt.Columns[i].ColumnName)
                         {
                             case "pib_lotno":
                                 dt.Columns[i].ColumnName = "批次号";
@@ -1891,7 +1866,7 @@ namespace UAS_LabelMachine
                             default:
                                 break;
                         }
-                        if (dt.Columns[i].ColumnName.ToLower() == LabelInf.Columns[j].DataPropertyName.ToLower())
+                        if (dt.Columns[i].ColumnName == LabelInf.Columns[j].DataPropertyName)
                         {
                             dt.Columns[i].ColumnName = LabelInf.Columns[j].HeaderText;
                             break;
@@ -1914,7 +1889,7 @@ namespace UAS_LabelMachine
                     Properties.Settings.Default.MidBoxCapacity = nup.Value;
                     Properties.Settings.Default.Save();
                     break;
-                case "OutboxCapacity":
+                case "OutBoxCapacity":
                     Properties.Settings.Default.OutboxCapacity = nup.Value;
                     Properties.Settings.Default.Save();
                     break;
@@ -1925,7 +1900,7 @@ namespace UAS_LabelMachine
 
         private void RefreshDBConnect_Tick(object sender, EventArgs e)
         {
-            dh.getRowCount("employee", "1=1");
+          
         }
 
         private void ButtonSetting_Click(object sender, EventArgs e)
@@ -1941,11 +1916,13 @@ namespace UAS_LabelMachine
             {
                 case "采集策略设置":
                     采集策略_NEW form = new 采集策略_NEW();
+                    form.FormClosed += Form_FormClosed;
                     BaseUtil.SetFormCenter(form);
                     form.ShowDialog();
                     break;
                 case "生成条码":
                     生成条码 form3 = new 生成条码(pi_inoutno.Text);
+                    form3.FormClosed += Form_FormClosed;
                     BaseUtil.SetFormCenter(form3);
                     form3.ShowDialog();
                     break;
@@ -1953,12 +1930,14 @@ namespace UAS_LabelMachine
                     if (pi_cardcode.Text != "")
                     {
                         附件内容打印 att = new 附件内容打印(pi_cardcode.Text);
+                        att.FormClosed += Attach_Closed;
                         att.ShowDialog();
                     }
                     else MessageBox.Show("请先获取出库单信息");
                     break;
                 case "客户标签维护":
                     客户标签维护 form1 = new 客户标签维护();
+                    form1.FormClosed += Form_FormClosed;
                     BaseUtil.SetFormCenter(form1);
                     if (SingleDoc != null)
                         SingleDoc.Close();
@@ -1971,12 +1950,13 @@ namespace UAS_LabelMachine
                     break;
                 case "客户采集规则":
                     CustomerRule cust = new CustomerRule();
+                    cust.FormClosed += Form_FormClosed;
                     BaseUtil.SetFormCenter(cust);
                     cust.ShowDialog();
                     break;
                 case "参数配置":
                     ParamSetting form2 = new ParamSetting();
-                    form2.FormClosed += Form2_FormClosed;
+                    form2.FormClosed += Form_FormClosed;
                     BaseUtil.SetFormCenter(form2);
                     form2.ShowDialog();
                     break;
@@ -1990,9 +1970,14 @@ namespace UAS_LabelMachine
             }
         }
 
-        private void Form2_FormClosed(object sender, FormClosedEventArgs e)
+        private void Form_FormClosed(object sender, FormClosedEventArgs e)
         {
-            RefreshPLCInstruct();
+            RefreshParamData();
+        }
+
+        private void Attach_Closed(object sender, FormClosedEventArgs e)
+        {
+            RefreshAttachData();
         }
 
         private void DetailRange_CheckedChanged(object sender, EventArgs e)
@@ -2330,7 +2315,7 @@ namespace UAS_LabelMachine
             string month = "0";
             string day = "0";
             string date = "";
-            LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
+            LogicHandler.GetTimeFromDatecode(datecode, pi_cardcode.Text, out year, out month, out day, out date);
             adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
             LoadGridData();
             setvalue.FindForm().Close();
@@ -2346,19 +2331,17 @@ namespace UAS_LabelMachine
             string month = "0";
             string day = "0";
             string date = "";
-            LogicHandler.GetTimeFromDatecode(DateCode, pi_cardcode.Text, out year, out month, out day, out date);
+            LogicHandler.GetTimeFromDatecode(datecode, pi_cardcode.Text, out year, out month, out day, out date);
             adh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_ifmodify=-1,pib_ifprint=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "update");
             LoadGridData();
             DataTable pibid_dt = (DataTable)adh.ExecuteSql("select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno, "select");
             for (int i = 0; i < pibid_dt.Rows.Count; i++)
             {
-                SinglePrint(pibid_dt.Rows[i]["pib_id1"].ToString());
+                SinglePrint(pibid_dt.Rows[i]["pib_id"].ToString());
             }
             setvalueandprint.FindForm().Close();
         }
 
-
-
         private void ResetBarcode_Click(object sender, EventArgs e)
         {
             string close = MessageBox.Show(this.ParentForm, "是否重置本单据条码", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
@@ -2387,23 +2370,30 @@ namespace UAS_LabelMachine
             int outboxcode1 = int.Parse(Process_midboxcode.Text == "" ? "1" : Process_midboxcode.Text);
             int outboxcode2 = int.Parse(Process_outboxcode.Text == "" ? "1" : Process_outboxcode.Text);
             string pd_id = LabelInf.Rows[CurrentRowIndex].Cells["pd_id"].Value.ToString();
+            //获取上一行的数据
+            DataTable LastRowData = null;
             //如果满容量获取过箱号就不再重复获取了
             bool GetBarcode = false;
+            //获取当前的行号
+            int CurrentRowNum = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
             //超过中盒容量中盒号+1
             if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + outboxcode1) >= MidBoxCapacity.Value)
             {
                 outboxcode1 = outboxcode1 + 1;
                 GetBarcode = true;
                 LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
                 LogicHandler.SendDataToPLC(PLC1, PLCInstruct.MaterialTray, adh);
             }
-            //获取当前的行号
-            int CurrentRowNum = int.Parse(LabelInf.Rows[CurrentRowIndex].Cells["rownum"].Value.ToString());
-            //获取上一行的数据
-            DataTable LastRowData = null;
-            if (CurrentRowNum - 1 > 0)
+            else if (CurrentRowNum - 1 > 0)
             {
                 LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
+                string custmidboxcode = LastRowData.Rows[0]["pib_custmidboxcode"].ToString();
+                if (custmidboxcode == "")
+                {
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out MidBoxBarCode);
+                    LabelInf.Rows[CurrentRowIndex].Cells["pib_custmidboxcode"].Value = MidBoxBarCode;
+                }
                 //或者不符合合并条件中盒号+1
                 if (cu_print_midlotno.Checked)
                 {
@@ -2480,6 +2470,13 @@ namespace UAS_LabelMachine
             }
             else if (CurrentRowNum - 1 > 0)
             {
+                LastRowData = (DataTable)adh.ExecuteSql("select pib_lotno,pib_custmidboxcode,pib_custoutboxcode,pd_pocode,pd_custprodcode,pd_custprodspec,pib_datecode from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and rownum=" + (CurrentRowNum - 1), "select");
+                string custoutboxcode = LastRowData.Rows[0]["pib_custoutboxcode"].ToString();
+                if (custoutboxcode == "")
+                {
+                    LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
+                    LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
+                }
                 //或者不符合合并条件中盒号+1
                 if (cu_print_outlotno.Checked)
                 {
@@ -2553,18 +2550,19 @@ namespace UAS_LabelMachine
             sql.Clear();
             for (int j = 0; j < SingleDoc.Variables.FormVariables.Count; j++)
             {
-                DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                 if (dr1.Length > 0)
                 {
-                    if (dr1[0]["lp_sql"].ToString() == "字符串")
+                    if (dr1[0]["lp_valuetype"].ToString() == "字符串")
                         sql.Append(dr1[0]["lp_sql"].ToString() + ",");
                 }
             }
             sql.Append("1,");
             DataTable dt = (DataTable)adh.ExecuteSql("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_id=" + pib_id, "select");
+            Console.WriteLine("select " + sql.ToString().Substring(0, sql.Length - 1) + " from prodiobarcode where pib_id=" + pib_id);
             for (int j = 0; j < SingleDoc.Variables.FormVariables.Count; j++)
             {
-                DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                DataRow[] dr1 = SingleLabelParam.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                 if (dr1.Length > 0 && dr1[0]["lp_valuetype"].ToString() == "SQL值")
                 {
                     DataTable dt1 = (DataTable)adh.ExecuteSql(dr1[0]["lp_sql"].ToString().Replace("{1}", pib_id), "select");
@@ -2590,13 +2588,13 @@ namespace UAS_LabelMachine
                         }
                     }
                 }
-                else
+                else if (dr1.Length > 0)
                 {
                     SingleDoc.Variables.FormVariables.Item(j + 1).Value = dt.Rows[0][dr1[0]["lp_sql"].ToString()].ToString();
                 }
                 if (SingleDoc.Variables.FormVariables.Item(j + 1).Value == "")
                 {
-                    dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name.ToLower() + "'");
+                    dr1 = Attach.Select("lp_name='" + SingleDoc.Variables.FormVariables.Item(j + 1).Name + "'");
                     if (dr1.Length > 0)
                         SingleDoc.Variables.FormVariables.Item(j + 1).Value = dr1[0]["lp_sql"].ToString();
                 }
@@ -2605,5 +2603,47 @@ namespace UAS_LabelMachine
             SingleDoc.PrintDocument();
             LogicHandler.UpdateRowPrinted(pib_id);
         }
+
+        private void RefreshAttachData()
+        {
+
+        }
+
+        private void RefreshParamData()
+        {
+            //获取客户自定义设置
+            sql.Clear();
+            sql.Append("select cu_print_middc,cu_print_limiteddate,cu_print_outdc,cu_print_dateformat,cu_print_checkdatecode,cu_print_midlotno,nvl(cu_print_custprodmatchmodel,'Equal')cu_print_custprodmatchmodel,cu_print_midspec,cu_print_midpo,cu_print_midprod,cu_print_outlotno,cu_print_outspec,cu_print_outpo");
+            sql.Append(",cu_print_outprod,cu_print_checkonly,nvl(cu_print_papercount,0)cu_print_papercount,cu_print_regexpression,cu_print_recheck from customer where cu_code='" + pi_cardcode.Text + "'");
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                BaseUtil.SetFormValue(this.Controls, dt);
+                switch (dt.Rows[0]["cu_print_custprodmatchmodel"].ToString())
+                {
+                    case "Equal":
+                        Equal.Checked = true;
+                        break;
+                    case "Expression":
+                        Expression.Checked = true;
+                        break;
+                    default:
+                        Equal.Checked = true;
+                        break;
+                }
+                switch (dt.Rows[0]["cu_print_recheck"].ToString())
+                {
+                    case "CP":
+                        RecheckCuprodcode.Checked = true;
+                        break;
+                    case "BR":
+                        RecheckBarcode.Checked = true;
+                        break;
+                    default:
+                        RecheckCuprodcode.Checked = true;
+                        break;
+                }
+            }
+        }
     }
 }

+ 16 - 2
UAS-出货标签管理(吉利通)/采集策略_NEW.Designer.cs

@@ -163,6 +163,7 @@
             this.si_name1.Name = "si_name1";
             this.si_name1.Size = new System.Drawing.Size(65, 21);
             this.si_name1.TabIndex = 7;
+            this.si_name1.Tag = "Order";
             // 
             // si_name6
             // 
@@ -171,6 +172,7 @@
             this.si_name6.Name = "si_name6";
             this.si_name6.Size = new System.Drawing.Size(65, 21);
             this.si_name6.TabIndex = 8;
+            this.si_name6.Tag = "OutBox";
             // 
             // si_name5
             // 
@@ -179,6 +181,7 @@
             this.si_name5.Name = "si_name5";
             this.si_name5.Size = new System.Drawing.Size(65, 21);
             this.si_name5.TabIndex = 9;
+            this.si_name5.Tag = "LotNo";
             // 
             // si_name4
             // 
@@ -187,6 +190,7 @@
             this.si_name4.Name = "si_name4";
             this.si_name4.Size = new System.Drawing.Size(65, 21);
             this.si_name4.TabIndex = 10;
+            this.si_name4.Tag = "DateCode";
             // 
             // si_name3
             // 
@@ -195,6 +199,7 @@
             this.si_name3.Name = "si_name3";
             this.si_name3.Size = new System.Drawing.Size(65, 21);
             this.si_name3.TabIndex = 11;
+            this.si_name3.Tag = "QTY";
             // 
             // si_name2
             // 
@@ -203,6 +208,7 @@
             this.si_name2.Name = "si_name2";
             this.si_name2.Size = new System.Drawing.Size(65, 21);
             this.si_name2.TabIndex = 12;
+            this.si_name2.Tag = "PN";
             // 
             // OrderName_label
             // 
@@ -331,6 +337,7 @@
             this.si_remark2.Name = "si_remark2";
             this.si_remark2.Size = new System.Drawing.Size(195, 21);
             this.si_remark2.TabIndex = 30;
+            this.si_remark2.Tag = "PN";
             // 
             // si_remark3
             // 
@@ -339,6 +346,7 @@
             this.si_remark3.Name = "si_remark3";
             this.si_remark3.Size = new System.Drawing.Size(195, 21);
             this.si_remark3.TabIndex = 29;
+            this.si_remark3.Tag = "QTY";
             // 
             // si_remark4
             // 
@@ -347,6 +355,7 @@
             this.si_remark4.Name = "si_remark4";
             this.si_remark4.Size = new System.Drawing.Size(195, 21);
             this.si_remark4.TabIndex = 28;
+            this.si_remark4.Tag = "DateCode";
             // 
             // si_remark5
             // 
@@ -355,6 +364,7 @@
             this.si_remark5.Name = "si_remark5";
             this.si_remark5.Size = new System.Drawing.Size(195, 21);
             this.si_remark5.TabIndex = 27;
+            this.si_remark5.Tag = "LotNo";
             // 
             // si_remark6
             // 
@@ -363,6 +373,7 @@
             this.si_remark6.Name = "si_remark6";
             this.si_remark6.Size = new System.Drawing.Size(195, 21);
             this.si_remark6.TabIndex = 26;
+            this.si_remark6.Tag = "OutBox";
             // 
             // si_remark1
             // 
@@ -371,6 +382,7 @@
             this.si_remark1.Name = "si_remark1";
             this.si_remark1.Size = new System.Drawing.Size(195, 21);
             this.si_remark1.TabIndex = 25;
+            this.si_remark1.Tag = "Order";
             // 
             // label13
             // 
@@ -452,7 +464,7 @@
             // 
             this.CustomerTreeView.Location = new System.Drawing.Point(0, 24);
             this.CustomerTreeView.Name = "CustomerTreeView";
-            this.CustomerTreeView.Size = new System.Drawing.Size(251, 610);
+            this.CustomerTreeView.Size = new System.Drawing.Size(251, 605);
             this.CustomerTreeView.TabIndex = 0;
             this.CustomerTreeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.CustomerTreeView_NodeMouseClick);
             // 
@@ -492,6 +504,7 @@
             this.si_expression4.Name = "si_expression4";
             this.si_expression4.Size = new System.Drawing.Size(438, 79);
             this.si_expression4.TabIndex = 36;
+            this.si_expression4.Tag = "DateCode";
             this.si_expression4.Text = "";
             // 
             // si_expression3
@@ -501,6 +514,7 @@
             this.si_expression3.Name = "si_expression3";
             this.si_expression3.Size = new System.Drawing.Size(438, 79);
             this.si_expression3.TabIndex = 34;
+            this.si_expression3.Tag = "QTY";
             this.si_expression3.Text = "";
             // 
             // sg_script
@@ -526,7 +540,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1082, 634);
+            this.ClientSize = new System.Drawing.Size(962, 630);
             this.Controls.Add(this.AddNew);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.Brand);

+ 12 - 5
UAS-出货标签管理(吉利通)/采集策略_NEW.cs

@@ -81,11 +81,18 @@ namespace UAS_LabelMachine
                 {
                     for (int i = 0; i < 6; i++)
                     {
-                        (Controls["si_item" + (i + 1)] as CheckBox).Checked = dt.Rows[i]["si_enable"].ToString() == "-1" ? true : false;
-                        Controls["si_name" + (i + 1)].Text = dt.Rows[i]["si_name"].ToString();
-                        Controls["si_remark" + (i + 1)].Text = dt.Rows[i]["si_remark"].ToString();
-                        if (Controls["si_expression" + (i + 1)] != null)
-                            Controls["si_expression" + (i + 1)].Text = dt.Rows[i]["si_expression"].ToString();
+                        for (int j = 0; j < dt.Rows.Count; j++)
+                        {
+                            if (Controls["si_name" + (i + 1)].Tag.ToString() == dt.Rows[j]["si_item"].ToString())
+                            {
+                                (Controls["si_item" + (i + 1)] as CheckBox).Checked = dt.Rows[j]["si_enable"].ToString() == "-1" ? true : false;
+                                Controls["si_name" + (i + 1)].Text = dt.Rows[j]["si_name"].ToString();
+                                Controls["si_remark" + (i + 1)].Text = dt.Rows[j]["si_remark"].ToString();
+                                if (Controls["si_expression" + (i + 1)] != null)
+                                    Controls["si_expression" + (i + 1)].Text = dt.Rows[j]["si_expression"].ToString();
+                                continue;
+                            }
+                        }
                     }
                 }
             }

+ 2 - 2
UAS-出货标签管理(吉利通)/采集策略_NEW.resx

@@ -118,7 +118,7 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
-  <data name="AddNew.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="ButtonSaveScanGroup.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
         877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
@@ -130,7 +130,7 @@
         48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
 </value>
   </data>
-  <data name="ButtonSaveScanGroup.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+  <data name="AddNew.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
         877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF

Some files were not shown because too many files changed in this diff