瀏覽代碼

汇总型号和品牌数据

callm 1 年之前
父節點
當前提交
821edf06a5

+ 14 - 4
UAS_BARCODEIO/LogicHandler.cs

@@ -27,7 +27,7 @@ namespace UAS_BARCODEIO
         /// <param name="iFileName"></param>
         /// <param name="iLineCode"></param>
         /// <param name="iCombine"></param>
-    
+
 
         /// <summary>
         /// 判断工单是否已经下放
@@ -60,6 +60,16 @@ namespace UAS_BARCODEIO
             SerialNum = param[2];
         }
 
+        public static void GetWeekData(string iWeek, string iQTY, string iBrand, out string madedate, out string inqty)
+        {
+            madedate = "";
+            inqty = "";
+            string[] param = new string[] { iWeek, iQTY, iBrand, madedate, inqty };
+            dh.CallProcedure("SP_WEEKTODATE", ref param);
+            madedate = param[3];
+            inqty = param[4];
+        }
+
         /// <summary>
         /// 验证用户身份信息
         /// </summary>
@@ -180,7 +190,7 @@ namespace UAS_BARCODEIO
             dh.ExecuteSql(sql.ToString(), "insert", iCaller, iUserCode, iLineCode, iSourceCode, iMakeCode, iOperate, iResult, iSncode, iCheckno);
         }
 
-      
+
 
         /// <summary>
         /// 获取送检批次,根据不同的iOQCStep执行不同的操作,查询到有具体的信息时返回Form和Detail的两个DataTable
@@ -418,7 +428,7 @@ namespace UAS_BARCODEIO
                 return false;
         }
 
-     
+
 
         /// <summary>
         /// 记录操作日志
@@ -865,7 +875,7 @@ namespace UAS_BARCODEIO
                                 if (iSN.Length > index1)
                                 {
                                     //先截取长度
-                                    if (pres[i] == "" ? true : iSN.Substring(index1-1).StartsWith(str))
+                                    if (pres[i] == "" ? true : iSN.Substring(index1 - 1).StartsWith(str))
                                     {
                                         //满足其中一条即可
                                         f = true;

+ 4 - 0
UAS_BARCODEIO/UAS_BARCODEIO.csproj

@@ -61,6 +61,10 @@
       <EmbedInteropTypes>True</EmbedInteropTypes>
       <HintPath>..\UAS_MES_LT\Tool\Interop.BarTender.dll</HintPath>
     </Reference>
+    <Reference Include="Interop.LabelManager2">
+      <HintPath>tool\Interop.LabelManager2.dll</HintPath>
+      <EmbedInteropTypes>False</EmbedInteropTypes>
+    </Reference>
     <Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
       <HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net40\Newtonsoft.Json.dll</HintPath>
       <Private>True</Private>

二進制
UAS_BARCODEIO/tool/Interop.LabelManager2.dll


+ 90 - 57
UAS_BARCODEIO/入库条码规则解析.Designer.cs

@@ -32,11 +32,6 @@
             this.pi_inoutno = new System.Windows.Forms.TextBox();
             this.label1 = new System.Windows.Forms.Label();
             this.Prodiodetail = new System.Windows.Forms.DataGridView();
-            this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.bi_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.PR_CODE = new System.Windows.Forms.TextBox();
             this.label3 = new System.Windows.Forms.Label();
             this.INQTY = new System.Windows.Forms.TextBox();
@@ -52,6 +47,7 @@
             this.GenBarCode = new System.Windows.Forms.Button();
             this.BarcodeIO = new System.Windows.Forms.DataGridView();
             this.CheckBox = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_inqty1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -64,6 +60,13 @@
             this.label9 = new System.Windows.Forms.Label();
             this.es_custcode = new UAS_BARCODEIO.SearchTextBox();
             this.ChooseAll = new System.Windows.Forms.Button();
+            this.pd_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_orispeccode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.bi_inqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.Prodiodetail)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.BarcodeIO)).BeginInit();
             this.SuspendLayout();
@@ -105,6 +108,8 @@
             this.Prodiodetail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.Prodiodetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.pd_prodcode,
+            this.pr_orispeccode1,
+            this.pr_brand,
             this.pr_detail,
             this.pr_spec,
             this.pd_inqty,
@@ -120,51 +125,6 @@
             this.Prodiodetail.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.Prodiodetail_CellPainting);
             this.Prodiodetail.SelectionChanged += new System.EventHandler(this.Prodiodetail_SelectionChanged);
             // 
