Browse Source

修改内容提交

callm 2 years ago
parent
commit
805212de40

+ 50 - 50
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs

@@ -29,7 +29,7 @@
         private void InitializeComponent()
         {
             this.components = new System.ComponentModel.Container();
-            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+            System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UAS_出货标签打印));
             this.pi_inoutno_label = new System.Windows.Forms.Label();
             this.label24 = new System.Windows.Forms.Label();
@@ -80,6 +80,7 @@
             this.贴标机参数设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.贴标角度设置ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.断开贴标机ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.内部标签打印ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.MenuManage = new System.Windows.Forms.Button();
             this.Connect = new System.Windows.Forms.Button();
             this.MixPrCode = new System.Windows.Forms.CheckBox();
@@ -241,7 +242,6 @@
             this.OutboxCapacity = new System.Windows.Forms.NumericUpDown();
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.内部标签打印ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.ShowMenu_Total.SuspendLayout();
@@ -656,7 +656,7 @@
             this.断开贴标机ToolStripMenuItem,
             this.内部标签打印ToolStripMenuItem});
             this.ShowMenu_Total.Name = "ShowMenu";
-            this.ShowMenu_Total.Size = new System.Drawing.Size(257, 480);
+            this.ShowMenu_Total.Size = new System.Drawing.Size(257, 436);
             this.ShowMenu_Total.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.ShowMenu_Total_ItemClicked);
             // 
             // 清除明细ToolStripMenuItem
@@ -725,6 +725,12 @@
             this.断开贴标机ToolStripMenuItem.Size = new System.Drawing.Size(256, 36);
             this.断开贴标机ToolStripMenuItem.Text = "断开贴标机";
             // 
+            // 内部标签打印ToolStripMenuItem
+            // 
+            this.内部标签打印ToolStripMenuItem.Name = "内部标签打印ToolStripMenuItem";
+            this.内部标签打印ToolStripMenuItem.Size = new System.Drawing.Size(256, 36);
+            this.内部标签打印ToolStripMenuItem.Text = "内部标签打印";
+            // 
             // MenuManage
             // 
             this.MenuManage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -1182,7 +1188,7 @@
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label15.Location = new System.Drawing.Point(21, 28);
+            this.label15.Location = new System.Drawing.Point(23, 30);
             this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label15.Name = "label15";
             this.label15.Size = new System.Drawing.Size(62, 31);
@@ -1252,7 +1258,7 @@
             this.Weight.AutoSize = true;
             this.Weight.Font = new System.Drawing.Font("微软雅黑", 25F);
             this.Weight.ForeColor = System.Drawing.Color.Red;
-            this.Weight.Location = new System.Drawing.Point(41, 94);
+            this.Weight.Location = new System.Drawing.Point(43, 96);
             this.Weight.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Weight.Name = "Weight";
             this.Weight.Size = new System.Drawing.Size(0, 88);
@@ -1294,14 +1300,14 @@
             this.pjd_zxbzs_user,
             this.pr_spec1,
             this.checknum});
-            dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 12.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.ControlDark;
-            dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.GridPrcode.DefaultCellStyle = dataGridViewCellStyle2;
+            dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle1.Font = new System.Drawing.Font("微软雅黑", 12.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.ControlDark;
+            dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.GridPrcode.DefaultCellStyle = dataGridViewCellStyle1;
             this.GridPrcode.GridColor = System.Drawing.SystemColors.Control;
             this.GridPrcode.Location = new System.Drawing.Point(0, 444);
             this.GridPrcode.Margin = new System.Windows.Forms.Padding(6);
@@ -1496,7 +1502,7 @@
             // 
             this.label18.AutoSize = true;
             this.label18.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label18.Location = new System.Drawing.Point(141, 257);
+            this.label18.Location = new System.Drawing.Point(143, 259);
             this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label18.Name = "label18";
             this.label18.Size = new System.Drawing.Size(24, 31);
@@ -1531,7 +1537,7 @@
             // 
             this.label16.AutoSize = true;
             this.label16.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label16.Location = new System.Drawing.Point(138, 130);
+            this.label16.Location = new System.Drawing.Point(140, 132);
             this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label16.Name = "label16";
             this.label16.Size = new System.Drawing.Size(24, 31);
@@ -1566,7 +1572,7 @@
             // 
             this.label12.AutoSize = true;
             this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label12.Location = new System.Drawing.Point(41, 205);
+            this.label12.Location = new System.Drawing.Point(43, 207);
             this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label12.Name = "label12";
             this.label12.Size = new System.Drawing.Size(110, 31);
@@ -1577,7 +1583,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(37, 81);
+            this.label7.Location = new System.Drawing.Point(39, 83);
             this.label7.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(110, 31);
@@ -1838,7 +1844,7 @@
             // 
             // pib_custbarcode
             // 
-            this.pib_custbarcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
+            this.pib_custbarcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
             this.pib_custbarcode.HeaderText = "料盘条码";
             this.pib_custbarcode.MinimumWidth = 160;
@@ -1848,7 +1854,7 @@
             // 
             // pib_custmidboxcode
             // 
-            this.pib_custmidboxcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
+            this.pib_custmidboxcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.pib_custmidboxcode.DataPropertyName = "pib_custmidboxcode";
             this.pib_custmidboxcode.HeaderText = "中盒条码";
             this.pib_custmidboxcode.MinimumWidth = 160;
@@ -1858,7 +1864,7 @@
             // 
             // pib_custoutboxcode
             // 
-            this.pib_custoutboxcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;
+            this.pib_custoutboxcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.pib_custoutboxcode.DataPropertyName = "pib_custoutboxcode";
             this.pib_custoutboxcode.HeaderText = "外箱条码";
             this.pib_custoutboxcode.MinimumWidth = 160;
@@ -1978,7 +1984,7 @@
             // 
             this.label14.AutoSize = true;
             this.label14.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label14.Location = new System.Drawing.Point(41, 301);
+            this.label14.Location = new System.Drawing.Point(43, 303);
             this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label14.Name = "label14";
             this.label14.Size = new System.Drawing.Size(155, 36);
@@ -1998,7 +2004,7 @@
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label13.Location = new System.Drawing.Point(41, 245);
+            this.label13.Location = new System.Drawing.Point(43, 247);
             this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(155, 36);
@@ -2028,7 +2034,7 @@
             // 
             this.SingleLabelPrint.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.SingleLabelPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelPrint.Location = new System.Drawing.Point(272, 361);
+            this.SingleLabelPrint.Location = new System.Drawing.Point(60, 354);
             this.SingleLabelPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelPrint.Name = "SingleLabelPrint";
             this.SingleLabelPrint.Size = new System.Drawing.Size(136, 52);
@@ -2041,7 +2047,7 @@
             // 
             this.SingleLabelAutoPrint.AutoSize = true;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(25, 191);
+            this.SingleLabelAutoPrint.Location = new System.Drawing.Point(27, 193);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.SingleLabelAutoPrint.Name = "SingleLabelAutoPrint";
             this.SingleLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -2087,7 +2093,7 @@
             // 
             this.AutoPrintMidBox.AutoSize = true;
             this.AutoPrintMidBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoPrintMidBox.Location = new System.Drawing.Point(26, 378);
+            this.AutoPrintMidBox.Location = new System.Drawing.Point(28, 380);
             this.AutoPrintMidBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AutoPrintMidBox.Name = "AutoPrintMidBox";
             this.AutoPrintMidBox.Size = new System.Drawing.Size(166, 35);
@@ -2099,7 +2105,7 @@
             // 
             this.CurrentRowOnly.AutoSize = true;
             this.CurrentRowOnly.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CurrentRowOnly.Location = new System.Drawing.Point(179, 201);
+            this.CurrentRowOnly.Location = new System.Drawing.Point(181, 203);
             this.CurrentRowOnly.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.CurrentRowOnly.Name = "CurrentRowOnly";
             this.CurrentRowOnly.Size = new System.Drawing.Size(166, 35);
@@ -2125,7 +2131,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(34, 257);
+            this.label2.Location = new System.Drawing.Point(36, 259);
             this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(62, 31);
@@ -2149,7 +2155,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(34, 321);
+            this.label5.Location = new System.Drawing.Point(36, 323);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(62, 31);
@@ -2181,7 +2187,7 @@
             // 
             this.MidLabelAutoPrint.AutoSize = true;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MidLabelAutoPrint.Location = new System.Drawing.Point(25, 199);
+            this.MidLabelAutoPrint.Location = new System.Drawing.Point(27, 201);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.MidLabelAutoPrint.Name = "MidLabelAutoPrint";
             this.MidLabelAutoPrint.Size = new System.Drawing.Size(142, 35);
@@ -2235,7 +2241,7 @@
             // 
             this.AutoPrintOutBox.AutoSize = true;
             this.AutoPrintOutBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoPrintOutBox.Location = new System.Drawing.Point(160, 180);
+            this.AutoPrintOutBox.Location = new System.Drawing.Point(162, 182);
             this.AutoPrintOutBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AutoPrintOutBox.Name = "AutoPrintOutBox";
             this.AutoPrintOutBox.Size = new System.Drawing.Size(118, 35);
@@ -2247,7 +2253,7 @@
             // 
             this.AutoSetOutBox.AutoSize = true;
             this.AutoSetOutBox.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AutoSetOutBox.Location = new System.Drawing.Point(17, 220);
+            this.AutoSetOutBox.Location = new System.Drawing.Point(19, 222);
             this.AutoSetOutBox.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AutoSetOutBox.Name = "AutoSetOutBox";
             this.AutoSetOutBox.Size = new System.Drawing.Size(142, 35);
@@ -2259,7 +2265,7 @@
             // 
             this.DiffDetno.AutoSize = true;
             this.DiffDetno.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffDetno.Location = new System.Drawing.Point(277, 388);
+            this.DiffDetno.Location = new System.Drawing.Point(279, 390);
             this.DiffDetno.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffDetno.Name = "DiffDetno";
             this.DiffDetno.Size = new System.Drawing.Size(133, 34);
@@ -2271,7 +2277,7 @@
             // 
             this.DiffCPN.AutoSize = true;
             this.DiffCPN.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffCPN.Location = new System.Drawing.Point(277, 344);
+            this.DiffCPN.Location = new System.Drawing.Point(279, 346);
             this.DiffCPN.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffCPN.Name = "DiffCPN";
             this.DiffCPN.Size = new System.Drawing.Size(135, 34);
@@ -2283,7 +2289,7 @@
             // 
             this.BoxCount.AutoSize = true;
             this.BoxCount.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BoxCount.Location = new System.Drawing.Point(289, 401);
+            this.BoxCount.Location = new System.Drawing.Point(291, 403);
             this.BoxCount.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.BoxCount.Name = "BoxCount";
             this.BoxCount.Size = new System.Drawing.Size(0, 31);
@@ -2293,7 +2299,7 @@
             // 
             this.DiffLotNo.AutoSize = true;
             this.DiffLotNo.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffLotNo.Location = new System.Drawing.Point(277, 296);
+            this.DiffLotNo.Location = new System.Drawing.Point(279, 298);
             this.DiffLotNo.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffLotNo.Name = "DiffLotNo";
             this.DiffLotNo.Size = new System.Drawing.Size(118, 34);
@@ -2305,7 +2311,7 @@
             // 
             this.DiffDC.AutoSize = true;
             this.DiffDC.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.DiffDC.Location = new System.Drawing.Point(277, 244);
+            this.DiffDC.Location = new System.Drawing.Point(279, 246);
             this.DiffDC.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.DiffDC.Name = "DiffDC";
             this.DiffDC.Size = new System.Drawing.Size(121, 34);
@@ -2317,7 +2323,7 @@
             // 
             this.OnlyOneRow.AutoSize = true;
             this.OnlyOneRow.Font = new System.Drawing.Font("微软雅黑", 8F);
-            this.OnlyOneRow.Location = new System.Drawing.Point(277, 196);
+            this.OnlyOneRow.Location = new System.Drawing.Point(279, 198);
             this.OnlyOneRow.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.OnlyOneRow.Name = "OnlyOneRow";
             this.OnlyOneRow.Size = new System.Drawing.Size(111, 34);
@@ -2329,7 +2335,7 @@
             // 
             this.AllLabel.AutoSize = true;
             this.AllLabel.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.AllLabel.Location = new System.Drawing.Point(17, 178);
+            this.AllLabel.Location = new System.Drawing.Point(19, 180);
             this.AllLabel.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
             this.AllLabel.Name = "AllLabel";
             this.AllLabel.Size = new System.Drawing.Size(142, 35);
@@ -2352,7 +2358,7 @@
             // LogingOut
             // 
             this.LogingOut.AutoSize = true;
-            this.LogingOut.Location = new System.Drawing.Point(253, 41);
+            this.LogingOut.Location = new System.Drawing.Point(255, 43);
             this.LogingOut.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.LogingOut.Name = "LogingOut";
             this.LogingOut.Size = new System.Drawing.Size(82, 41);
@@ -2380,7 +2386,7 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label10.Location = new System.Drawing.Point(49, 331);
+            this.label10.Location = new System.Drawing.Point(51, 333);
             this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(62, 31);
@@ -2391,7 +2397,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(49, 282);
+            this.label6.Location = new System.Drawing.Point(51, 284);
             this.label6.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(62, 31);
@@ -2446,12 +2452,6 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // 内部标签打印ToolStripMenuItem
-            // 
-            this.内部标签打印ToolStripMenuItem.Name = "内部标签打印ToolStripMenuItem";
-            this.内部标签打印ToolStripMenuItem.Size = new System.Drawing.Size(256, 36);
-            this.内部标签打印ToolStripMenuItem.Text = "内部标签打印";
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@@ -2714,6 +2714,9 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn39;
         private System.Windows.Forms.ToolStripMenuItem 断开贴标机ToolStripMenuItem;
         private System.Windows.Forms.CheckBox AutoPrintOutBox;
+        private System.Windows.Forms.Label label15;
+        private System.Windows.Forms.ComboBox pib_size;
+        private System.Windows.Forms.ToolStripMenuItem 内部标签打印ToolStripMenuItem;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_custprodspec;
@@ -2748,8 +2751,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_remark2;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private System.Windows.Forms.Label label15;
-        private System.Windows.Forms.ComboBox pib_size;
-        private System.Windows.Forms.ToolStripMenuItem 内部标签打印ToolStripMenuItem;
     }
 }

