callm пре 3 месеци
родитељ
комит
dedb620ac3

+ 6 - 6
UAS_BARCODEIO/DataHelper.cs

@@ -9,13 +9,13 @@ namespace UAS_BARCODEIO
     public class DataHelper
     {
         //系统默认的的连接字符串
-        //private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=SENGWILL;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sengwill.hicp.net)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////用户选择的数据库的连接字符串
-        //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=SENGWILL;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sengwill.hicp.net)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-
-        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11702)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=SENGWILL;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=erp.baixiangic.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
         //用户选择的数据库的连接字符串
-        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11702)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=SENGWILL;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=erp.baixiangic.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+
+        //private string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11702)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        ////用户选择的数据库的连接字符串
+        //public static string DBConnectionString = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=N_MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.1.81.208)(PORT=11702)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
 
         public static OracleConnection connection = null;
         OracleCommand command = null;

+ 1 - 1
UAS_BARCODEIO/Program.cs

@@ -29,7 +29,7 @@ namespace UAS_BARCODEIO
             //如果是管理员的身份
             if (principal.IsInRole(WindowsBuiltInRole.Administrator))
             {
-                Application.Run(new 极测_出货清单打印());
+                Application.Run(new 入库条码规则解析());
             }
             else
             {

+ 44 - 8
UAS_BARCODEIO/入库条码规则解析.Designer.cs

@@ -68,6 +68,8 @@
             this.DeletaBarcode = new System.Windows.Forms.Button();
             this.SCCODE = new System.Windows.Forms.TextBox();
             this.label11 = new System.Windows.Forms.Label();
+            this.DC1 = new System.Windows.Forms.TextBox();
+            this.label12 = new System.Windows.Forms.Label();
             this.CheckBox = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -77,6 +79,7 @@
             this.bi_sccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_vendbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.bi_madedate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.DC_WEEK = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_spec1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_detail1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.Prodiodetail)).BeginInit();
@@ -220,7 +223,7 @@
             // 
             // INQTY
             // 
-            this.INQTY.Location = new System.Drawing.Point(1445, 403);
+            this.INQTY.Location = new System.Drawing.Point(1445, 360);
             this.INQTY.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.INQTY.Name = "INQTY";
             this.INQTY.Size = new System.Drawing.Size(436, 35);
@@ -230,7 +233,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(1276, 403);
+            this.label4.Location = new System.Drawing.Point(1276, 360);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(133, 38);
@@ -239,7 +242,7 @@
             // 
             // DC
             // 
-            this.DC.Location = new System.Drawing.Point(1445, 470);
+            this.DC.Location = new System.Drawing.Point(1445, 413);
             this.DC.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.DC.Name = "DC";
             this.DC.Size = new System.Drawing.Size(436, 35);
@@ -249,7 +252,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(1276, 470);
+            this.label5.Location = new System.Drawing.Point(1276, 413);
             this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(58, 38);
@@ -340,6 +343,7 @@
             this.bi_sccode,
             this.bi_vendbarcode,
             this.bi_madedate,
+            this.DC_WEEK,
             this.pr_spec1,
             this.pr_detail1});
             this.BarcodeIO.Location = new System.Drawing.Point(27, 731);
@@ -391,7 +395,7 @@
             // pr_orispeccode2
             // 
             this.pr_orispeccode2.Enabled = false;
-            this.pr_orispeccode2.Location = new System.Drawing.Point(1445, 258);
+            this.pr_orispeccode2.Location = new System.Drawing.Point(1445, 246);
             this.pr_orispeccode2.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pr_orispeccode2.Name = "pr_orispeccode2";
             this.pr_orispeccode2.Size = new System.Drawing.Size(436, 35);
@@ -401,7 +405,7 @@
             // 
             this.原厂型号.AutoSize = true;
             this.原厂型号.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.原厂型号.Location = new System.Drawing.Point(1276, 258);
+            this.原厂型号.Location = new System.Drawing.Point(1276, 246);
             this.原厂型号.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.原厂型号.Name = "原厂型号";
             this.原厂型号.Size = new System.Drawing.Size(133, 38);
@@ -430,7 +434,7 @@
             // 
             // pr_orispeccode3
             // 
-            this.pr_orispeccode3.Location = new System.Drawing.Point(1445, 334);
+            this.pr_orispeccode3.Location = new System.Drawing.Point(1445, 303);
             this.pr_orispeccode3.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.pr_orispeccode3.Name = "pr_orispeccode3";
             this.pr_orispeccode3.Size = new System.Drawing.Size(436, 35);
@@ -440,7 +444,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(1276, 334);
+            this.label10.Location = new System.Drawing.Point(1276, 303);
             this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(133, 38);
@@ -504,6 +508,25 @@
             this.label11.TabIndex = 48;
             this.label11.Text = "SCCODE";
             // 
+            // DC1
+            // 
+            this.DC1.Location = new System.Drawing.Point(1445, 469);
+            this.DC1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.DC1.Name = "DC1";
+            this.DC1.Size = new System.Drawing.Size(436, 35);
+            this.DC1.TabIndex = 51;
+            // 
+            // label12
+            // 
+            this.label12.AutoSize = true;
+            this.label12.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label12.Location = new System.Drawing.Point(1276, 469);
+            this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label12.Name = "label12";
+            this.label12.Size = new System.Drawing.Size(136, 38);
+            this.label12.TabIndex = 50;
+            this.label12.Text = "DC(年周)";
+            // 
             // CheckBox
             // 
             this.CheckBox.DataPropertyName = "CheckBox";