-            // pd_prodcode
-            // 
-            this.pd_prodcode.DataPropertyName = "pd_prodcode";
-            this.pd_prodcode.HeaderText = "物料编号";
-            this.pd_prodcode.MinimumWidth = 10;
-            this.pd_prodcode.Name = "pd_prodcode";
-            this.pd_prodcode.ReadOnly = true;
-            this.pd_prodcode.Width = 200;
-            // 
-            // pr_detail
-            // 
-            this.pr_detail.DataPropertyName = "pr_detail";
-            this.pr_detail.HeaderText = "物料名称";
-            this.pr_detail.MinimumWidth = 10;
-            this.pr_detail.Name = "pr_detail";
-            this.pr_detail.ReadOnly = true;
-            this.pr_detail.Width = 200;
-            // 
-            // pr_spec
-            // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "物料规格";
-            this.pr_spec.MinimumWidth = 10;
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.ReadOnly = true;
-            this.pr_spec.Width = 200;
-            // 
-            // pd_inqty
-            // 
-            this.pd_inqty.DataPropertyName = "pd_inqty";
-            this.pd_inqty.HeaderText = "入库数量";
-            this.pd_inqty.MinimumWidth = 10;
-            this.pd_inqty.Name = "pd_inqty";
-            this.pd_inqty.ReadOnly = true;
-            this.pd_inqty.Width = 200;
-            // 
-            // bi_inqty
-            // 
-            this.bi_inqty.DataPropertyName = "bi_inqty";
-            this.bi_inqty.HeaderText = "已生成条码数量";
-            this.bi_inqty.MinimumWidth = 10;
-            this.bi_inqty.Name = "bi_inqty";
-            this.bi_inqty.ReadOnly = true;
-            this.bi_inqty.Width = 200;
-            // 
             // PR_CODE
             // 
             this.PR_CODE.Location = new System.Drawing.Point(168, 771);
@@ -298,6 +258,7 @@
             this.BarcodeIO.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.BarcodeIO.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.CheckBox,
+            this.pr_orispeccode,
             this.bi_prodcode,
             this.bi_barcode,
             this.bi_inqty1,
@@ -320,6 +281,14 @@
             this.CheckBox.Name = "CheckBox";
             this.CheckBox.Width = 200;
             // 
+            // pr_orispeccode
+            // 
+            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode.HeaderText = "型号";
+            this.pr_orispeccode.MinimumWidth = 10;
+            this.pr_orispeccode.Name = "pr_orispeccode";
+            this.pr_orispeccode.Width = 200;
+            // 
             // bi_prodcode
             // 
             this.bi_prodcode.DataPropertyName = "bi_prodcode";
@@ -433,6 +402,67 @@
             this.ChooseAll.UseVisualStyleBackColor = true;
             this.ChooseAll.Click += new System.EventHandler(this.ChooseAll_Click);
             // 
+            // pd_prodcode
+            // 
+            this.pd_prodcode.DataPropertyName = "pd_prodcode";
+            this.pd_prodcode.HeaderText = "物料编号";
+            this.pd_prodcode.MinimumWidth = 10;
+            this.pd_prodcode.Name = "pd_prodcode";
+            this.pd_prodcode.ReadOnly = true;
+            this.pd_prodcode.Width = 200;
+            // 
+            // pr_orispeccode1
+            // 
+            this.pr_orispeccode1.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode1.HeaderText = "原厂型号";
+            this.pr_orispeccode1.MinimumWidth = 10;
+            this.pr_orispeccode1.Name = "pr_orispeccode1";
+            this.pr_orispeccode1.Width = 200;
+            // 
+            // pr_brand
+            // 
+            this.pr_brand.DataPropertyName = "pr_brand";
+            this.pr_brand.HeaderText = "品牌";
+            this.pr_brand.MinimumWidth = 10;
+            this.pr_brand.Name = "pr_brand";
+            this.pr_brand.Width = 200;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.DataPropertyName = "pr_detail";
+            this.pr_detail.HeaderText = "物料名称";
+            this.pr_detail.MinimumWidth = 10;
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.ReadOnly = true;
+            this.pr_detail.Width = 200;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "物料规格";
+            this.pr_spec.MinimumWidth = 10;
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.ReadOnly = true;
+            this.pr_spec.Width = 200;
+            // 
+            // pd_inqty
+            // 
+            this.pd_inqty.DataPropertyName = "pd_inqty";
+            this.pd_inqty.HeaderText = "入库数量";
+            this.pd_inqty.MinimumWidth = 10;
+            this.pd_inqty.Name = "pd_inqty";
+            this.pd_inqty.ReadOnly = true;
+            this.pd_inqty.Width = 200;
+            // 
+            // bi_inqty
+            // 
+            this.bi_inqty.DataPropertyName = "bi_inqty";
+            this.bi_inqty.HeaderText = "已生成条码数量";
+            this.bi_inqty.MinimumWidth = 10;
+            this.bi_inqty.Name = "bi_inqty";
+            this.bi_inqty.ReadOnly = true;
+            this.bi_inqty.Width = 200;
+            // 
             // 入库条码规则解析
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@@ -493,16 +523,14 @@
         private SearchTextBox es_custcode;
         private System.Windows.Forms.TextBox Barcode;
         private System.Windows.Forms.Label label8;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pd_inqty;