+ 22 - 20
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -140,18 +140,18 @@ namespace UAS_LabelMachine
 
         void bindingsource(DataGridView dgv, DataTable dt)
         {
-            dgv.AutoGenerateColumns = false;
-            dgv.DataSource = null;
-            dgv.DataSource = dt;
-            //if (dgv.InvokeRequired)
-            //{
-            //    dgv.Invoke(new BindDataSource(bindingsource), new object[] { dgv, dt });
-            //}
-            //else
-            //{
-            //    dgv.AutoGenerateColumns = false;
-            //    dgv.DataSource = dt;
-            //}
+            //dgv.AutoGenerateColumns = false;
+            //dgv.DataSource = null;
+            //dgv.DataSource = dt;
+            if (dgv.InvokeRequired)
+            {
+                dgv.Invoke(new BindDataSource(bindingsource), new object[] { dgv, dt });
+            }
+            else
+            {
+                dgv.AutoGenerateColumns = false;
+                dgv.DataSource = dt;
+            }
         }
 
         private void 贴标机条码打印_Load(object sender, EventArgs e)
@@ -576,11 +576,12 @@ namespace UAS_LabelMachine
                     CustBarCode.Add("");
                 }
             }
+            string rulecode = ShareRule == "" ? NrCode : ShareRule;
             sql.Clear();
             sql.Append("insert into prodiobarcode(PIB_ID,PIB_PRODCODE,PIB_INDATE,PIB_INOUTNO,PIB_PIID,PIB_PDNO, PIB_PDID,PIB_PICLASS,");
-            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,pib_brand,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO,pib_remark,pib_midcapatity,pib_custcode,pib_ismachine) ");
+            sql.Append("PIB_BARCODE,PIB_CUSTBARCODE,PIB_QTY,pib_brand,pib_datecode,pib_lotno,PIB_OUTBOXCODE2,pib_inman,PIB_IFPRINT,PIB_ORDERCODE,PIB_CUSTPO,pib_remark,pib_midcapatity,pib_custcode,pib_ismachine,pib_rulecode) ");
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
-            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["BRAND"] + "','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark,'" + MidboxCapacity.Value + "','" + pi_cardcode.Text + "','" + (ConnectToMachine ? "Y" : "N") + "' ");
+            sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["BRAND"] + "','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark,'" + MidboxCapacity.Value + "','" + pi_cardcode.Text + "','" + (ConnectToMachine ? "Y" : "N") + "','" + rulecode + "'");
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             int rowsnum = 0;
             try
@@ -600,6 +601,7 @@ namespace UAS_LabelMachine
                 CollectInputData();
                 return;
             }