@@ -576,6 +599,14 @@
             this.bi_madedate.Name = "bi_madedate";
             this.bi_madedate.Width = 200;
             // 
+            // DC_WEEK
+            // 
+            this.DC_WEEK.DataPropertyName = "dc_week";
+            this.DC_WEEK.HeaderText = "年周";
+            this.DC_WEEK.MinimumWidth = 10;
+            this.DC_WEEK.Name = "DC_WEEK";
+            this.DC_WEEK.Width = 200;
+            // 
             // pr_spec1
             // 
             this.pr_spec1.DataPropertyName = "pr_spec";
@@ -597,6 +628,8 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(2136, 1338);
+            this.Controls.Add(this.DC1);
+            this.Controls.Add(this.label12);
             this.Controls.Add(this.SCCODE);
             this.Controls.Add(this.label11);
             this.Controls.Add(this.DeletaBarcode);
@@ -685,6 +718,8 @@
         private System.Windows.Forms.Button DeletaBarcode;
         private System.Windows.Forms.TextBox SCCODE;
         private System.Windows.Forms.Label label11;
+        private System.Windows.Forms.TextBox DC1;
+        private System.Windows.Forms.Label label12;
         private System.Windows.Forms.DataGridViewCheckBoxColumn CheckBox;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_prodcode;
@@ -694,6 +729,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_sccode;
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_vendbarcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn bi_madedate;
+        private System.Windows.Forms.DataGridViewTextBoxColumn DC_WEEK;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail1;
     }

+ 14 - 3
UAS_BARCODEIO/入库条码规则解析.cs

@@ -168,6 +168,7 @@ namespace UAS_BARCODEIO
                 string outqty;
                 string lotno;
                 string spec;
+                DC1.Text = DC.Text;
                 LogicHandler.GetWeekData(DC.Text, INQTY.Text, es_custcode.Text.ToUpper(), pr_orispeccode3.Text, LOTNO.Text, out madedate, out outqty, out lotno, out spec);
                 DC.Text = madedate;
                 INQTY.Text = outqty;
@@ -306,8 +307,8 @@ namespace UAS_BARCODEIO
                 bi_madedate.Add(DC.Text);
                 bi_sccode.Add(SCCODE.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,BI_OUTBOXCODE,bi_sccode)select barcodeio_seq.nextval,:bi_barcode,'" + pi_id + "'," +
+            sql = "insert into barcodeio(BI_ID,bi_made, 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,BI_OUTBOXCODE,bi_sccode)select barcodeio_seq.nextval,'"+ DC1.Text + "',:bi_barcode,'" + pi_id + "'," +
                  "'" + pd_piclass + "','" + pi_inoutno.Text + "',0,0,'" + PR_CODE.Text + "',:bi_inqty,:bi_vendbarcode,to_date(:bi_madedate,'yyyy-mm-dd'),pr_id,0,'','管理员',sysdate,'" + outboxcode + "',:bi_sccode " +
                  " from product where pr_code='" + PR_CODE.Text + "'";
             dh.BatchInsert(sql, new string[] { "bi_inqty", "bi_barcode", "bi_vendbarcode", "bi_madedate" , "bi_sccode" }, bi_barcode.ToArray(), bi_inqty.ToArray(), bi_vendbarcode.ToArray(), bi_madedate.ToArray(),bi_sccode.ToArray());
@@ -317,7 +318,7 @@ namespace UAS_BARCODEIO
 
         private void LoadBarcodeioData(string pr_code)
         {
-            string sql = "select 0 CheckBox,bi_sccode,bi_barcode,bi_inqty,bi_datecode,bi_outboxcode,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 + "'";
+            string sql = "select 0 CheckBox,bi_sccode,bi_barcode,bi_inqty,bi_datecode,bi_outboxcode,bi_vendbarcode,to_char(bi_madedate,'yyyy-mm-dd')bi_madedate,to_char(bi_madedate,'yyiw')dc_week,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);
         }
@@ -370,6 +371,11 @@ namespace UAS_BARCODEIO
                             if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
                                 SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["pr_orispeccode"].Value.ToString();
                         }
+                        if (SingleDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "DC_WEEK")
+                        {
+                            if (BarcodeIO.Rows[i].Cells["dc_week"].Value != null)
+                                SingleDoc.Variables.FreeVariables.Item(j + 1).Value = BarcodeIO.Rows[i].Cells["dc_week"].Value.ToString();
+                        }
                     }
                     SingleDoc.Printer.SwitchTo(PrinterList.Text);
                     SingleDoc.PrintDocument();
@@ -468,6 +474,11 @@ namespace UAS_BARCODEIO
                         if (BarcodeIO.Rows[i].Cells["bi_madedate"].Value != null)
                             OutDoc.Variables.FreeVariables.Item(j + 1).Value = dt.Rows[0]["pr_orispeccode"].ToString();
                     }
+                    if (OutDoc.Variables.FreeVariables.Item(j + 1).Name.ToUpper() == "DC_WEEK")
+                    {
+                        if (BarcodeIO.Rows[i].Cells["dc_week"].Value != null)
+                            OutDoc.Variables.FreeVariables.Item(j + 1).Value = dt.Rows[0]["dc_week"].ToString();
+                    }
                 }
                 OutDoc.Printer.SwitchTo(PrinterList.Text);
                 OutDoc.PrintDocument();

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

@@ -165,6 +165,9 @@
   <metadata name="bi_madedate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="DC_WEEK.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>