-        private System.Windows.Forms.DataGridViewTextBoxColumn bi_inqty;
         private System.Windows.Forms.Button GenBarCode;
         private System.Windows.Forms.DataGridView BarcodeIO;
         private System.Windows.Forms.Button PrintBarCode;
         private System.Windows.Forms.ComboBox PrinterList;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Button ChooseAll;
         private System.Windows.Forms.DataGridViewCheckBoxColumn CheckBox;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_prodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_inqty1;
@@ -510,8 +538,13 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_madedate;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail1;
-        private System.Windows.Forms.Label label9;
-        private System.Windows.Forms.Button ChooseAll;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_brand;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_inqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn bi_inqty;
     }
 }
 

+ 49 - 35
UAS_BARCODEIO/入库条码规则解析.cs

@@ -1,4 +1,5 @@
-using Seagull.BarTender.Print;
+using LabelManager2;
+using Seagull.BarTender.Print;
 using System;
 using System.Collections.Generic;
 using System.Data;
@@ -11,14 +12,17 @@ namespace UAS_BARCODEIO
     public partial class 入库条码规则解析 : Form
     {
 
+        ApplicationClass lbl;
+
         DataHelper dh = new DataHelper();
 
+        Document SingleDoc;
+
         DataTable Dbfind;
 
         //自适应屏幕
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
-        Engine engine;
 
         public 入库条码规则解析()
         {
@@ -43,11 +47,10 @@ namespace UAS_BARCODEIO
             }
         }
 
-        static LabelFormatDocument format;
 
         private void Form1_Load(object sender, EventArgs e)
         {
-            es_custcode.TableName = "CS_EXPORTSETTING   ";
+            es_custcode.TableName = "CS_EXPORTSETTING ";
             es_custcode.SelectField = "es_custcode # 品牌";
             es_custcode.FormName = Name;
             es_custcode.DBTitle = "解析规则查询";
@@ -57,7 +60,7 @@ namespace UAS_BARCODEIO
             SystemInf.dh = dh;
             try
             {
-                engine = new Engine(true);
+                lbl = new ApplicationClass();
             }
             catch (Exception ex)
             {
@@ -65,7 +68,7 @@ namespace UAS_BARCODEIO
                 throw;
             }
 
-            format = engine.Documents.Open(Application.StartupPath + @"\BARCODE.btw");
+            SingleDoc = lbl.Documents.Open(System.Windows.Forms.Application.StartupPath + @"\BARCODE.lab");
             asc.controllInitializeSize(this);
             asc.controlAutoSize(this);
 
@@ -96,10 +99,10 @@ namespace UAS_BARCODEIO
 
         private void LoadGridData()
         {
-            string sql = "select pd_inqty,pd_prodcode,pr_detail,pr_spec,bi_inqty from " +
-                "(select pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail where pd_inoutno='" + pi_inoutno.Text + "' group by pd_prodcode)" +
-                " left join (select bi_prodcode,nvl(sum(bi_inqty),0)bi_inqty from barcodeio " +
-                "where bi_inoutno='" + pi_inoutno.Text + "' group by bi_prodcode) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode order by pr_code";
+            string sql = "select pd_inqty,pd_prodcode,pr_detail,pr_orispeccode,pr_spec,bi_inqty,pr_brand from " +
+                "(select max(pd_prodcode)pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail left join product on pd_prodcode=pr_code where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode)" +
+                " left join (select max(bi_prodcode)bi_prodcode,nvl(sum(bi_inqty),0)bi_inqty from barcodeio left join product on pr_code=bi_prodcode" +
+                "where bi_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode order by pr_code";
             DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
             BaseUtil.FillDgvWithDataTable(Prodiodetail, dt);
         }
@@ -145,6 +148,11 @@ namespace UAS_BARCODEIO
                             break;
                     }
                 }