+            LogManager.DoCommandLog(pi_inoutno.Text, User.UserCode, Input.Text, "数据插入成功");
             if (rowsnum == 0)
             {
                 MessageBox.Show("未成功插入数据,请核对出货单当前明细", "提示");
@@ -1467,8 +1469,8 @@ namespace UAS_LabelMachine
         {
             if (dh.getFieldDataByCondition("prodinout", "pi_statuscode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString() == "POSTED")
             {
-                //MessageBox.Show("单据" + pi_inoutno.Text + "已过账,不允许删除条码");
-                //return;
+                MessageBox.Show("单据" + pi_inoutno.Text + "已过账,不允许删除条码");
+                return;
             }
             ArrayList<string> DeleteID = new ArrayList<string>();
             for (int i = 0; i < LabelInf.RowCount; i++)
@@ -1886,7 +1888,7 @@ namespace UAS_LabelMachine
             if (OutBox != "新增" && OutBox != "")
                 OutBoxNum.Text = OutBox;
         }
-
+        string ShareRule;
         string ReSetType = "";
         /// <summary>
         /// 获取条码规则
@@ -1914,7 +1916,7 @@ namespace UAS_LabelMachine
             ReSetType = "";
             if (Nr.Rows.Count > 0)
             {
-                string ShareRule = Nr.Rows[0]["nr_sharerule"].ToString();
+                ShareRule = Nr.Rows[0]["nr_sharerule"].ToString();
                 DataTable dt1 = (DataTable)dh.ExecuteSql("select nvl(nr_resettype,' ')nr_resettype,nr_sharerule,nr_code,nrd_detno,nrd_name,nrd_radix,nrd_type,nrd_sql,nrd_length from NoRuleDetail left join norule on nrd_nrid=nr_id where nr_code='" + ShareRule + "' order by nrd_detno", "select");
                 if (dt1.Rows.Count > 0)
                 {
@@ -2760,7 +2762,7 @@ namespace UAS_LabelMachine
                         Input_KeyDown(Input, new KeyEventArgs(Keys.Enter));
                     }
                 }
-                catch (Exception e)
+                catch (Exception)
                 {
                     //接受消息发生异常  
                     break;
@@ -2931,7 +2933,7 @@ namespace UAS_LabelMachine
                     //    //不弹出错误提示
                     //    break;
                 }
-                catch (Exception e)
+                catch (Exception)
                 {
                     //接受消息发生异常  
                     break;

+ 0 - 63
UAS-出货标签管理(泽天)/UAS_出货标签管理.resx

@@ -243,69 +243,6 @@
   <metadata name="pd_remark2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pib_datecode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_custprodspec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_madein.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_piid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_unit1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_vendprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_pdid.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_midifprint.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_custprodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pr_zxbzs.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="DateCode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_custbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_custmidboxcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_custoutboxcode.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="pib_midboxweight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_boxweight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pib_totalweight.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="pd_remark2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 1 - 1
UAS_MES_YD/FunctionCode/Packing/Packing_PackageCollection.cs

@@ -931,7 +931,7 @@ namespace UAS_MES_NEW.Packing
 
         private void LoadCollectedNum()
         {
-            dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail_view on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+            dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
 

+ 49 - 27
UAS_MES_YD/FunctionCode/SystemSetting/SystemSetting_ScaleTest.Designer.cs

@@ -41,6 +41,7 @@
             this.StartTest = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ComList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.SerialPortCombox();
             this.normalButton1 = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.Remark = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.panel4.SuspendLayout();
             this.panel5.SuspendLayout();
             this.SuspendLayout();
@@ -50,9 +51,10 @@
             this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel4.Controls.Add(this.Weight);
             this.panel4.Controls.Add(this.panel5);
-            this.panel4.Location = new System.Drawing.Point(342, 86);
+            this.panel4.Location = new System.Drawing.Point(684, 172);
+            this.panel4.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.panel4.Name = "panel4";
-            this.panel4.Size = new System.Drawing.Size(333, 129);
+            this.panel4.Size = new System.Drawing.Size(664, 256);
             this.panel4.TabIndex = 39;
             // 
             // Weight
@@ -63,9 +65,10 @@
             this.Weight.AutoSize = true;
             this.Weight.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Weight.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Weight.Location = new System.Drawing.Point(134, 50);
+            this.Weight.Location = new System.Drawing.Point(268, 100);
+            this.Weight.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.Weight.Name = "Weight";
-            this.Weight.Size = new System.Drawing.Size(0, 31);
+            this.Weight.Size = new System.Drawing.Size(0, 62);
             this.Weight.TabIndex = 41;
             // 
             // panel5
@@ -75,8 +78,9 @@
             this.panel5.Controls.Add(this.label22);
             this.panel5.Dock = System.Windows.Forms.DockStyle.Left;
             this.panel5.Location = new System.Drawing.Point(0, 0);
+            this.panel5.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.panel5.Name = "panel5";
-            this.panel5.Size = new System.Drawing.Size(78, 127);
+            this.panel5.Size = new System.Drawing.Size(156, 254);
             this.panel5.TabIndex = 40;
             // 
             // pr_colorboxunit
@@ -84,9 +88,10 @@
             this.pr_colorboxunit.AutoSize = true;
             this.pr_colorboxunit.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.pr_colorboxunit.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.pr_colorboxunit.Location = new System.Drawing.Point(22, 66);
+            this.pr_colorboxunit.Location = new System.Drawing.Point(44, 132);
+            this.pr_colorboxunit.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_colorboxunit.Name = "pr_colorboxunit";
-            this.pr_colorboxunit.Size = new System.Drawing.Size(31, 25);
+            this.pr_colorboxunit.Size = new System.Drawing.Size(60, 50);
             this.pr_colorboxunit.TabIndex = 42;
             this.pr_colorboxunit.Text = "克";
             // 
@@ -95,9 +100,10 @@
             this.label22.AutoSize = true;
             this.label22.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label22.ForeColor = System.Drawing.SystemColors.ControlLightLight;
-            this.label22.Location = new System.Drawing.Point(15, 32);
+            this.label22.Location = new System.Drawing.Point(30, 64);
+            this.label22.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label22.Name = "label22";
-            this.label22.Size = new System.Drawing.Size(50, 25);
+            this.label22.Size = new System.Drawing.Size(98, 50);
             this.label22.TabIndex = 20;
             this.label22.Text = "重量";
             // 
@@ -108,9 +114,10 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.SerialPortComBox_label.AutoSize = true;
             this.SerialPortComBox_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SerialPortComBox_label.Location = new System.Drawing.Point(43, 85);
+            this.SerialPortComBox_label.Location = new System.Drawing.Point(86, 170);
+            this.SerialPortComBox_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.SerialPortComBox_label.Name = "SerialPortComBox_label";
-            this.SerialPortComBox_label.Size = new System.Drawing.Size(78, 21);
+            this.SerialPortComBox_label.Size = new System.Drawing.Size(153, 41);
             this.SerialPortComBox_label.TabIndex = 42;
             this.SerialPortComBox_label.Text = "Com端口";
             // 
@@ -121,9 +128,10 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.BaudRate_label.AutoSize = true;
             this.BaudRate_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BaudRate_label.Location = new System.Drawing.Point(62, 124);
+            this.BaudRate_label.Location = new System.Drawing.Point(124, 248);
+            this.BaudRate_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.BaudRate_label.Name = "BaudRate_label";
-            this.BaudRate_label.Size = new System.Drawing.Size(58, 21);
+            this.BaudRate_label.Size = new System.Drawing.Size(114, 41);
             this.BaudRate_label.TabIndex = 44;
             this.BaudRate_label.Text = "波特率";
             // 
@@ -135,13 +143,13 @@
             this.StopTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.StopTest.Image = ((System.Drawing.Image)(resources.GetObject("StopTest.Image")));
             this.StopTest.IsShowBorder = true;
-            this.StopTest.Location = new System.Drawing.Point(203, 190);
-            this.StopTest.Margin = new System.Windows.Forms.Padding(2);
+            this.StopTest.Location = new System.Drawing.Point(406, 380);
+            this.StopTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.StopTest.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopTest.MoveImage")));
             this.StopTest.Name = "StopTest";
             this.StopTest.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopTest.NormalImage")));
             this.StopTest.Power = null;
-            this.StopTest.Size = new System.Drawing.Size(67, 23);
+            this.StopTest.Size = new System.Drawing.Size(134, 46);
             this.StopTest.TabIndex = 45;
             this.StopTest.Text = "停止调试";
             this.StopTest.UseVisualStyleBackColor = true;
@@ -152,12 +160,12 @@
             this.BaudRate.AllPower = null;
             this.BaudRate.BackColor = System.Drawing.Color.White;
             this.BaudRate.ID = null;
-            this.BaudRate.Location = new System.Drawing.Point(130, 126);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(2);
+            this.BaudRate.Location = new System.Drawing.Point(260, 252);
+            this.BaudRate.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.BaudRate.Name = "BaudRate";
             this.BaudRate.Negative = false;
             this.BaudRate.Power = null;
-            this.BaudRate.Size = new System.Drawing.Size(140, 21);
+            this.BaudRate.Size = new System.Drawing.Size(276, 35);
             this.BaudRate.Str = null;
             this.BaudRate.Str1 = null;
             this.BaudRate.Str2 = null;
@@ -171,13 +179,13 @@
             this.StartTest.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.StartTest.Image = ((System.Drawing.Image)(resources.GetObject("StartTest.Image")));
             this.StartTest.IsShowBorder = true;
-            this.StartTest.Location = new System.Drawing.Point(120, 190);
-            this.StartTest.Margin = new System.Windows.Forms.Padding(2);
+            this.StartTest.Location = new System.Drawing.Point(240, 380);
+            this.StartTest.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.StartTest.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartTest.MoveImage")));
             this.StartTest.Name = "StartTest";
             this.StartTest.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartTest.NormalImage")));
             this.StartTest.Power = null;
-            this.StartTest.Size = new System.Drawing.Size(67, 23);
+            this.StartTest.Size = new System.Drawing.Size(134, 46);
             this.StartTest.TabIndex = 41;
             this.StartTest.Text = "开始调试";
             this.StartTest.UseVisualStyleBackColor = true;
@@ -185,10 +193,10 @@
             // 
             // ComList
             // 
-            this.ComList.Location = new System.Drawing.Point(130, 86);
-            this.ComList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ComList.Location = new System.Drawing.Point(260, 172);
+            this.ComList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.ComList.Name = "ComList";
-            this.ComList.Size = new System.Drawing.Size(140, 20);
+            this.ComList.Size = new System.Drawing.Size(280, 40);
             this.ComList.TabIndex = 40;
             // 
             // normalButton1
@@ -199,6 +207,7 @@
             this.normalButton1.Image = ((System.Drawing.Image)(resources.GetObject("normalButton1.Image")));
             this.normalButton1.IsShowBorder = true;
             this.normalButton1.Location = new System.Drawing.Point(0, 0);
+            this.normalButton1.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
             this.normalButton1.Name = "normalButton1";
             this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
@@ -208,11 +217,22 @@
             this.normalButton1.Text = "normalButton1";
             this.normalButton1.UseVisualStyleBackColor = true;
             // 
+            // Remark
+            // 
+            this.Remark.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Remark.Location = new System.Drawing.Point(170, 558);
+            this.Remark.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.Remark.Name = "Remark";
+            this.Remark.Size = new System.Drawing.Size(476, 156);
+            this.Remark.TabIndex = 195;
+            this.Remark.Text = "";
+            // 
             // SystemSetting_ScaleTest
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(916, 474);
+            this.ClientSize = new System.Drawing.Size(1832, 948);
+            this.Controls.Add(this.Remark);
             this.Controls.Add(this.StopTest);
             this.Controls.Add(this.BaudRate_label);
             this.Controls.Add(this.BaudRate);
@@ -222,6 +242,7 @@
             this.Controls.Add(this.panel4);
             this.Controls.Add(this.normalButton1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
             this.Name = "SystemSetting_ScaleTest";
             this.Tag = "Setup!ScaleTest";
             this.Text = " ";
@@ -249,5 +270,6 @@
         private CustomControl.TextBoxWithIcon.NumOnlyTextBox BaudRate;
         private System.Windows.Forms.Label BaudRate_label;
         private CustomControl.ButtonUtil.NormalButton StopTest;
+        private CustomControl.RichText.RichTextAutoBottom Remark;
     }
 }

+ 9 - 1
UAS_MES_YD/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs

@@ -77,7 +77,15 @@ namespace UAS_MES_NEW.SystemSetting
                         {
                             try
                             {
-                                Weight.Text = re.Match(serialPort1.ReadLine().Trim()).Groups[0].Value;
+                                int len = serialPort1.BytesToRead;
+                                Byte[] readBuffer = new Byte[len];
+                                serialPort1.Read(readBuffer, 0, len); //将数据读入缓存
+                                string weigh = Encoding.Default.GetString(readBuffer);
+                                Remark.AppendText(weigh+"\n");
+                                if (weigh != "")
+                                {
+                                    Weight.Text = weigh;
+                                }
                             }
                             catch (Exception)
                             {

+ 1 - 1
UAS_MES_YD/PublicMethod/Print.cs

@@ -222,7 +222,7 @@ namespace UAS_MES_NEW.PublicMethod
             //    }
             //    else
             //    {
-            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpZZZZZl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
             //    }
             //    ////如果已经打印过了,则不允许再打印
             //    if (dt.Rows.Count > 0)

+ 9 - 0
UAS_MES_YD/UAS_MES_YD.csproj

@@ -554,6 +554,12 @@
     <Compile Include="FunctionCode\Make\Make_CollectElec.Designer.cs">
       <DependentUpon>Make_CollectElec.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrintPT.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrintPT.Designer.cs">
+      <DependentUpon>Make_ColorBoxLoadPrintPT.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_ColorBoxLoadPrintBZ.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1367,6 +1373,9 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_CollectElec.resx">
       <DependentUpon>Make_CollectElec.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxLoadPrintPT.resx">
+      <DependentUpon>Make_ColorBoxLoadPrintPT.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_ColorBoxLoadPrintBZ.resx">
       <DependentUpon>Make_ColorBoxLoadPrintBZ.cs</DependentUpon>
     </EmbeddedResource>

+ 1189 - 0
UAS_MesInterface(YD)/MesHelper.cs

@@ -0,0 +1,1189 @@
+using Oracle.ManagedDataAccess.Client;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Web.Script.Serialization;
+
+namespace UMESDLLService
+{
+
+    [Guid("974DEAD2-9D4C-4728-87EA-2407752E300F")]
+    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
+    public interface IMESHelper
+    {
+        [DispId(12)]
+        bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
+        bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
+        bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
+        bool GetAddressRangeByMO(string iSN, out string oInfo, out string oErrMessage);
+        bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage);
+        bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[,] iTestDetail, out string oErrMessage);
+        bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oInfo, out string oErrMessage);
+        bool SetIMEIInfo(string iSnCode, string iIMEI1, out string oErrMessage);
+        bool GetMobileAllInfo(string iSnCode, out string oInfo, out string oErrorMessage);
+        bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperator, string iResult, string iErrCode, string flag, out string oErrorMessage);
+        bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
+        bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
+    }
+
+    [Guid("5379A8F6-EB38-4A2B-9050-52AD9757E12D")]
+    [ComSourceInterfaces(typeof(IMESHelper))]
+    [ClassInterface(ClassInterfaceType.None)]
+    [ProgId("UMES.DllService.MESHelper")]
+    public class MESHelper : IMESHelper
+    {
+        //用于拼接SQL 
+        StringBuilder sql = new StringBuilder();
+        //用于存放批量执行的SQL
+        List<string> sqls = new List<string>();
+        //系统默认的的连接字符串
+        private string ConnectionStrings = "Data Source=81.71.42.91/orcl;User ID=DGW;PassWord=select!#%*(;";
+        //用户选择的数据库的连接字符串
+        private OracleConnection connection;
+        //用户选择的数据库的连接字符串
+        private OracleCommand command = null;
+
+        public MESHelper()
+        {
+            connection = new OracleConnection(ConnectionStrings);
+        }
+
+        public MESHelper(string IP)
+        {
+            connection = new OracleConnection("Data Source=" + IP + "/orcl;User ID=MES;PassWord=select!#%*(;");
+        }
+
+        /// <summary>
+        /// 检测当前的岗位资源对应的工序
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("序列号对应工序检测")]
+        public bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { "", iResCode, iSN, "", "", "", oErrMessage };
+            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
+            CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
+            oErrMessage = param[6];
+            DataTable dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id=(  select max(ms_id) from makeserial where ms_sncode  in ( select '" + iSN + "' from dual union select sn from makesnrelation where beforesn='" + iSN + "' and sn<>' '  union select beforesn from makesnrelation where sn='" + iSN + "' and beforesn<>' '))", "select");
+            string ms_status = "";
+            string ms_stepcode = "";
+            string ms_nextstepcode = "";
+            if (dt.Rows.Count > 0)
+            {
+                ms_status = dt.Rows[0]["ms_status"].ToString();
+                ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+            }
+            string stepcode = GetStepCodeBySource(iResCode);
+            if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
+            {
+                oErrMessage = "当前序列号下一工序" + ms_nextstepcode;
+                return false;
+            }
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && stepcode == ms_stepcode))
+            {
+                if (ms_status == "3")
+                {
+                    oErrMessage = "";
+                }
+                DataTable dt1 = (DataTable)ExecuteSql("select 1 from makebadcount where mbc_sncode='" + iSN + "' and mbc_stepcode='" + stepcode + "' and mbc_status=0", "select");
+                int BadCount = dt1.Rows.Count;
+                //测试不良3次不允许再测试,必须先维修
+                if (BadCount == 3)
+                {
+                    oErrMessage = stepcode + "连续三次测试不良,请进行维修";
+                    return false;
+                }
+                return true;
+            }
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 验证用户身份信息
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        private bool CheckUserLogin(string iUserCode, string iPassWord, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "select em_code from employee where em_code=:UserName and em_password =:PassWord";
+            DataTable dt;
+            dt = (DataTable)ExecuteSql(SQL, "select", iUserCode, iPassWord);
+            if (dt.Rows.Count > 0)
+                return true;
+            else
+            {
+                oErrorMessage = "用户名或者密码不正确!";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 验证用户身份信息和岗位资源
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("验证身份信息")]
+        public bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage)
+        {
+            oErrMessage = "";
+            if (iUserCode == "" || iPassWord == "" || iResCode == "")
+            {
+                oErrMessage = "用户名,密码,岗位资源必须填写";
+                return false;
+            }
+            if (CheckUserLogin(iUserCode, iPassWord, out oErrMessage))
+            {
+                string SQL = "select em_code,em_type,em_name from employee where em_code=:UserName ";
+                DataTable dt;
+                dt = (DataTable)ExecuteSql(SQL, "select", iUserCode);
+                if (dt.Rows.Count > 0)
+                {
+                    string em_name = dt.Rows[0]["em_name"].ToString();
+                    string em_type = dt.Rows[0]["em_type"].ToString();
+                    if (iResCode == "")
+                    {
+                        oErrMessage = "岗位资源不允许为空";
+                        return false;
+                    }
+                    if (em_type == "admin")
+                    {
+                        if (CheckExist("Source", "sc_code='" + iResCode + "' and sc_statuscode='AUDITED'"))
+                        {
+                            return true;
+                        }
+                        else
+                        {
+                            oErrMessage = "岗位资源编号错误或者未审核!";
+                            return false;
+                        }
+                    }
+                    else
+                    {
+                        dt = getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "eg_emcode = '" + iUserCode + "' and sc_statuscode='AUDITED'");
+                        //如果存在该编号
+                        if (dt.Rows.Count > 0)
+                        {
+                            //判断如果多个岗位资源存在,用户输入的只要在其中就行
+                            for (int i = 0; i < dt.Rows.Count; i++)
+                            {
+                                if (dt.Rows[i]["ur_resourcecode"].ToString() == iResCode)
+                                    return true;
+                            }
+                            oErrMessage = "用户不处于当前资源所属分组!";
+                        }
+                        else
+                            oErrMessage = "岗位资源编号错误或者未审核!";
+                    }
+                }
+                else
+                    oErrMessage = "用户不存在!";
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 分配Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="oWIFI"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCdoe3"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("分配MAC和BT信息")]
+        public bool GetAddressRangeByMO(string iSN, out string oInfo, out string oErrMessage)
+        {
+            oInfo = "";
+            string oWIFI = "";
+            string oBT = "";
+            string oCode1 = "";
+            string oCode2 = "";
+            string oCdoe3 = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string omakeCode = "";
+            GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
+            string[] param = new string[] { iSN, omakeCode, oWIFI, oBT, oCode1, oCode2, oCdoe3, oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_macode", "v_o_mac", "v_o_bt", "v_o_code1", "v_o_code2", "v_o_code3", "v_o_errmsg" };
+            CallProcedure("CS_GETADDRESSBYMAKECODE", ParamName, ref param);
+            oInfo += "MAC:"+param[2].ToString() + "^";
+            oInfo += "BT:" + param[3].ToString() + "^";
+            oInfo += "Code1:" + param[4].ToString() + "^";
+            oInfo += "Code2:" + param[5].ToString() + "^";
+            oInfo += "Code3:" + param[6].ToString() + "";
+            oErrMessage = param[7];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
+        /// 如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oID1"></param>
+        /// <param name="oID2"></param>
+        /// <param name="oID3"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("分配IMEI和NetCode信息")]
+        public bool GetMEIOrNetCodeRange(string iSN, string iIMEI1, string iNetCode, out string oInfo, out string oErrMessage)
+        {
+            oInfo = "";
+            string oIMEI1 = "";
+            string oIMEI2 = "";
+            string oMEID = "";
+            string oNetCode = "";
+            string oPSN = "";
+            string oID1 = "";
+            string oID2 = "";
+            string oID3 = "";
+
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iSN, "", iIMEI1, iNetCode, oIMEI1, oIMEI2, "", oMEID, oNetCode, oPSN, oID1, oID2, oID3, oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_macode", "v_i_imei", "v_i_netcode", "v_o_imei1", "v_o_imei2", "v_o_imei3", "v_o_meid", "v_o_netcode", "v_o_psn", "v_o_id1", "v_o_id2", "v_o_id3", "v_o_errmsg" };
+            CallProcedure("CS_GETIMEIORNETCODERANGE", ParamName, ref param);
+
+            oInfo += "IMEI1:" + param[4].ToString() + "^";
+            oInfo += "IMEI2:" + param[5].ToString() + "^";
+            oInfo += "MEID:" + param[7].ToString() + "^";
+            oInfo += "NETCODE:" + param[8].ToString() + "^";
+            oInfo += "PSN:" + param[9].ToString() + "";
+            oInfo += "ID1:" + param[10].ToString() + "";
+            oInfo += "ID2:" + param[11].ToString() + "";
+            oInfo += "ID3:" + param[12].ToString() + "";
+            oErrMessage = param[13];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 获取工单的最近一条执行记录
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="oMoCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("获取序列号对应工单信息")]
+        public bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage)
+        {
+            //取MakeProcess表中的执行记录ID最大的一个工单的号码
+            oMoCode = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            sql.Clear();
+            sql.Append("select max(ms_id) from makeserial where ms_sncode in (select '" + iSN + "' from dual union select sn from ");
+            sql.Append("makesnrelation where beforesn='" + iSN + "' and sn<>' '  union select beforesn from makesnrelation where sn='" + iSN + "' and beforesn<>' ')");
+            DataTable dt = (DataTable)ExecuteSql(sql.ToString(), "select");
+            string ms_id = dt.Rows[0][0].ToString();
+            oMoCode = getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
+            if (oMoCode != "")
+                return true;
+            else
+            {
+                oErrMessage = "序列号:" + iSN + " 未归属工单";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 获取序列号的所有串号信息
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="oWIFI"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCode3"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oID1"></param>
+        /// <param name="oID2"></param>
+        /// <param name="oID3"></param>
+        /// <param name="oID4"></param>
+        /// <param name="oID5"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("查询已分配的信息")]
+        public bool GetMobileAllInfo(string iSN, out string oJson, out string oErrMessage)
+        {
+            JavaScriptSerializer jss = new JavaScriptSerializer();
+            Dictionary<string, string> oInfo = new Dictionary<string, string>();
+            oErrMessage = "";
+            oJson = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            string MacInfo;
+            if (!GetAddressRangeByMO(iSN, out MacInfo, out oErrMessage))
+            {
+                if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                    return true;
+                else
+                    return false;
+            }
+            string MAC = MacInfo.Split('^')[0].Replace("MAC:", "");
+            string BT = MacInfo.Split('^')[0].Replace("BT:", "");
+            string TCode1 = MacInfo.Split('^')[0].Replace("Code1:", "");
+            string TCode2 = MacInfo.Split('^')[0].Replace("Code2:", "");
+            string TCode3 = MacInfo.Split('^')[0].Replace("Code3:", "");
+            if (!SetAddressInfo(iSN, MAC == "null" ? "" : MAC, BT == "null" ? "" : BT, TCode1 == "null" ? "" :TCode1,TCode2 == "null" ? "" :TCode2,TCode3 == "null" ? "" :TCode3, out oErrMessage))
+            {
+                if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                    return true;
+                else
+                    return false;
+            }
+            //通过序列号获取最近操作的工单号
+            string ms_id = getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + iSN + "' or ms_firstsn='" + iSN + "'").ToString();
+            if (ms_id != "")
+            {
+                DataTable dt = getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string Code1 = "";
+                    string Code2 = "";
+                    string Code3 = "";
+                    string Code4 = "";
+                    string Code5 = "";
+                    string Code6 = "";
+                    string Code7 = "";
+                    string Code8 = "";
+                    string Code9 = "";
+                    string Code10 = "";
+                    string Code11 = "";
+                    string Code12 = "";
+                    string Code13 = "";
+                    string Code14 = "";
+                    string Code15 = "";
+                    string Code16 = "";
+                    string Code17 = "";
+                    string Code18 = "";
+                    string Code19 = "";
+                    string Code20 = "";
+                    string Code21 = "";
+                    string Code22 = "";
+                    string Code23 = "";
+                    string Code24 = "";
+                    string Code25 = "";
+                    string[] param = new string[] { ms_id, Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10, Code11, Code12, Code13, Code14, Code15, Code16, Code17, Code18, Code19, Code20, Code21, Code22, Code23, Code24, Code25 };
+                    string[] ParamName = new string[] { "v_ms_id", "v_i_code1", "v_i_code2", "v_i_code3", "v_i_code4", "v_i_code5", "v_i_code6", "v_i_code7", "v_i_code8", "v_i_code9", "v_i_code10", "v_i_code11", "v_i_code12", "v_i_code13", "v_i_code14", "v_i_code15", "v_i_code16", "v_i_code17", "v_i_code18", "v_i_code19", "v_i_code20", "v_i_code21", "v_i_code22", "v_i_code23", "v_i_code24", "v_i_code25" };
+                    CallProcedure("GetMobileAllInfo_NEW", ParamName, ref param);
+                    for (int i = 1; i < param.Length; i++)
+                    {
+                        //获取出来的参数使用^分割
+                        if (param[i] != "" && param[i] != "null" && param[i] != null)
+                        {
+                            oInfo.Add(param[i].Split('^')[0], param[i].Split('^')[1]);
+                        }
+                    }
+                    oJson = jss.Serialize(oInfo);
+                    oErrMessage = "";
+                    return true;
+                }
+                else
+                {
+                    oErrMessage = "序列号" + iSN + "不存在";
+                    return false;
+                }
+            }
+            else
+            {
+                oErrMessage = "序列号" + iSN + "不存在";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 记录操作日志
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iMPKind"></param>
+        /// <param name="result"></param>
+        /// <param name="iUserCode"></param>
+        private void InsertMakeProcess(string iSnCode, string iMakeCode, string iSourceCode, string iMPKind, string result, string iUserCode)
+        {
+            string CurrentStep = "";
+            string LineCode = "";
+            string CurrentStepName = "";
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref CurrentStep, ref CurrentStepName, ref LineCode);
+            sql.Length = 0;
+            sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
+            sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
+            sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,'" + CurrentStep + "','" + CurrentStepName + "',");
+            sql.Append("ma_craftcode,ma_craftname,'" + iMPKind + "','" + result + "',sysdate,'" + iUserCode + "',ma_wccode,'" + LineCode + "','" + iSourceCode + "',");
+            sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makeserial on ms_makecode=ma_code left join step on st_code=ms_stepcode ");
+            sql.Append("where ms_sncode='" + iSnCode + "' and ma_code='" + iMakeCode + "' and st_code='" + CurrentStep + "'");
+            ExecuteSql(sql.ToString(), "insert");
+        }
+
+        /// <summary>
+        /// 保存Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMac"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iCode1"></param>
+        /// <param name="iCode2"></param>
+        /// <param name="iCode3"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("写入SN的Wifi,BT信息")]
+        public bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iSN, iMac, iBT, iCode1, iCode2, iCode3, oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_mac", "v_i_bt", "v_i_code1", "v_i_code2", "v_i_code3", "v_o_errmsg" };
+            CallProcedure("CS_SETADDRESSINFO", ParamName, ref param);
+            oErrMessage = param[6];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        [Description("序列号跳到下一 步")]
+        private bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string StepCode = getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'").ToString();
+            string CurrentStep = GetStepCodeBySource(iSourceCode);
+            string BgCode = getFieldDataByCondition("step", "st_badgroupcode", "st_code='" + CurrentStep + "'").ToString();
+            switch (iResult)
+            {
+                case "OK":
+                    break;
+                case "NG":
+                    if (iErrCode == "")
+                    {
+                        oErrMessage = "测试结果为NG时必须传递不良代码";
+                        return false;
+                    }
+                    else
+                    {
+                        UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='" + iMakeCode + "' and mb_stepcode='" + CurrentStep + "' and mb_status=0");
+                        string[] BadCode = iErrCode.Split(',');
+                        sql.Length = 0;
+                        sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
+                        sql.Append(",mb_sourcecode,mb_badcode,mb_badtable,mb_bgcode,mb_soncode,mb_status) select makebad_seq.nextval");
+                        sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + CurrentStep + "','" + iSourceCode + "',:bc_code,'',");
+                        sql.Append("'" + BgCode + "',sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
+                        sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+                        List<string> InsertSQL = new List<string>();
+                        for (int i = 0; i < BadCode.Length; i++)
+                        {
+                            InsertSQL.Add(sql.ToString().Replace(":bc_code", "'" + BadCode[i] + "'"));
+                        }
+                        ExecuteSQLTran(InsertSQL.ToArray());
+                        //将不良的序列号的状态码设为3
+                        ExecuteSql("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'", "update");
+                    }
+                    break;
+                default:
+                    oErrMessage = "测试结果必须为NG或者OK";
+                    return false;
+            }
+            //不良采集为良品是更新
+            if (StepCode == CurrentStep && iResult == "OK")
+            {
+                DataTable dt = getFieldsDataByCondition("makeserial", new string[] { "ms_status", "ms_craftcode", "ms_prodcode" }, "ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string ms_status = dt.Rows[0]["ms_status"].ToString();
+                    string ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
+                    string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+                    if (ms_status == "3")
+                    {
+                        string nextstepcode = getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid ", "cd_nextstepcode", "cr_code='" + ms_craftcode + "' and cr_prodcode='" + ms_prodcode + "' and cd_stepcode='" + CurrentStep + "'").ToString();
+                        UpdateByCondition("makeserial", "ms_status=1,ms_nextstepcode='" + nextstepcode + "'", "ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+                        UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='" + iMakeCode + "'");
+                    }
+                }
+            }
+            return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrMessage);
+        }
+
+        /// <summary>
+        /// 设置测试结果
+        /// </summary>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iSN"></param>
+        /// <param name="iOperater"></param>
+        /// <param name="iResult"></param>
+        /// <param name="iUserCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        [Description("设置测试结果,结果必须为NG或者OK")]
+        public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperater, string iResult, string iErrCode, string flag, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            if (iTSN == "") { oErrorMessage = "TSN不能为空"; return false; }
+            if (iSN == "") { oErrorMessage = "SN不能为空"; return false; }
+            string[] param = new string[] { iTSN, iSN, iSourceCode, iOperater, iResult, iErrCode, oErrorMessage };
+            string[] ParamName = new string[] { "v_i_tsn", "v_i_sncode", "v_i_sourcecode", "v_i_usercode", "v_i_result", "v_i_errcode", "v_o_errmsg" };
+            CallProcedure("CS_DLLSNCHANGE", ParamName, ref param);
+            oErrorMessage = param[6];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, iResult, oErrMessage };
+            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_i_result", "v_o_errmsg" };
+            CallProcedure("CS_SETSTEPRESULT", ParamName, ref param);
+            oErrMessage = param[5];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 方法说明:测试详细信息录入系统,针对一个SN多个测试项目结果可循环调用
+        /// </summary>
+        /// <param name="iSN">序列号</param>
+        /// <param name="iClass"></param>
+        /// <param name="iSubClass1"></param>
+        /// <param name="iSubClass2"></param>
+        /// <param name="iSubClass3"></param>
+        /// <param name="iMaxValue"></param>
+        /// <param name="iMinValue"></param>
+        /// <param name="iActualValue"></param>
+        /// <param name="iValue1"></param>
+        /// <param name="iValue2"></param>
+        /// <param name="iValue3"></param>
+        /// <param name="iTestResult"></param>
+        /// <param name="oErrMessage"></param>                                                      
+        /// <returns></returns>
+        [Description("设置测试结果")]
+        public bool SetTestDetail(string iSN, string iClass, string iResCode, string[,] iTestDetail, out string oErrMessage)
+        {
+            if (iSN == "" || iSN == null)
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string omakeCode = "";
+            GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
+            sql.Clear();
+            sql.Append("begin ");
+            bool needBreak = false;
+            for (int i = 0; i < iTestDetail.Length / 200; i++)
+            {
+                string DataField = "Insert into MES_TEST(STD_ID,STD_SN,STD_MAKECODE,STD_CLASS,STD_TESTDATE,";
+                string ValueField = ")values(MES_TEST_SEQ.nextval,'" + iSN + "','" + omakeCode + "','" + iClass + "',sysdate,";
+                for (int j = 0; j < 200; j++)
+                {
+                    if (j == 0)
+                    {
+                        DataField += "STD_ITEMNAME,";
+                        //如果传递的参数没有测试名称则中断插入
+                        if (iTestDetail[i, j] == "" || iTestDetail[i, j] == null)
+                        {
+                            //外层循环也需要中断
+                            needBreak = true;
+                            break;
+                        }
+                    }
+                    else
+                    {
+                        DataField += "STD_ITEM" + j + " ,";
+                    }
+                    ValueField += "'" + iTestDetail[i, j] + "',";
+                }
+                if (needBreak)
+                    break;
+                sql.Append(DataField.Substring(0, DataField.Length - 1) + ValueField.Substring(0, ValueField.Length - 1) + ");");
+            }
+            sql.Append("end;");
+            ExecuteSql(sql.ToString(), "insert");
+            return true;
+        }
+
+        /// <summary>
+        /// 作业调用该方法将确认接收SN对应的IMEI及附属信息。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMO"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iIMEI2"></param>
+        /// <param name="iIMEI3"></param>
+        /// <param name="iMEID"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="iPSN"></param>
+        /// <param name="iID1"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iID1"></param>
+        /// <param name="iID2"></param>
+        /// <param name="iID3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        [Description("设置IMEI信息")]
+        public bool SetIMEIInfo(string iSN, string iIMEI1, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iSN, iIMEI1, "", "", "", "", "", "", "", "", oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_imei1", "v_i_imei2", "v_i_imei3", "v_i_meid", "v_i_netcode", "v_i_psn", "v_i_id1", "v_i_id2", "v_i_id3", "v_o_errmsg" };
+            CallProcedure("CS_SETIMEIINFO", ParamName, ref param);
+            oErrMessage = param[10];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="iOperator"></param>
+        /// <param name="iResult"></param>
+        /// <param name="iErrCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("设置测试结果")]
+        public bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string oMakeCode = "";
+            GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage);
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return SetStepFinish(oMakeCode, iResCode, iSN, "", iResult, iOperator, iErrCode, out oErrMessage);
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 序列号归属工单
+        /// </summary>
+        /// <param name="iMO"></param>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("序列号归属工单")]
+        public bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iMO, iResCode, iSN, "", "", "", oErrMessage };
+            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
+            CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
+            oErrMessage = param[6];
+            DataTable dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + iSN + "')", "select");
+            string ms_status = "";
+            string ms_stepcode = "";
+            string ms_nextstepcode = "";
+            if (dt.Rows.Count > 0)
+            {
+                ms_status = dt.Rows[0]["ms_status"].ToString();
+                ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+            }
+            string stepcode = GetStepCodeBySource(iResCode);
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && ms_stepcode == stepcode))
+            {
+                if (ms_status == "3")
+                {
+                    oErrMessage = "";
+                }
+                return true;
+            }
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 获取执行步骤代码,名称和线别
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        /// <param name="LineCode"></param>
+        private void GetStepCodeAndNameAndLineBySource(string Source, ref string StepCode, ref string StepName, ref string LineCode)
+        {
+            DataTable dt = getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+                LineCode = dt.Rows[0]["sc_linecode"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码和名称
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        private void GetStepCodeAndNameBySource(string Source, ref string StepCode, ref string StepName)
+        {
+            DataTable dt = getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <returns></returns>
+        private string GetStepCodeBySource(string Source)
+        {
+            return getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + Source + "'").ToString();
+        }
+
+        /// <summary>
+        /// 获取步骤代码
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <returns></returns>
+        private string GetStepName(string st_code)
+        {
+            return getFieldDataByCondition("step", "st_name", "st_code='" + st_code + "'").ToString();
+        }
+
+        /// <summary>
+        /// 获取第一行第一列的信息
+        /// </summary>
+        private object getFieldDataByCondition(string TableName, string Field, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select " + Field + " from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter();
+            ad.SelectCommand = command;
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            if (dt.Rows.Count > 0)
+            {
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                return "";
+            }
+        }
+
+        /// <summary>
+        /// 通过表名和获取单行的记录
+        /// </summary>
+        private DataTable getFieldsDataByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition + " and rownum=1";
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段和条件获取DataTable类型的数据
+        /// </summary>
+        private DataTable getFieldsDatasByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段获取DataTable类型的数据
+        /// </summary>
+        private DataTable getFieldsDatas(string TableName, string Fields)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += Fields;
+            sql += " from " + TableName;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.SelectCommand = command;
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 检测内容是否存在
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="Condition"></param>
+        /// <returns></returns>
+        private bool CheckExist(string TableName, string Condition)
+        {
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            DataTable dt = new DataTable();
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString()) > 0;
+        }
+
+        /// <summary>
+        /// 直接执行SQL,同时传入SQL的类型
+        /// </summary>
+        /// <param name="SQL"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        private object ExecuteSql(string SQL, string Type, params object[] names)
+        {
+            object result = null;
+            command = new OracleCommand(SQL, connection);
+            Reconnect(command);
+            //用来拼接参数的
+            if (names.Length > 0)
+            {
+                string[] par = SQL.Split(':');
+                //用来存参数的数组
+                StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+                for (int i = 0; i < par.Length - 1; i++)
+                {
+                    //新建一个char类型的数组用来存储每个字节的变量
+                    char[] c = par[i + 1].ToCharArray();
+                    addpar[i] = new StringBuilder();
+                    for (int j = 0; j < c.Length; j++)
+                    {
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
+                        {
+                            addpar[i].Append(c[j]);
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                }
+                for (int i = 0; i < addpar.Length; i++)
+                {
+                    command.Parameters.Add(new OracleParameter(addpar[i].ToString(), names[i]));
+                }
+            }
+            switch (Type.ToUpper())
+            {
+                case "SELECT":
+                    OracleDataAdapter ad = new OracleDataAdapter(command);
+                    result = new DataTable();
+                    try
+                    {
+                        ad.Fill((DataTable)result);
+                    }
+                    catch (Exception)
+                    {
+                        connection = new OracleConnection(ConnectionStrings);
+                        connection.Open();
+                        command = new OracleCommand(SQL, connection);
+                        ad = new OracleDataAdapter();
+                        ad.SelectCommand = command;
+                        ad.Fill((DataTable)result);
+                    }
+                    break;
+                case "DELETE":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+                case "UPDATE":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+                case "INSERT":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+            }
+            command.Dispose();
+            return result;
+        }
+
+        /// <summary>
+        /// 出现异常进行回滚的执行方法
+        /// </summary>
+        /// <param name="SQL"></param>
+        private void ExecuteSQLTran(params string[] SQL)
+        {
+            command = new OracleCommand();
+            command.Connection = new OracleConnection(ConnectionStrings);
+            command.Connection.Open();
+            Reconnect(command);
+            OracleTransaction tx = command.Connection.BeginTransaction(IsolationLevel.ReadCommitted);
+            command.Transaction = tx;
+            try
+            {
+                foreach (string sql in SQL)
+                {
+                    if (!string.IsNullOrEmpty(sql))
+                    {
+                        command.CommandText = sql;
+                        command.ExecuteNonQuery();
+                    }
+                }
+                tx.Commit();
+            }
+            catch (OracleException E)
+            {
+                tx.Rollback();
+                throw new Exception(E.Message);
+            }
+            command.Dispose();
+        }
+
+        private string UpdateByCondition(string TableName, string update, string condition)
+        {
+            string sql = "update " + TableName + " set " + update + " where " + condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
+            command.Dispose();
+            return sql;
+        }
+
+        private void CallProcedure(string ProcedureName, string[] ParamName, ref string[] param)
+        {
+            command = new OracleCommand(ProcedureName);
+            command.Connection = connection;
+            Reconnect(command);
+            command.CommandText = ProcedureName;
+            command.CommandType = CommandType.StoredProcedure;
+            for (int i = 0; i < param.Length; i++)
+            {
+                command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
+                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
+            }
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
+            for (int i = 0; i < command.Parameters.Count; i++)
+                param[i] = command.Parameters[i].Value.ToString();
+            command.Dispose();
+        }
+
+        private string AddField(string[] Fields)
+        {
+            string sql = " ";
+            foreach (string field in Fields)
+            {
+                sql += field + ",";
+            }
+            return sql.Substring(0, sql.Length - 1);
+        }
+
+        private string[] GetField(string field)
+        {
+            string[] fields = field.Split(',');
+            for (int i = 0; i < fields.Length; i++)
+            {
+                fields[i] = fields[i].Substring(fields[i].LastIndexOf("as") + 2, fields[i].Length - fields[i].LastIndexOf("as") - 2).Trim();
+            }
+            return fields;
+        }
+
+        private void Reconnect(OracleCommand cmd)
+        {
+            if (cmd.Connection.State == ConnectionState.Closed)
+            {
+                cmd.Connection.Open();
+            }
+        }
+    }
+}

+ 36 - 0
UAS_MesInterface(YD)/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("UAS_MesInterface(4.0)")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("深圳市优软科技有限公司")]
+[assembly: AssemblyProduct("UAS_MesInterface(4.0)")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(true)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("a35f767d-0858-4061-af7c-c5c594034668")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 63 - 0
UAS_MesInterface(YD)/UAS_MesInterface(YD).csproj

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{14676F5F-154C-4916-8501-E4C673881536}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UMESDLLService</RootNamespace>
+    <AssemblyName>UMESDLLService</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <RegisterForComInterop>true</RegisterForComInterop>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>false</SignAssembly>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Oracle.ManagedDataAccess">
+      <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.OracleClient" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="MesHelper.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

BIN
UAS_MesInterface(YD)/tool/Oracle.ManagedDataAccess.dll


+ 1441 - 0
UAS_MesInterface_YD/MesHelper.cs

@@ -0,0 +1,1441 @@
+using Oracle.ManagedDataAccess.Client;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Web.Script.Serialization;
+
+namespace UMESDLLService
+{
+
+    [Guid("99D0E96E-1058-415D-9874-D34537625284")]
+    [InterfaceType(ComInterfaceType.InterfaceIsDual)]
+    public interface IMESHelper
+    {
+        [DispId(20)]
+        bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
+        bool CheckRoutePassed_OnlyOK(string iSN, string iResCode, out string oErrMessage);
+        bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
+        bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
+        bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage);
+        bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage);
+        bool GetMaster(out string oMaster);
+        bool SetMaster(string Master);
+        bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[] iTestDetail, out string oErrMessage);
+        bool GetMEIOrNetCodeRange(string iSnCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage);
+        bool SetIMEIInfo(string iSN, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iNET, string iID1, string iID2, string iID3, out string oErrMessage);
+        bool GetMobileAllInfo(string iSnCode, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrorMessage);
+        bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperator, string iResult, string iErrCode, string flag, out string oErrorMessage);
+        bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
+        bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
+        bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage);
+        bool GetProductRelation(string iSN, out string oWIFI, out string oBT, out string IMEI1, out string IMEI2, out string IMEI3, out string oNetCode, out string oMEID, out string oErrMessage);
+        bool GetSNList(string iMaCode, out string[] TSN_List, out string[] SN_List, out string[] TSN_Rule, out string[] SN_Rule, out string oErrMessage);
+        bool GetMaterialInfo(string iSN, out string oResult, out string oErrMessage);
+        bool GetPrintLabel(string iSN, out string oResult, out string oErrMessage);
+    }
+
+    [Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
+    [ComSourceInterfaces(typeof(IMESHelper))]
+    [ClassInterface(ClassInterfaceType.None)]
+    [ProgId("UMESDLLService.MESHelper")]
+    public class MESHelper : IMESHelper
+    {
+        //用于拼接SQL 
+        StringBuilder sql = new StringBuilder();
+        //用于存放批量执行的SQL
+        List<string> sqls = new List<string>();
+        //系统默认的的连接字符串
+        private string ConnectionStrings = "Data Source=81.71.42.91/orcl;User ID=MES;PassWord=select!#%*(;";
+        //用户选择的数据库的连接字符串
+        private OracleConnection connection;
+        //用户选择的数据库的连接字符串
+        private OracleCommand command = null;
+
+        DataTable MasterDB;
+
+        public MESHelper()
+        {
+            connection = new OracleConnection(ConnectionStrings);
+        }
+
+        /// <summary>
+        /// 检测当前的岗位资源对应的工序
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("序列号对应工序检测")]
+        public bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { "", iResCode, iSN, "", "", "", oErrMessage };
+            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
+            CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
+            oErrMessage = param[6];
+            DataTable dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id=(  select max(ms_id) from makeserial where ms_sncode  in ( select '" + iSN + "' from dual union select sn from makesnrelation where beforesn='" + iSN + "' and sn<>' '  union select beforesn from makesnrelation where sn='" + iSN + "' and beforesn<>' '))", "select");
+            string ms_status = "";
+            string ms_stepcode = "";
+            string ms_nextstepcode = "";
+            if (dt.Rows.Count > 0)
+            {
+                ms_status = dt.Rows[0]["ms_status"].ToString();
+                ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+            }
+            string stepcode = GetStepCodeBySource(iResCode);
+            if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
+            {
+                oErrMessage = "当前序列号下一工序" + ms_nextstepcode;
+                return false;
+            }
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && stepcode == ms_stepcode))
+            {
+                if (ms_status == "3")
+                {
+                    oErrMessage = "";
+                }
+                return true;
+            }
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 检测当前的岗位资源对应的工序
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("序列号对应工序检测,不允许测试NG序列号")]
+        public bool CheckRoutePassed_OnlyOK(string iSN, string iResCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { "", iResCode, iSN, "", "", "", oErrMessage };
+            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
+            CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
+            oErrMessage = param[6];
+            DataTable dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id=(  select max(ms_id) from makeserial where ms_sncode  in ( select '" + iSN + "' from dual union select sn from makesnrelation where beforesn='" + iSN + "' and sn<>' '  union select beforesn from makesnrelation where sn='" + iSN + "' and beforesn<>' '))", "select");
+            string ms_status = "";
+            string ms_stepcode = "";
+            string ms_nextstepcode = "";
+            if (dt.Rows.Count > 0)
+            {
+                ms_status = dt.Rows[0]["ms_status"].ToString();
+                ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+            }
+            string stepcode = GetStepCodeBySource(iResCode);
+            if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
+            {
+                oErrMessage = "当前序列号下一工序" + ms_nextstepcode;
+                return false;
+            }
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && stepcode == ms_stepcode))
+            {
+                return true;
+            }
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 验证用户身份信息
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        private bool CheckUserLogin(string iUserCode, string iPassWord, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "select em_code from employee where em_code=:UserName and em_password =:PassWord";
+            DataTable dt;
+            dt = (DataTable)ExecuteSql(SQL, "select", iUserCode, iPassWord);
+            if (dt.Rows.Count > 0)
+                return true;
+            else
+            {
+                oErrorMessage = "用户名或者密码不正确!";
+                return false;
+            }
+        }
+
+        [Description("获取工单软件版本")]
+        public bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage)
+        {
+            string oMakeCode = "";
+            oErrMessage = "";
+            GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage);
+            oSoftVersion = getFieldDataByCondition("make", "ma_softversion", "ma_code='" + oMakeCode + "'").ToString();
+            return true;
+        }
+
+        [Description("获取SN关联采集信息")]
+        public bool GetProductRelation(string iSN, out string oWIFI, out string oBT, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oNetCode, out string oMEID, out string oErrMessage)
+        {
+            oWIFI = "";
+            oBT = "";
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oIMEI3 = "";
+            oNetCode = "";
+            oMEID = "";
+            string oMakeCode = "";
+            if (GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage))
+            {
+                DataTable dt = (DataTable)ExecuteSql("select mal_mac,mal_bt from makeaddresslist where mal_makecode='" + oMakeCode + "' and rownum=1 ", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    if (dt.Rows[0]["mal_mac"].ToString() != "")
+                    {
+                        oWIFI = "Required";
+                    }
+                    if (dt.Rows[0]["mal_bt"].ToString() != "")
+                    {
+                        oBT = "Required";
+                    }
+                }
+                dt = (DataTable)ExecuteSql("select mil_imei1,mil_imei2,mil_imei3,mil_netcode,mil_meid from makeimeilist where mil_makecode='" + oMakeCode + "' and rownum=1", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    if (dt.Rows[0]["mil_imei1"].ToString() != "")
+                    {
+                        oIMEI1 = "Required";
+                    }
+                    if (dt.Rows[0]["mil_imei2"].ToString() != "")
+                    {
+                        oIMEI2 = "Required";
+                    }
+                    if (dt.Rows[0]["mil_imei3"].ToString() != "")
+                    {
+                        oIMEI3 = "Required";
+                    }
+                    if (dt.Rows[0]["mil_netcode"].ToString() != "")
+                    {
+                        oNetCode = "Required";
+                    }
+                    if (dt.Rows[0]["mil_meid"].ToString() != "")
+                    {
+                        oMEID = "Required";
+                    }
+                }
+                return true;
+            }
+            else return false;
+        }
+
+        /// <summary>
+        /// 验证用户身份信息和岗位资源
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("验证身份信息")]
+        public bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage)
+        {
+            oErrMessage = "";
+            if (iUserCode == "" || iPassWord == "" || iResCode == "")
+            {
+                oErrMessage = "用户名,密码,岗位资源必须填写";
+                return false;
+            }
+            if (CheckUserLogin(iUserCode, iPassWord, out oErrMessage))
+            {
+                string SQL = "select em_code,em_type,em_name from employee where em_code=:UserName ";
+                DataTable dt;
+                dt = (DataTable)ExecuteSql(SQL, "select", iUserCode);
+                if (dt.Rows.Count > 0)
+                {
+                    string em_name = dt.Rows[0]["em_name"].ToString();
+                    string em_type = dt.Rows[0]["em_type"].ToString();
+                    if (iResCode == "")
+                    {
+                        oErrMessage = "岗位资源不允许为空";
+                        return false;
+                    }
+                    if (em_type == "admin")
+                    {
+                        if (CheckExist("Source", "sc_code='" + iResCode + "' and sc_statuscode='AUDITED'"))
+                        {
+                            return true;
+                        }
+                        else
+                        {
+                            oErrMessage = "岗位资源编号错误或者未审核!";
+                            return false;
+                        }
+                    }
+                    else
+                    {
+                        dt = getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "eg_emcode = '" + iUserCode + "' and sc_statuscode='AUDITED'");
+                        //如果存在该编号
+                        if (dt.Rows.Count > 0)
+                        {
+                            //判断如果多个岗位资源存在,用户输入的只要在其中就行
+                            for (int i = 0; i < dt.Rows.Count; i++)
+                            {
+                                if (dt.Rows[i]["ur_resourcecode"].ToString() == iResCode)
+                                    return true;
+                            }
+                            oErrMessage = "用户不处于当前资源所属分组!";
+                        }
+                        else
+                            oErrMessage = "岗位资源编号错误或者未审核!";
+                    }
+                }
+                else
+                    oErrMessage = "用户不存在!";
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 分配Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="oWIFI"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCdoe3"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("分配MAC和BT信息")]
+        public bool GetAddressRangeByMO(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrMessage)
+        {
+            oWIFI = "";
+            oBT = "";
+            oCode1 = "";
+            oCode2 = "";
+            oCdoe3 = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string omakeCode = "";
+            GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
+            string[] param = new string[] { iSN, omakeCode, oWIFI, oBT, oCode1, oCode2, oCdoe3, oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_macode", "v_o_mac", "v_o_bt", "v_o_code1", "v_o_code2", "v_o_code3", "v_o_errmsg" };
+            CallProcedure("CS_GETADDRESSBYMAKECODE", ParamName, ref param);
+            oWIFI = param[2];
+            oBT = param[3];
+            oCode1 = param[4];
+            oCode2 = param[5];
+            oCdoe3 = param[6];
+            oErrMessage = param[7];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
+        /// 如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oID1"></param>
+        /// <param name="oID2"></param>
+        /// <param name="oID3"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("分配IMEI和NetCode信息")]
+        public bool GetMEIOrNetCodeRange(string iSN, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage)
+        {
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oMEID = "";
+            oNetCode = "";
+            oPSN = "";
+            oID1 = "";
+            oID2 = "";
+            oID3 = "";
+            oID4 = "";
+            oID5 = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iSN, "", iIMEI1, iNetCode, oIMEI1, oIMEI2, "", oMEID, oNetCode, oPSN, oID1, oID2, oID3, oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_macode", "v_i_imei", "v_i_netcode", "v_o_imei1", "v_o_imei2", "v_o_imei3", "v_o_meid", "v_o_netcode", "v_o_psn", "v_o_id1", "v_o_id2", "v_o_id3", "v_o_errmsg" };
+            CallProcedure("CS_GETIMEIORNETCODERANGE", ParamName, ref param);
+            oIMEI1 = param[4];
+            oIMEI2 = param[5];
+            oMEID = param[7];
+            oNetCode = param[8];
+            oPSN = param[9];
+            oID1 = param[10];
+            oID2 = param[11];
+            oID3 = param[12];
+            oErrMessage = param[13];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 获取工单的最近一条执行记录
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="oMoCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("获取序列号对应工单信息")]
+        public bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage)
+        {
+            //取MakeProcess表中的执行记录ID最大的一个工单的号码
+            oMoCode = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            sql.Clear();
+            sql.Append("select max(ms_id) from makeserial where ms_sncode in (select '" + iSN + "' from dual union select sn from ");
+            sql.Append("makesnrelation where beforesn='" + iSN + "' and sn<>' '  union select beforesn from makesnrelation where sn='" + iSN + "' and beforesn<>' ')");
+            DataTable dt = (DataTable)ExecuteSql(sql.ToString(), "select");
+            string ms_id = dt.Rows[0][0].ToString();
+            oMoCode = getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
+            if (oMoCode != "")
+                return true;
+            else
+            {
+                oErrMessage = "序列号:" + iSN + " 未归属工单";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 获取序列号的所有串号信息
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="oWIFI"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCode3"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oID1"></param>
+        /// <param name="oID2"></param>
+        /// <param name="oID3"></param>
+        /// <param name="oID4"></param>
+        /// <param name="oID5"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("查询已分配的信息")]
+        public bool GetMobileAllInfo(string iSN, out string oWIFI, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oIMEI1, out string oIMEI2, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oID4, out string oID5, out string oErrMessage)
+        {
+            oBT = "";
+            oMEID = "";
+            oWIFI = "";
+            oPSN = "";
+            oNetCode = "";
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oCode1 = "";
+            oCode2 = "";
+            oCode3 = "";
+            oID1 = "";
+            oID2 = "";
+            oID3 = "";
+            oID4 = "";
+            oID5 = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            //通过序列号获取最近操作的工单号
+            string ms_id = getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + iSN + "'").ToString();
+            if (ms_id != "")
+            {
+                DataTable dt = getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    oWIFI = dt.Rows[0]["ms_mac"].ToString();
+                    oBT = dt.Rows[0]["ms_bt"].ToString();
+                    oPSN = dt.Rows[0]["ms_psn"].ToString();
+                    oNetCode = dt.Rows[0]["ms_netcode"].ToString();
+                    oMEID = dt.Rows[0]["ms_meid"].ToString();
+                    oIMEI1 = dt.Rows[0]["ms_imei1"].ToString();
+                    oIMEI2 = dt.Rows[0]["ms_imei2"].ToString();
+                    oCode1 = dt.Rows[0]["ms_othcode1"].ToString();
+                    oCode2 = dt.Rows[0]["ms_othcode2"].ToString();
+                    oCode3 = dt.Rows[0]["ms_othcode3"].ToString();
+                    oID1 = dt.Rows[0]["ms_othid3"].ToString();
+                    oID2 = dt.Rows[0]["ms_othid3"].ToString();
+                    oID3 = dt.Rows[0]["ms_othid3"].ToString();
+                    oErrMessage = "";
+                    return true;
+                }
+                else
+                {
+                    oErrMessage = "序列号" + iSN + "不存在";
+                    return false;
+                }
+            }
+            else
+            {
+                oErrMessage = "序列号" + iSN + "不存在";
+                return false;
+            }
+        }
+
+
+
+
+        /// <summary>
+        /// 记录操作日志
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iMPKind"></param>
+        /// <param name="result"></param>
+        /// <param name="iUserCode"></param>
+        private void InsertMakeProcess(string iSnCode, string iMakeCode, string iSourceCode, string iMPKind, string result, string iUserCode)
+        {
+            string CurrentStep = "";
+            string LineCode = "";
+            string CurrentStepName = "";
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref CurrentStep, ref CurrentStepName, ref LineCode);
+            sql.Length = 0;
+            sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
+            sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
+            sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,'" + CurrentStep + "','" + CurrentStepName + "',");
+            sql.Append("ma_craftcode,ma_craftname,'" + iMPKind + "','" + result + "',sysdate,'" + iUserCode + "',ma_wccode,'" + LineCode + "','" + iSourceCode + "',");
+            sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makeserial on ms_makecode=ma_code left join step on st_code=ms_stepcode ");
+            sql.Append("where ms_sncode='" + iSnCode + "' and ma_code='" + iMakeCode + "' and st_code='" + CurrentStep + "'");
+            ExecuteSql(sql.ToString(), "insert");
+        }
+
+        /// <summary>
+        /// 保存Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iWIFI"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iCode1"></param>
+        /// <param name="iCode2"></param>
+        /// <param name="iCode3"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("写入SN的Wifi,BT信息")]
+        public bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iSN, iWIFI, iBT, iCode1, iCode2, iCode3, oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_mac", "v_i_bt", "v_i_code1", "v_i_code2", "v_i_code3", "v_o_errmsg" };
+            CallProcedure("CS_SETADDRESSINFO", ParamName, ref param);
+            oErrMessage = param[6];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        [Description("序列号跳到下一 步")]
+        public bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string StepCode = getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'").ToString();
+            string CurrentStep = GetStepCodeBySource(iSourceCode);
+            string BgCode = getFieldDataByCondition("step", "st_badgroupcode", "st_code='" + CurrentStep + "'").ToString();
+            switch (iResult)
+            {
+                case "OK":
+                    break;
+                case "NG":
+                    if (iErrCode == "")
+                    {
+                        oErrMessage = "测试结果为NG时必须传递不良代码";
+                        return false;
+                    }
+                    else
+                    {
+                        UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='" + iMakeCode + "' and mb_stepcode='" + CurrentStep + "' and mb_status=0");
+                        string[] BadCode = iErrCode.Split(',');
+                        List<string> InsertSQL = new List<string>();
+                        for (int i = 0; i < BadCode.Length; i++)
+                        {
+                            string mb_id = GetSEQ("makebad_seq");
+                            sql.Length = 0;
+                            sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
+                            sql.Append(",mb_sourcecode,mb_badcode,mb_badtable,mb_bgcode,mb_soncode,mb_status) select '" + mb_id + "'");
+                            sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + CurrentStep + "','" + iSourceCode + "',:bc_code,'',");
+                            sql.Append("'" + BgCode + "',sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
+                            sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+                            InsertSQL.Add(sql.ToString().Replace(":bc_code", "'" + (BadCode[i].IndexOf("|") > 0 ? BadCode[i].Split('|')[0] : BadCode[i]) + "'"));
+                            //如果含有不良位号的则进行插入
+                            if (BadCode[i].IndexOf("|") > 0)
+                            {
+                                //使用|来分割不良代码和位号
+                                string badloc = BadCode[i].Split('|')[1];
+                                //获取多个位号
+                                string[] balocstr = badloc.Split('#');
+                                for (int j = 0; j < balocstr.Length; j++)
+                                {
+                                    //插入不良位号
+                                    sql.Length = 0;
+                                    sql.Append("insert into MAKEBADRSLOC(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,mbl_sncode,mbl_makecode,mbl_indate,mbl_inman)");
+                                    sql.Append("values(MAKEBADRSLOC_seq.nextval,'" + mb_id + "','" + balocstr[j] + "','" + BadCode[i].Split('|')[0] + "','" + BadCode[i].Split('|')[0] + "','" + iSN + "','" + iMakeCode + "',sysdate,'" + iUserCode + "')");
+                                    InsertSQL.Add(sql.ToString());
+                                }
+                            }
+                        }
+                        ExecuteSQLTran(InsertSQL.ToArray());
+                        //将不良的序列号的状态码设为3
+                        ExecuteSql("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'", "update");
+                    }
+                    break;
+                default:
+                    oErrMessage = "测试结果必须为NG或者OK";
+                    return false;
+            }
+            //不良采集为良品是更新
+            if (StepCode == CurrentStep && iResult == "OK")
+            {
+                DataTable dt = getFieldsDataByCondition("makeserial", new string[] { "ms_status", "ms_craftcode", "ms_prodcode" }, "ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string ms_status = dt.Rows[0]["ms_status"].ToString();
+                    string ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
+                    string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
+                    if (ms_status == "3")
+                    {
+                        string nextstepcode = getFieldDataByCondition("craft left join craftdetail on cr_id=cd_crid ", "cd_nextstepcode", "cr_code='" + ms_craftcode + "' and cr_prodcode='" + ms_prodcode + "' and cd_stepcode='" + CurrentStep + "'").ToString();
+                        UpdateByCondition("makeserial", "ms_status=1,ms_nextstepcode='" + nextstepcode + "'", "ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'");
+                        UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='" + iMakeCode + "'");
+                    }
+                }
+            }
+            return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrMessage);
+        }
+
+        [Description("获取账套信息")]
+        public bool GetMaster(out string oMaster)
+        {
+            MasterDB = (DataTable)ExecuteSql("select ms_pwd,ma_user,ma_address from master", "select");
+            oMaster = "";
+            for (int i = 0; i < MasterDB.Rows.Count; i++)
+            {
+                if (i != MasterDB.Rows.Count - 1)
+                    oMaster += MasterDB.Rows[i]["ma_user"].ToString() + "|";
+                else
+                    oMaster += MasterDB.Rows[i]["ma_user"].ToString();
+            }
+            return true;
+        }
+
+        [Description("设置账套信息")]
+        public bool SetMaster(string iMaster)
+        {
+            DataTable dt = (DataTable)ExecuteSql("select ms_pwd,ma_user,ma_address,ma_inneraddress from master where ma_user='" + iMaster + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                ConnectionStrings = "Data Source=" + dt.Rows[0]["ma_inneraddress"].ToString() + "/orcl;User ID=" + iMaster + ";PassWord=" + dt.Rows[0]["ms_pwd"].ToString() + ";";
+                try
+                {
+                    connection = new OracleConnection(ConnectionStrings);
+                }
+                catch (Exception)
+                {
+                    return false;
+                }
+                return true;
+            }
+            return false;
+        }
+
+        /// <summary>
+        /// 设置测试结果
+        /// </summary>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iSN"></param>
+        /// <param name="iOperater"></param>
+        /// <param name="iResult"></param>
+        /// <param name="iUserCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        [Description("设置测试结果,结果必须为NG或者OK")]
+        public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperater, string iResult, string iErrCode, string flag, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            if (iTSN == "") { oErrorMessage = "TSN不能为空"; return false; }
+            if (iSN == "") { oErrorMessage = "SN不能为空"; return false; }
+            string[] param = new string[] { iTSN, iSN, iSourceCode, iOperater, iResult, iErrCode, oErrorMessage };
+            string[] ParamName = new string[] { "v_i_tsn", "v_i_sncode", "v_i_sourcecode", "v_i_usercode", "v_i_result", "v_i_errcode", "v_o_errmsg" };
+            CallProcedure("CS_DLLSNCHANGE", ParamName, ref param);
+            oErrorMessage = param[6];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, iResult, oErrMessage };
+            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_i_result", "v_o_errmsg" };
+            CallProcedure("CS_SETSTEPRESULT", ParamName, ref param);
+            oErrMessage = param[5];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 方法说明:测试详细信息录入系统,针对一个SN多个测试项目结果可循环调用
+        /// </summary>
+        /// <param name="iSN">序列号</param>
+        /// <param name="iClass"></param>
+        /// <param name="iSubClass1"></param>
+        /// <param name="iSubClass2"></param>
+        /// <param name="iSubClass3"></param>
+        /// <param name="iMaxValue"></param>
+        /// <param name="iMinValue"></param>
+        /// <param name="iActualValue"></param>
+        /// <param name="iValue1"></param>
+        /// <param name="iValue2"></param>
+        /// <param name="iValue3"></param>
+        /// <param name="iTestResult"></param>
+        /// <param name="oErrMessage"></param>                                                      
+        /// <returns></returns>
+        [Description("设置测试结果")]
+        public bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[] iTestDetail, out string oErrMessage)
+        {
+            if (iSN == "" || iSN == null)
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string omakeCode = "";
+            GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
+            sql.Clear();
+            sql.Append("begin ");
+            for (int i = 0; i < iTestDetail.Length; i++)
+            {
+                sql.Append("Insert into STEPTESTDETAIL (STD_ID,STD_CLASS,STD_SN,STD_MAKECODE,STD_ACTUALVALUE,STD_TESTRESULT,STD_INDATE,STD_RESCODE)");
+                sql.Append("values(STEPTESTDETAIL_SEQ.nextval,'ITEM" + i + "','" + iSN + "','" + omakeCode + "','" + iTestDetail[i] + "','" + iTestResult + "',sysdate,'" + iResCode + "');");
+            }
+            sql.Append("end;");
+            ExecuteSql(sql.ToString(), "insert");
+            return true;
+        }
+
+        /// <summary>
+        /// 作业调用该方法将确认接收SN对应的IMEI及附属信息。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMO"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iIMEI2"></param>
+        /// <param name="iIMEI3"></param>
+        /// <param name="iMEID"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="iPSN"></param>
+        /// <param name="iID1"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iID1"></param>
+        /// <param name="iID2"></param>
+        /// <param name="iID3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        [Description("设置IMEI信息")]
+        public bool SetIMEIInfo(string iSN, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iNET, string iID1, string iID2, string iID3, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string[] param = new string[] { iSN, iIMEI1, iIMEI2, iIMEI3, iMEID, iNET, "", iID1, iID2, iID3, oErrMessage };
+            string[] ParamName = new string[] { "v_i_sncode", "v_i_imei1", "v_i_imei2", "v_i_imei3", "v_i_meid", "v_i_netcode", "v_i_psn", "v_i_id1", "v_i_id2", "v_i_id3", "v_o_errmsg" };
+            CallProcedure("CS_SETIMEIINFO", ParamName, ref param);
+            oErrMessage = param[10];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="iOperator"></param>
+        /// <param name="iResult"></param>
+        /// <param name="iErrCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("设置测试结果")]
+        public bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage)
+        {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            oErrMessage = "";
+            string oMakeCode = "";
+            GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage);
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return SetStepFinish(oMakeCode, iResCode, iSN, "", iResult, iOperator, iErrCode, out oErrMessage);
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 序列号归属工单
+        /// </summary>
+        /// <param name="iMO"></param>
+        /// <param name="iSN"></param>
+        /// <param name="iResCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        [Description("序列号归属工单")]
+        public bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage)
+        {
+            oErrMessage = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            if (CheckExist("makeserial", "ms_sncode='" + iSN + "' and ms_makecode='" + iMO + "'"))
+            {
+                oErrMessage = "SN" + iSN + "已存在于工单" + iMO;
+                return false;
+            }
+            string[] param = new string[] { iMO, iResCode, iSN, "", "", "", oErrMessage };
+            string[] ParamName = new string[] { "v_i_macode", "v_i_sourcecode", "v_i_sncode", "v_i_usercode", "v_o_macode", "v_o_msid", "v_o_errmsg" };
+            CallProcedure("CS_CHECKSTEPSNANDMACODE", ParamName, ref param);
+            oErrMessage = param[6];
+            DataTable dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + iSN + "')", "select");
+            string ms_status = "";
+            string ms_stepcode = "";
+            string ms_nextstepcode = "";
+            if (dt.Rows.Count > 0)
+            {
+                ms_status = dt.Rows[0]["ms_status"].ToString();
+                ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+            }
+            string stepcode = GetStepCodeBySource(iResCode);
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && ms_stepcode == stepcode))
+            {
+                if (ms_status == "3")
+                {
+                    oErrMessage = "";
+                }
+                return true;
+            }
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 获取执行步骤代码,名称和线别
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        /// <param name="LineCode"></param>
+        private void GetStepCodeAndNameAndLineBySource(string Source, ref string StepCode, ref string StepName, ref string LineCode)
+        {
+            DataTable dt = getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+                LineCode = dt.Rows[0]["sc_linecode"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码和名称
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        private void GetStepCodeAndNameBySource(string Source, ref string StepCode, ref string StepName)
+        {
+            DataTable dt = getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <returns></returns>
+        private string GetStepCodeBySource(string Source)
+        {
+            return getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + Source + "'").ToString();
+        }
+
+        /// <summary>
+        /// 获取第一行第一列的信息
+        /// </summary>
+        private object getFieldDataByCondition(string TableName, string Field, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select " + Field + " from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter();
+            ad.SelectCommand = command;
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            if (dt.Rows.Count > 0)
+            {
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                return "";
+            }
+        }
+
+        /// <summary>
+        /// 通过表名和获取单行的记录
+        /// </summary>
+        private DataTable getFieldsDataByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition + " and rownum=1";
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段和条件获取DataTable类型的数据
+        /// </summary>
+        private DataTable getFieldsDatasByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段获取DataTable类型的数据
+        /// </summary>
+        private DataTable getFieldsDatas(string TableName, string Fields)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += Fields;
+            sql += " from " + TableName;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.SelectCommand = command;
+            try
+            {
+                ad.Fill(dt);
+            }
+            catch (Exception)
+            {
+                connection = new OracleConnection(ConnectionStrings);
+                connection.Open();
+                command = new OracleCommand(sql, connection);
+                ad = new OracleDataAdapter();
+                ad.SelectCommand = command;
+                ad.Fill(dt);
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 检测内容是否存在
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="Condition"></param>
+        /// <returns></returns>
+        private bool CheckExist(string TableName, string Condition)
+        {
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            DataTable dt = new DataTable();
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString()) > 0;
+        }
+
+        /// <summary>
+        /// 直接执行SQL,同时传入SQL的类型
+        /// </summary>
+        /// <param name="SQL"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        private object ExecuteSql(string SQL, string Type, params object[] names)
+        {
+            object result = null;
+            command = new OracleCommand(SQL, connection);
+            Reconnect(command);
+            //用来拼接参数的
+            if (names.Length > 0)
+            {
+                string[] par = SQL.Split(':');
+                //用来存参数的数组
+                StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+                for (int i = 0; i < par.Length - 1; i++)
+                {
+                    //新建一个char类型的数组用来存储每个字节的变量
+                    char[] c = par[i + 1].ToCharArray();
+                    addpar[i] = new StringBuilder();
+                    for (int j = 0; j < c.Length; j++)
+                    {
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
+                        {
+                            addpar[i].Append(c[j]);
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                }
+                for (int i = 0; i < addpar.Length; i++)
+                {
+                    command.Parameters.Add(new OracleParameter(addpar[i].ToString(), names[i]));
+                }
+            }
+            switch (Type.ToUpper())
+            {
+                case "SELECT":
+                    OracleDataAdapter ad = new OracleDataAdapter(command);
+                    result = new DataTable();
+                    try
+                    {
+                        ad.Fill((DataTable)result);
+                    }
+                    catch (Exception)
+                    {
+                        connection = new OracleConnection(ConnectionStrings);
+                        connection.Open();
+                        command = new OracleCommand(SQL, connection);
+                        ad = new OracleDataAdapter();
+                        ad.SelectCommand = command;
+                        ad.Fill((DataTable)result);
+                    }
+                    break;
+                case "DELETE":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+                case "UPDATE":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+                case "INSERT":
+                    try
+                    {
+                        result = command.ExecuteNonQuery();
+                    }
+                    catch (Exception)
+                    {
+                        command.Connection = new OracleConnection(ConnectionStrings);
+                        command.Connection.Open();
+                        result = command.ExecuteNonQuery();
+                    }
+                    break;
+            }
+            command.Dispose();
+            return result;
+        }
+
+        /// <summary>
+        /// 出现异常进行回滚的执行方法
+        /// </summary>
+        /// <param name="SQL"></param>
+        private void ExecuteSQLTran(params string[] SQL)
+        {
+            command = new OracleCommand();
+            command.Connection = new OracleConnection(ConnectionStrings);
+            command.Connection.Open();
+            Reconnect(command);
+            OracleTransaction tx = command.Connection.BeginTransaction(IsolationLevel.ReadCommitted);
+            command.Transaction = tx;
+            try
+            {
+                foreach (string sql in SQL)
+                {
+                    if (!string.IsNullOrEmpty(sql))
+                    {
+                        command.CommandText = sql;
+                        command.ExecuteNonQuery();
+                    }
+                }
+                tx.Commit();
+            }
+            catch (OracleException E)
+            {
+                tx.Rollback();
+                throw new Exception(E.Message);
+            }
+            command.Dispose();
+        }
+
+        private string UpdateByCondition(string TableName, string update, string condition)
+        {
+            string sql = "update " + TableName + " set " + update + " where " + condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
+            command.Dispose();
+            return sql;
+        }
+
+        private void CallProcedure(string ProcedureName, string[] ParamName, ref string[] param)
+        {
+            command = new OracleCommand(ProcedureName);
+            command.Connection = connection;
+            Reconnect(command);
+            command.CommandText = ProcedureName;
+            command.CommandType = CommandType.StoredProcedure;
+            for (int i = 0; i < param.Length; i++)
+            {
+                command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
+                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
+            }
+            try
+            {
+                command.ExecuteNonQuery();
+            }
+            catch (Exception)
+            {
+                command.Connection = new OracleConnection(ConnectionStrings);
+                command.Connection.Open();
+                command.ExecuteNonQuery();
+            }
+            for (int i = 0; i < command.Parameters.Count; i++)
+                param[i] = command.Parameters[i].Value.ToString();
+            command.Dispose();
+        }
+
+        private string AddField(string[] Fields)
+        {
+            string sql = " ";
+            foreach (string field in Fields)
+            {
+                sql += field + ",";
+            }
+            return sql.Substring(0, sql.Length - 1);
+        }
+
+        private string[] GetField(string field)
+        {
+            string[] fields = field.Split(',');
+            for (int i = 0; i < fields.Length; i++)
+            {
+                fields[i] = fields[i].Substring(fields[i].LastIndexOf("as") + 2, fields[i].Length - fields[i].LastIndexOf("as") - 2).Trim();
+            }
+            return fields;
+        }
+
+        private void Reconnect(OracleCommand cmd)
+        {
+            if (cmd.Connection.State == ConnectionState.Closed)
+            {
+                cmd.Connection.Open();
+            }
+        }
+
+        private string GetSEQ(string SeqName)
+        {
+            DataTable dt = new DataTable();
+            dt = (DataTable)ExecuteSql("SELECT " + SeqName + ".NEXTVAL FROM DUAL", "select");
+            return dt.Rows[0][0].ToString();
+        }
+
+        [Description("获取上料信息")]
+        public bool GetMaterialInfo(string iSN, out string oResult, out string oErrMessage)
+        {
+            JavaScriptSerializer jss = new JavaScriptSerializer();
+            Dictionary<string, string> oInfo = new Dictionary<string, string>();
+            oErrMessage = "";
+            oResult = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
+            Dictionary<string, string> MacInfo = new Dictionary<string, string>();
+            //通过序列号获取最近操作的工单号
+            string ms_id = getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + iSN + "' or ms_firstsn='" + iSN + "'").ToString();
+            if (ms_id != "")
+            {
+                DataTable dt = getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string Code1 = "";
+                    string Code2 = "";
+                    string Code3 = "";
+                    string Code4 = "";
+                    string Code5 = "";
+                    string Code6 = "";
+                    string Code7 = "";
+                    string Code8 = "";
+                    string Code9 = "";
+                    string Code10 = "";
+                    string Code11 = "";
+                    string Code12 = "";
+                    string Code13 = "";
+                    string Code14 = "";
+                    string Code15 = "";
+                    string[] param = new string[] { ms_id, Code1, Code2, Code3, Code4, Code5, Code6, Code7, Code8, Code9, Code10, Code11, Code12, Code13, Code14, Code15 };
+                    string[] ParamName = new string[] { "v_ms_id", "v_i_code1", "v_i_code2", "v_i_code3", "v_i_code4", "v_i_code5", "v_i_code6", "v_i_code7", "v_i_code8", "v_i_code9", "v_i_code10", "v_i_code11", "v_i_code12", "v_i_code13", "v_i_code14", "v_i_code15" };
+                    CallProcedure("GetMaterialInfo", ParamName, ref param);
+                    for (int i = 1; i < param.Length; i++)
+                    {
+                        //获取出来的参数使用^分割
+                        if (param[i] != "" && param[i] != "null" && param[i] != null)
+                        {
+                            oInfo.Add(param[i].Split('^')[0], param[i].Split('^')[1]);
+                        }
+                    }
+                    oResult = jss.Serialize(oInfo);
+                    oErrMessage = "";
+                    return true;
+                }
+                else
+                {
+                    oErrMessage = "序列号" + iSN + "不存在";
+                    return false;
+                }
+            }
+            else
+            {
+                oErrMessage = "序列号" + iSN + "不存在";
+                return false;
+            }
+        }
+
+
+        [Description("获取打印路径")]
+        public bool GetPrintLabel(string iSN, out string oResult, out string oErrMessage)
+        {
+            oResult = "";
+            oErrMessage = "";
+            string ms_id = getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + iSN + "' or ms_firstsn='" + iSN + "'").ToString();
+            if (ms_id == "")
+            {
+                oErrMessage = "SN" + iSN + "不存在";
+                return false;
+            }
+            string prcode = getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id=" + ms_id).ToString();
+            DataTable dt = (DataTable)ExecuteSql("select la_templatetype,la_url from label where la_prodcode='" + prcode + "' and la_statuscode='AUDITED'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    oResult = dt.Rows[i]["la_templatetype"].ToString() + "^" + dt.Rows[i]["la_url"].ToString() + "#";
+                }
+                if (oResult.IndexOf("#") > 0)
+                {
+                    oResult = oResult.Substring(0, oResult.Length - 1);
+                }
+            }
+            else
+            {
+                oErrMessage = "产品" + prcode + "未维护标签";
+                return false;
+            }
+            return true;
+        }
+
+        [Description("获取序列号")]
+        public bool GetSNList(string iMaCode, out string[] TSN_List, out string[] SN_List, out string[] TSN_Rule, out string[] SN_Rule, out string oErrMessage)
+        {
+            TSN_List = null;
+            SN_List = null;
+            TSN_Rule = null;
+            SN_Rule = null;
+            if (!CheckExist("Make", "ma_code='" + iMaCode + "'"))
+            {
+                oErrMessage = "工单号" + iMaCode + "不存在";
+                return false;
+            }
+            //导入前的清单
+            DataTable listbefore = (DataTable)ExecuteSql("select msl_sncode from makesnlist where msl_makecode='" + iMaCode + "' and msl_type='before' and nvl(msl_status,0)=0  order by msl_sncode", "select");
+            List<string> _TSN = new List<string>();
+            for (int i = 0; i < listbefore.Rows.Count; i++)
+            {
+                _TSN.Add(listbefore.Rows[i]["msl_sncode"].ToString());
+            }
+            TSN_List = _TSN.ToArray();
+
+            //导入后的清单
+            DataTable listafter = (DataTable)ExecuteSql("select msl_sncode from makesnlist where msl_makecode='" + iMaCode + "' and msl_type='after' and nvl(msl_status,0)=0 and msl_sncode not in (select ms_firstsn from makeserial where ms_makecode='"+iMaCode+"')  order by msl_sncode", "select");
+            List<string> _SN = new List<string>();
+            for (int i = 0; i < listafter.Rows.Count; i++)
+            {
+                _SN.Add(listafter.Rows[i]["msl_sncode"].ToString());
+            }
+            SN_List = _SN.ToArray();
+
+            //转换前的规则
+            DataTable rulebefore = (DataTable)ExecuteSql("select msd_sncode from MAKESNRULEDETAIL where msd_makecode='" + iMaCode + "' and msd_type='before' and nvl(msd_status,0)=0 and msd_sncode not in (select ms_firstsn from makeserial where ms_makecode='" + iMaCode + "') order by msd_sncode", "select");
+            List<string> _TSN_rule = new List<string>();
+            for (int i = 0; i < rulebefore.Rows.Count; i++)
+            {
+                _TSN_rule.Add(rulebefore.Rows[i]["msd_sncode"].ToString());
+            }
+            TSN_Rule = _TSN_rule.ToArray();
+
+            //转换后的规则
+            DataTable ruleafter = (DataTable)ExecuteSql("select msd_sncode from MAKESNRULEDETAIL where msd_makecode='" + iMaCode + "' and msd_type='after' and nvl(msd_status,0)=0 order by msd_sncode", "select");
+            List<string> _SN_rule = new List<string>();
+            for (int i = 0; i < ruleafter.Rows.Count; i++)
+            {
+                _SN_rule.Add(ruleafter.Rows[i]["msd_sncode"].ToString());
+            }
+            SN_Rule = _SN_rule.ToArray();
+
+            oErrMessage = "";
+            return true;
+        }
+    }
+}

+ 36 - 0
UAS_MesInterface_YD/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("UAS_MesInterface(4.0)")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("深圳市优软科技有限公司")]
+[assembly: AssemblyProduct("UAS_MesInterface(4.0)")]
+[assembly: AssemblyCopyright("Copyright ©  2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//将 ComVisible 设置为 false 将使此程序集中的类型
+//对 COM 组件不可见。  如果需要从 COM 访问此程序集中的类型,
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(true)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("a35f767d-0858-4061-af7c-c5c594034668")]
+
+// 程序集的版本信息由下列四个值组成: 
+//
+//      主版本
+//      次版本
+//      生成号
+//      修订号
+//
+//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
+// 方法是按如下所示使用“*”: :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 59 - 0
UAS_MesInterface_YD/UAS_MesInterface_YD.csproj

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{37747068-7ED1-4F09-A62F-B3C1E62A9F0F}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UMESDLLService</RootNamespace>
+    <AssemblyName>UMESDLLService</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <RegisterForComInterop>true</RegisterForComInterop>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Oracle.ManagedDataAccess">
+      <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data.OracleClient" />
+    <Reference Include="System.Web.Extensions" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="MesHelper.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

BIN
UAS_MesInterface_YD/tool/Oracle.ManagedDataAccess.dll