+                string madedate;
+                string outqty;
+                LogicHandler.GetWeekData(DC.Text, INQTY.Text, es_custcode.Text.ToUpper(), out madedate, out outqty);
+                DC.Text = madedate;
+                INQTY.Text = outqty;
             }
         }
         bool AutoSized = false;
@@ -194,9 +202,9 @@ namespace UAS_BARCODEIO
         private void GenBarCode_Click(object sender, EventArgs e)
         {
             string sql = "select pr_zxbzs,pd_piid,pd_piclass,pd_inqty,pd_prodcode,pr_detail,pr_spec,nvl(bi_inqty,0)bi_inqty from " +
-               "(select max(pd_piid)pd_piid,max(pd_piclass)pd_piclass,pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail where pd_inoutno='" + pi_inoutno.Text + "' group by pd_prodcode)" +
-               " left join (select bi_prodcode,nvl(sum(bi_inqty),0)bi_inqty from barcodeio " +
-               "where bi_inoutno='" + pi_inoutno.Text + "' group by bi_prodcode) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode " +
+               "(select max(pd_piid)pd_piid,max(pd_piclass)pd_piclass,max(pd_prodcode)pd_prodcode,sum(pd_inqty)pd_inqty from prodiodetail left join product on pr_code=pd_prodcode where pd_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode)" +
+               " left join (select max(bi_prodcode)bi_prodcode,nvl(sum(bi_inqty),0)bi_inqty from barcodeio left join product on pr_code=bi_prodcode " +
+               "where bi_inoutno='" + pi_inoutno.Text + "' group by pr_orispeccode) on pd_prodcode=bi_prodcode left join product on pr_code=pd_prodcode " +
                "where pd_prodcode='" + PR_CODE.Text + "'";
             DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
             if (dt.Rows.Count == 0)
@@ -228,7 +236,6 @@ namespace UAS_BARCODEIO
             List<string> bi_barcode = new List<string>();
             List<string> bi_vendbarcode = new List<string>();
             List<string> bi_madedate = new List<string>();
-            string datecode = dh.getFieldDataByCondition("dual", "WEEK_TO_DATE('" + DC.Text + "')", "1=1").ToString();
             for (int i = 0; i < barcount; i++)
             {
                 string barcode = "";
@@ -256,7 +263,7 @@ namespace UAS_BARCODEIO
                 bi_inqty.Add(OneUnit.ToString());
                 bi_barcode.Add(barcode);
                 bi_vendbarcode.Add(LOTNO.Text);
-                bi_madedate.Add(datecode);
+                bi_madedate.Add(DC.Text);
             }
             sql = "insert into barcodeio(BI_ID, BI_BARCODE, BI_PIID, BI_PICLASS, BI_INOUTNO, BI_PDNO, BI_PDID, BI_PRODCODE, BI_INQTY,bi_vendbarcode, " +
                  "BI_MADEDATE, BI_PRODID, BI_STATUS, BI_ORDERCODE, BI_INMAN, BI_INDATE)select barcodeio_seq.nextval,:bi_barcode,'" + pi_id + "'," +
@@ -269,7 +276,7 @@ namespace UAS_BARCODEIO
 
         private void LoadBarcodeioData(string pr_code)
         {
-            string sql = "select 0 CheckBox,bi_barcode,bi_inqty,bi_datecode,bi_vendbarcode,to_char(bi_madedate,'yyyy-mm-dd')bi_madedate,pr_detail,pr_spec,bi_prodcode from barcodeio left join product on bi_prodcode=pr_code where bi_inoutno='" + pi_inoutno.Text + "' and bi_prodcode='" + pr_code + "'";
+            string sql = "select 0 CheckBox,bi_barcode,bi_inqty,bi_datecode,bi_vendbarcode,to_char(bi_madedate,'yyyy-mm-dd')bi_madedate,pr_detail,pr_spec,bi_prodcode,pr_orispeccode from barcodeio left join product on bi_prodcode=pr_code where bi_inoutno='" + pi_inoutno.Text + "' and bi_prodcode='" + pr_code + "'";
             DataTable dt = (DataTable)dh.ExecuteSql(sql, "select");
             BaseUtil.FillDgvWithDataTable(BarcodeIO, dt);
         }
@@ -280,47 +287,51 @@ namespace UAS_BARCODEIO
             {
                 if (BarcodeIO.Rows[i].Cells["CheckBox"].FormattedValue != null && BarcodeIO.Rows[i].Cells["CheckBox"].FormattedValue.ToString() == "True")
                 {
-                    for (int j = 0; j < format.SubStrings.Count; j++)
+                    for (int j = 0; j < SingleDoc.Variables.FreeVariables.Count; j++)
                     {
-                        if (format.SubStrings[j].Name == "BARCODE")
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "BARCODE")
+                        {
+                            if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["bi_barcode"].Value.ToString();
+                        }
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "DC")
                         {
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
-                                format.SubStrings[j].Value = BarcodeIO.Rows[i].Cells["bi_barcode"].Value.ToString();
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["bi_madedate"].Value.ToString();
                         }
-                        if (format.SubStrings[j].Name == "DC")
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "LOTNO")
                         {
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
-                                format.SubStrings[j].Value = BarcodeIO.Rows[i].Cells["bi_madedate"].Value.ToString();
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["bi_vendbarcode"].Value.ToString();
                         }
-                        if (format.SubStrings[j].Name == "LOTNO")
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "QTY")
                         {
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
-                                format.SubStrings[j].Value = BarcodeIO.Rows[i].Cells["bi_vendbarcode"].Value.ToString();
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["bi_inqty1"].Value.ToString();
                         }
-                        if (format.SubStrings[j].Name == "QTY")
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "PRCODE")
                         {
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
-                                format.SubStrings[j].Value = BarcodeIO.Rows[i].Cells["bi_inqty1"].Value.ToString();
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["bi_prodcode"].Value.ToString();
                         }
-                        if (format.SubStrings[j].Name == "PRCODE")
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "PRSPEC")
                         {
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
-                                format.SubStrings[j].Value = BarcodeIO.Rows[i].Cells["bi_prodcode"].Value.ToString();
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["pr_spec1"].Value.ToString();
                         }
-                        if (format.SubStrings[j].Name == "PRSPEC")
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "PRDETAIL")
                         {
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
-                                format.SubStrings[j].Value = BarcodeIO.Rows[i].Cells["pr_spec1"].Value.ToString();
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["pr_detail1"].Value.ToString();
                         }
-                        if (format.SubStrings[j].Name == "PRDETAIL")
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "ORISPEC")
                         {
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
-                                format.SubStrings[j].Value = BarcodeIO.Rows[i].Cells["pr_detail1"].Value.ToString();
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["pr_orispeccode"].Value.ToString();
                         }
                     }
-                    format.PrintSetup.PrinterName = PrinterList.Text;
-                    format.PrintSetup.IdenticalCopiesOfLabel = 1;
-                    format.Print();
+                    SingleDoc.Printer.SwitchTo(PrinterList.Text);
+                    SingleDoc.PrintDocument();
                 }
             }
         }
@@ -329,7 +340,7 @@ namespace UAS_BARCODEIO
         {
             if (Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString() != "")
             {
-                LoadBarcodeioData(Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString());
+
             }
         }
 
@@ -338,6 +349,9 @@ namespace UAS_BARCODEIO
             if (Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString() != "")
             {
                 LoadBarcodeioData(Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString());
+                Console.WriteLine(Prodiodetail.Rows[e.RowIndex].Cells["pr_brand"].Value.ToString());
+                es_custcode.Text = Prodiodetail.Rows[e.RowIndex].Cells["pr_brand"].Value.ToString();
+                LoadBarcodeioData(Prodiodetail.Rows[e.RowIndex].Cells["pd_prodcode"].Value.ToString());
             }
         }
 

+ 3 - 33
UAS_BARCODEIO/入库条码规则解析.resx

@@ -120,19 +120,10 @@
   <metadata name="pd_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_orispeccode1.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">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_inqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bi_inqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_brand.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
@@ -150,28 +141,7 @@
   <metadata name="CheckBox.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="bi_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bi_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bi_inqty1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bi_vendbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="bi_madedate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_spec1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_detail1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="CheckBox.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pr_orispeccode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="bi_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">