Browse Source

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

Hcsy 8 years ago
parent
commit
3f3b410dfd
51 changed files with 4458 additions and 664 deletions
  1. 1 1
      UAS-MES/App.config
  2. 15 2
      UAS-MES/Entity/SystemInf.cs
  3. 35 48
      UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs
  4. 17 13
      UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs
  5. 17 8
      UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs
  6. 0 1
      UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs
  7. 6 6
      UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs
  8. 40 12
      UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs
  9. 81 105
      UAS-MES/FunctionCode/Make/Make_PackageCollection.cs
  10. 41 12
      UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs
  11. 91 115
      UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs
  12. 29 8
      UAS-MES/FunctionCode/Make/Make_Repair.cs
  13. 39 15
      UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs
  14. 39 16
      UAS-MES/FunctionCode/Make/Make_SeqTransform.cs
  15. 899 0
      UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.Designer.cs
  16. 489 0
      UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs
  17. 291 0
      UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.resx
  18. 241 0
      UAS-MES/FunctionCode/Packing/Packing_CartonSplit.Designer.cs
  19. 239 0
      UAS-MES/FunctionCode/Packing/Packing_CartonSplit.cs
  20. 120 0
      UAS-MES/FunctionCode/Packing/Packing_CartonSplit.resx
  21. 114 84
      UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.Designer.cs
  22. 6 8
      UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs
  23. 67 100
      UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.Designer.cs
  24. 3 3
      UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs
  25. 3 3
      UAS-MES/Main.cs
  26. 11 11
      UAS-MES/Program.cs
  27. 1 1
      UAS-MES/Properties/Settings.Designer.cs
  28. 1 1
      UAS-MES/Properties/Settings.settings
  29. 2 2
      UAS-MES/PublicForm/ChangePwd.cs
  30. 4 5
      UAS-MES/PublicMethod/BaseUtil.cs
  31. 2 1
      UAS-MES/PublicMethod/LogManager.cs
  32. 1 12
      UAS-MES/PublicMethod/LogicHandler.cs
  33. 9 8
      UAS-MES/PublicMethod/ftpOperater.cs
  34. 6 0
      UAS_DLLTest/App.config
  35. 528 0
      UAS_DLLTest/Form1.Designer.cs
  36. 156 0
      UAS_DLLTest/Form1.cs
  37. 120 0
      UAS_DLLTest/Form1.resx
  38. 36 0
      UAS_DLLTest/GroupBoxwithborder.Designer.cs
  39. 72 0
      UAS_DLLTest/GroupBoxwithborder.cs
  40. 22 0
      UAS_DLLTest/Program.cs
  41. 36 0
      UAS_DLLTest/Properties/AssemblyInfo.cs
  42. 71 0
      UAS_DLLTest/Properties/Resources.Designer.cs
  43. 117 0
      UAS_DLLTest/Properties/Resources.resx
  44. 30 0
      UAS_DLLTest/Properties/Settings.Designer.cs
  45. 7 0
      UAS_DLLTest/Properties/Settings.settings
  46. 87 0
      UAS_DLLTest/UAS_DLLTest.csproj
  47. 128 45
      UAS_MesInterface(4.0)/MesHelper.cs
  48. 1 1
      UAS_MesInterface(4.0)/Properties/AssemblyInfo.cs
  49. 58 0
      UAS_MesInterface(4.0)/UAS_MesInterface(4.0).csproj
  50. 28 16
      UAS_MesInterface/MESHelper.cs
  51. 1 1
      UAS_MesInterface/UAS_MesDllService(3.5).csproj

+ 1 - 1
UAS-MES/App.config

@@ -37,7 +37,7 @@
         <value />
       </setting>
       <setting name="FTPAddress" serializeAs="String">
-        <value>ftp://172.16.11.99/print/|uasmes|Administrator1@#</value>
+        <value>\\172.16.11.99\ShareTest</value>
       </setting>
     </UAS_MES.Properties.Settings>
   </userSettings>

+ 15 - 2
UAS-MES/Entity/SystemInf.cs

@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
 
 namespace UAS_MES.Entity
 {
@@ -56,5 +57,17 @@ namespace UAS_MES.Entity
         /// 是否允许打印程序
         /// </summary>
         public static bool EnablePrint;
+        /// <summary>
+        /// 缓存数据的文件夹
+        /// </summary>
+        public static string CacheFolder= Environment.GetEnvironmentVariable("windir").Substring(0, 1)+@":\UAS_MES\CacheFile\";
+        /// <summary>
+        /// 日志文件的缓存路径
+        /// </summary>
+        public static string LogFolder = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\UAS_MES\Log\";
+        /// <summary>
+        /// 缓存的XML文件的路径和名称
+        /// </summary>
+        public static string CacheFilePath= Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\UAS_MES\CacheFile\CacheInfo.xml";
     }
-}
+}

+ 35 - 48
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs

@@ -50,10 +50,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(612, 23);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(459, 18);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 206;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -63,10 +62,9 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(33, 518);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Location = new System.Drawing.Point(25, 414);
             this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(72, 27);
+            this.sncode_label.Size = new System.Drawing.Size(58, 21);
             this.sncode_label.TabIndex = 205;
             this.sncode_label.Text = "录入框";
             // 
@@ -74,10 +72,9 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(305, 72);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(229, 58);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
-            this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
+            this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
             this.mcd_remainqty_label.TabIndex = 202;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -85,10 +82,9 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(36, 72);
-            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(27, 58);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_okqty_label.TabIndex = 201;
             this.mcd_okqty_label.Text = "采集计数";
             // 
@@ -96,10 +92,9 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(305, 23);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(229, 18);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 200;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -107,10 +102,9 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(36, 23);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(27, 18);
             this.ms_makecode_label.Name = "ms_makecode_label";
-            this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
+            this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_makecode_label.TabIndex = 199;
             this.ms_makecode_label.Text = "工单编号";
             // 
@@ -121,13 +115,12 @@
             this.DeleteButton.DownImage = ((System.Drawing.Image)(resources.GetObject("DeleteButton.DownImage")));
             this.DeleteButton.Image = null;
             this.DeleteButton.IsShowBorder = true;
-            this.DeleteButton.Location = new System.Drawing.Point(397, 518);
-            this.DeleteButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.DeleteButton.Location = new System.Drawing.Point(298, 414);
             this.DeleteButton.MoveImage = ((System.Drawing.Image)(resources.GetObject("DeleteButton.MoveImage")));
             this.DeleteButton.Name = "DeleteButton";
             this.DeleteButton.NormalImage = ((System.Drawing.Image)(resources.GetObject("DeleteButton.NormalImage")));
             this.DeleteButton.Power = null;
-            this.DeleteButton.Size = new System.Drawing.Size(80, 30);
+            this.DeleteButton.Size = new System.Drawing.Size(60, 24);
             this.DeleteButton.TabIndex = 213;
             this.DeleteButton.Text = "取消";
             this.DeleteButton.UseVisualStyleBackColor = false;
@@ -138,20 +131,20 @@
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(143, 23);
-            this.ms_makecode.MaximumSize = new System.Drawing.Size(267, 0);
+            this.ms_makecode.Location = new System.Drawing.Point(107, 18);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
+            this.ms_makecode.Size = new System.Drawing.Size(0, 21);
             this.ms_makecode.TabIndex = 212;
             // 
             // mcd_remainqty
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(417, 72);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(313, 58);
             this.mcd_remainqty.Name = "mcd_remainqty";
-            this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
+            this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_remainqty.TabIndex = 210;
             this.mcd_remainqty.Text = "0";
             // 
@@ -159,10 +152,9 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(143, 72);
-            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty.Location = new System.Drawing.Point(107, 58);
             this.mcd_okqty.Name = "mcd_okqty";
-            this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
+            this.mcd_okqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_okqty.TabIndex = 209;
             this.mcd_okqty.Text = "0";
             // 
@@ -171,11 +163,10 @@
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(417, 27);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_prodcode.MaximumSize = new System.Drawing.Size(267, 0);
+            this.ma_prodcode.Location = new System.Drawing.Point(313, 22);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 208;
             // 
             // pr_detail
@@ -183,11 +174,10 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(725, 23);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_detail.MaximumSize = new System.Drawing.Size(267, 0);
+            this.pr_detail.Location = new System.Drawing.Point(544, 18);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
-            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 207;
             // 
             // sncode
@@ -197,34 +187,31 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(117, 520);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sncode.Location = new System.Drawing.Point(88, 416);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(260, 25);
+            this.sncode.Size = new System.Drawing.Size(196, 21);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
             this.sncode.TabIndex = 204;
             this.sncode.Tag = "ifwrite";
-            this.sncode.TextChanged += new System.EventHandler(this.sncode_TextChanged);
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(16, 121);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(12, 97);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(940, 380);
+            this.OperateResult.Size = new System.Drawing.Size(706, 305);
             this.OperateResult.TabIndex = 203;
             this.OperateResult.Text = "";
             // 
             // Make_CollectBTMAC
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(987, 560);
+            this.ClientSize = new System.Drawing.Size(740, 448);
             this.Controls.Add(this.DeleteButton);
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.mcd_remainqty);
@@ -240,7 +227,7 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Name = "Make_CollectBTMAC";
             this.Tag = "Make!CollectBTMAC";
             this.Text = "BT/MAC采集";

+ 17 - 13
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -60,11 +60,6 @@ namespace UAS_MES.Make
             asc.controlAutoSize(this);
         }
 
-        private void sncode_TextChanged(object sender, EventArgs e)
-        {
-
-        }
-
         private void deleteButton1_Click(object sender, EventArgs e)
         {
             isBT = false;
@@ -94,9 +89,18 @@ namespace UAS_MES.Make
                         }
                         if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                         {
+                            //判断界面工单是否为空时的序列号是否自动归属工单
+                            if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out ErrorMessage2))
+                            {
+                                if (ms_makecode.Text == "")
+                                {
+                                    OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                                    return;
+                                }
+                            }
                             OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
                             // 获取工单归属工单下一工序是否正确
-                            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text == "" ? oMakeCode : ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
                             {
                                 sql.Clear();
                                 sql.Append("select ma_code as ms_makecode,nvl(mcd_okqty,0),ma_prodcode,pr_detail,");
@@ -175,10 +179,10 @@ namespace UAS_MES.Make
                             }
                         }
                         //根据序列号获取此时BT号
-                        ms_bt = dh.getFieldDataByCondition("makeserial", "ms_bt", "ms_id = '" + oMsID + "'").ToString();
-                        if (sncode.Text == ms_bt)
+                        //ms_bt = dh.getFieldDataByCondition("makeserial", "ms_bt", "ms_id = '" + oMsID + "'").ToString();
+                        if (dh.CheckExist("makeserial", "ms_bt = '" + sncode.Text + "'"))
                         {
-                            OperateResult.AppendText(">>BT错误,重复\n", Color.Red, sncode);
+                            OperateResult.AppendText(">>录入错误,已存在此BT\n", Color.Red, sncode);
                             OperateResult.AppendText(">>请输入BT\n", Color.Black);
                             return;
                         }
@@ -239,11 +243,11 @@ namespace UAS_MES.Make
                             }
                         }
                     }
-                    //根据序列号获取此时网标号
-                    ms_mac = dh.getFieldDataByCondition("makeserial", "ms_mac", "ms_id = '" + oMsID + "'").ToString();
-                    if (sncode.Text == ms_mac)
+                    ////根据序列号获取此时网标号
+                    //ms_mac = dh.getFieldDataByCondition("makeserial", "ms_mac", "ms_id = '" + oMsID + "'").ToString();
+                    if (dh.CheckExist("makeserial", "ms_mac = '" + sncode.Text + "'"))
                     {
-                        OperateResult.AppendText(">>MAC错误,重复\n", Color.Red, sncode);
+                        OperateResult.AppendText(">>录入错误,已存在此MAC\n", Color.Red, sncode);
                         OperateResult.AppendText(">>请输入MAC\n", Color.Black);
                         return;
                     }

+ 17 - 8
UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs

@@ -59,9 +59,18 @@ namespace UAS_MES.Make
                     }
                     if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                     {
-                        OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Green);
+                        //判断界面工单是否为空时的序列号是否自动归属工单
+                        if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out ErrorMessage2))
+                        {
+                            if (ms_makecode.Text == "")
+                            {
+                                OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                                return;
+                            }
+                        }
+                        OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
                         // 获取工单归属工单下一工序是否正确
-                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text == "" ? oMakeCode : ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
                         {
                             sql.Clear();
                             sql.Append("select ma_code as ms_makecode,nvl(mcd_okqty,0),ma_prodcode,pr_detail,");
@@ -107,21 +116,21 @@ namespace UAS_MES.Make
                     //    } 
                     //}
                     #endregion
-                    OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Green);
+                    OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
                     string ErrorMessage = "";
                     string result = "";
-                    //根据序列号获取此时网标号
-                    net_code = dh.getFieldDataByCondition("makeserial", "ms_netcode", "ms_id = '" + oMsID + "'").ToString();
+                    ////根据序列号获取此时网标号
+                    //net_code = dh.getFieldDataByCondition("makeserial", "ms_netcode", "ms_id = '" + oMsID + "'").ToString();
                     if (int.Parse(mcd_remainqty.Text) <= 0)
                     {
                         ErrorMessage = "工单" + ms_makecode.Text + "剩余采集数不足\n>>>请输入SN";
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                         return;
                     }
-                    else if (sncode.Text == net_code)
+                    else if (dh.CheckExist("makeserial", "ms_netcode = '" + sncode.Text + "'"))
                     {
                         sncode.Text = "";
-                        OperateResult.AppendText(">>网标错误,重复\n", Color.Red);
+                        OperateResult.AppendText(">>录入错误,已存在此网标\n", Color.Red);
                         OperateResult.AppendText(">>请输入网标\n", Color.Black);
                         return;
                     }

+ 0 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -97,7 +97,6 @@ namespace UAS_MES.Make
             {
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl(lbl);
-                ftpOperater ftp = new ftpOperater();
             }
             catch (Exception ex)
             {

+ 6 - 6
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -58,11 +58,11 @@ namespace UAS_MES.Make
 
             //工单号放大镜配置
             ma_code.TableName = "make left join product on ma_prodcode=pr_code";
-            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_detail # 产品名称,ma_bomversion # Bom版本";
+            ma_code.SelectField = "ma_code # 工单号,pr_code # 产品编号,ma_qty # 工单数量,ma_craftcode # 途程编号,pr_detail # 产品名称,ma_bomversion # Bom版本";
             ma_code.FormName = Name;
             ma_code.DBTitle = "工单查询";
-            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_detail", "ma_craftcode", "ma_bomversion" };
-            ma_code.Condition = "ma_statuscode='STARTED'";
+            ma_code.SetValueField = new string[] { "ma_code", "pr_code", "ma_qty", "pr_detail", "ma_craftcode", "ma_bomversion" };
+            ma_code.Condition = "ma_statuscode='STARTED' order by ma_updatedate desc";
             ma_code.DbChange += Ms_makecode_DbChange;
 
             Lock.GetMakeCodeCtl(ma_code);
@@ -114,7 +114,7 @@ namespace UAS_MES.Make
                         {
                             sql.Clear();
                             sql.Append("select ma_code,ma_craftcode,ms_sncode,ma_qty,pr_detail,pr_code,ma_bomversion from makeserial left join make on ");
-                            sql.Append("ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_id='" + Msid + "'");
+                            sql.Append("ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "' and ms_makecode='" + ma_code.Text + "'");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
@@ -184,7 +184,7 @@ namespace UAS_MES.Make
                         {
                             CollectData.Add(code.Text);
                             CollectDataSonCode.Add(ListA.Rows[RemainIndex]["sp_soncode"].ToString());
-                            OperateResult.AppendText(">>采集成功\n", Color.Green, code);
+                            OperateResult.AppendText(">>物料" + code.Text + "采集成功\n", Color.Green, code);
                             RemainIndex = RemainIndex + 1;
                         }
                         else
@@ -206,7 +206,7 @@ namespace UAS_MES.Make
                             sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
                             sql.Append("where ma_code='" + macode + "'and sp_id=" + sp_id + " and mcd_stepcode = '" + User.CurrentStepCode + "' and ms_sncode='" + ms_sncode.Text + "'");
                             dh.BatchInsert(sql.GetString(), new string[] { "soncode", "barcode" }, CollectDataSonCode.ToArray(), CollectData.ToArray());
-                            OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的工单已经采集完成\n", Color.Green);
+                            OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的物料已经采集完成\n", Color.Green);
                             Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                             RemainIndex = 0;
                             CollectData.Clear();

+ 40 - 12
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -31,7 +31,7 @@
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_PackageCollection));
             this.pr_code_label = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
-            this.ms_makecode = new System.Windows.Forms.Label();
+            this.pa_makecode = new System.Windows.Forms.Label();
             this.pa_currentqty_label = new System.Windows.Forms.Label();
             this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
@@ -76,6 +76,8 @@
             this.pa_sccode = new System.Windows.Forms.Label();
             this.pa_checkno = new System.Windows.Forms.Label();
             this.pa_downstatus = new System.Windows.Forms.Label();
+            this.ms_makecode = new System.Windows.Forms.Label();
+            this.pa_standardqty = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -105,16 +107,16 @@
             this.pr_detail_label.TabIndex = 80;
             this.pr_detail_label.Text = "产品名称";
             // 
-            // ms_makecode
+            // pa_makecode
             // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(1108, 534);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
-            this.ms_makecode.TabIndex = 76;
-            this.ms_makecode.Visible = false;
+            this.pa_makecode.AutoSize = true;
+            this.pa_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_makecode.Location = new System.Drawing.Point(1108, 534);
+            this.pa_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_makecode.Name = "pa_makecode";
+            this.pa_makecode.Size = new System.Drawing.Size(0, 27);
+            this.pa_makecode.TabIndex = 76;
+            this.pa_makecode.Visible = false;
             // 
             // pa_currentqty_label
             // 
@@ -675,11 +677,35 @@
             this.pa_downstatus.TabIndex = 178;
             this.pa_downstatus.Visible = false;
             // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode.Location = new System.Drawing.Point(1137, 588);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
+            this.ms_makecode.TabIndex = 179;
+            this.ms_makecode.Visible = false;
+            // 
+            // pa_standardqty
+            // 
+            this.pa_standardqty.AutoSize = true;
+            this.pa_standardqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_standardqty.Location = new System.Drawing.Point(1132, 588);
+            this.pa_standardqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_standardqty.Name = "pa_standardqty";
+            this.pa_standardqty.Size = new System.Drawing.Size(0, 27);
+            this.pa_standardqty.TabIndex = 180;
+            this.pa_standardqty.Visible = false;
+            // 
             // Make_PackageCollection
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1172, 730);
+            this.Controls.Add(this.pa_standardqty);
+            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.pa_downstatus);
             this.Controls.Add(this.pa_checkno);
             this.Controls.Add(this.pa_sccode);
@@ -695,7 +721,7 @@
             this.Controls.Add(this.PackageDetail);
             this.Controls.Add(this.Cancel);
             this.Controls.Add(this.label13);
-            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.pa_makecode);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_PackageCollection";
@@ -720,7 +746,7 @@
         #endregion
         private System.Windows.Forms.Label pr_code_label;
         private System.Windows.Forms.Label pr_detail_label;
-        private System.Windows.Forms.Label ms_makecode;
+        private System.Windows.Forms.Label pa_makecode;
         private System.Windows.Forms.Label pa_currentqty_label;
         private System.Windows.Forms.Label pr_outboxinnerqty_label;
         private System.Windows.Forms.Label label13;
@@ -766,5 +792,7 @@
         private System.Windows.Forms.Label pa_sccode;
         private System.Windows.Forms.Label pa_checkno;
         private System.Windows.Forms.Label pa_downstatus;
+        private System.Windows.Forms.Label ms_makecode;
+        private System.Windows.Forms.Label pa_standardqty;
     }
 }

+ 81 - 105
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -77,30 +77,20 @@ namespace UAS_MES.Make
         {
             //加载表单数据
             string Err = "";
-            if (pa_outboxcode.Text != "")
-            {
-                sql.Clear();
-                sql.Append("select pr_code,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,pr_outboxinnerqty,pa_standardqty,pa_currentqty from package left join product on pa_prodcode=");
-                sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
-                Err = "箱号";
-            }
-            else
-            {
-                sql.Clear();
-                sql.Append("select ms_makecode,pr_code,pa_status,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_packageqty,pa_currentqty,");
-                sql.Append("pa_outboxcode from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
-                sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
-                Err = "序列号";
-            }
+            sql.Clear();
+            sql.Append("select pr_code,pa_outboxcode,pa_prodcode,pa_makecode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,0) pa_standardqty,pr_outboxinnerqty,pa_currentqty from package left join product on pa_prodcode=");
+            sql.Append("pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            Err = "箱号";
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
-                if (pr_code.Text != "")
-                {
-                    dt.Columns.Remove(dt.Columns["pa_standardqty"]);
-                }
+                //记录该数据保证在修改不被允许的前提下能偶回复之前的值
                 StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                 BaseUtil.SetFormValue(this.Controls, dt);
+                if (pa_standardqty.Text != "0")
+                {
+                    pr_outboxinnerqty.Text = pa_standardqty.Text;
+                }
             }
             else OperateResult.AppendText(">>" + Err + "不存在\n", Color.Red);
         }
@@ -114,37 +104,6 @@ namespace UAS_MES.Make
             pa_currentqty.Text = dh.getFieldDataByCondition("package", "pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
         }
 
-        private void InsertDetail()
-        {
-            if (dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_id='" + oMsID + "'").ToString() == sn_code.Text)
-            {
-                if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) < int.Parse(pr_outboxinnerqty.Text))
-                {
-                    sql.Clear();
-                    sql.Append("insert into packagedetail(pd_id,pd_paid,pd_outboxcode,pd_innerqty,pd_barcode) ");
-                    sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + sn_code.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    dh.ExecuteSql(sql.GetString(), "insert");
-                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1,pa_currentqty=pa_currentqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
-                    if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
-                    {
-                        OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
-                        //满箱更新状态为1
-                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
-                        {
-                            dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                            if (AutoPrint.Checked)
-                                Print_Click(new object(), new EventArgs());
-                        }
-                        LoadGridData();
-                        sn_code.Clear();
-                    }
-                }
-                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
-            }
-            else OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
-        }
 
         private void Print_Click(object sender, EventArgs e)
         {
@@ -181,14 +140,35 @@ namespace UAS_MES.Make
                 {
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
+                        //获取序列号信息
+                        sql.Clear();
+                        sql.Append("select pr_code,ms_makecode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");
+                        sql.Append("pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                        }
+                        //保证箱内容量不会被重置
+                        if (pa_standardqty.Text != "0" && pa_standardqty.Text != "")
+                        {
+                            pr_outboxinnerqty.Value = int.Parse(pa_standardqty.Text);
+                        }
                         if (pa_outboxcode.Text == "")
                         {
-                            LoadData();
-                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                            string boxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                            //序列号存在箱号的情况下获取所有的装箱数据
+                            if (boxcode != "")
+                            {
+                                pa_outboxcode.Text = boxcode;
                                 LoadGridData();
+                            }
                             else
                             {
-                                if (AutoGenBoxCode.Checked)
+                                //如果勾选了自动生成箱号,在封箱或者首次
+                                if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == ""))
                                     pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
                             }
                         }
@@ -197,43 +177,44 @@ namespace UAS_MES.Make
                             OperateResult.AppendText(">>箱号不能为空\n", Color.Red, sn_code);
                             return;
                         }
-                        //按工单核对装箱
-                        switch (pr_packrule.Text.ToUpper())
+                        if (pa_status.Text != "1")
                         {
-                            case "MAKE":
-                                if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
-                                {
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
-                                    return;
-                                }
-                                break;
-                            case "SALE":
-                                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
-                                {
-                                    sql.Clear();
-                                    sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
-                                    sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
-                                    DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                    if (dt.Rows.Count == 0)
+                            //按工单核对装箱
+                            switch (pr_packrule.Text.ToUpper())
+                            {
+                                case "MAKE":
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != pa_makecode.Text && pa_makecode.Text != "")
                                     {
-                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
                                         return;
                                     }
-                                }
-                                break;
-                            case "PROD":
-                                if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
-                                {
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
-                                    return;
-                                }
-                                break;
-                            case "MIX":
-                                break;
-                            case "SPEC":
-                                break;
-                            default:
-                                break;
+                                    break;
+                                case "SALE":
+                                    if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                    {
+                                        sql.Clear();
+                                        sql.Append("select 1 from package left join make on pa_salecode=ma_salecode and pa_prodcode=ma_prodcode left join makeserial ");
+                                        sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
+                                        DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                        if (dt.Rows.Count == 0)
+                                        {
+                                            OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等或者订单产品不相等\n", Color.Red, sn_code);
+                                            return;
+                                        }
+                                    }
+                                    break;
+                                case "PROD":
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
+                                    {
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    break;
+                                case "MIX":
+                                    break;
+                                default:
+                                    break;
+                            }
                         }
                         //判断箱内总数必须大于0
                         if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
@@ -265,18 +246,23 @@ namespace UAS_MES.Make
                                 {
                                     if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
                                     {
+                                        LoadCheckQTY();
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
                                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
                                         //满箱更新状态为1
-                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == pr_outboxinnerqty.Value)
+                                        LoadData();
+                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == pr_outboxinnerqty.Value)
                                         {
                                             dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                            pa_status.Text = "1";
+                                            pa_standardqty.Text = "";
                                             if (AutoPrint.Checked)
                                                 Print_Click(new object(), new EventArgs());
                                         }
                                         LoadGridData();
                                         sn_code.Clear();
                                     }
+                                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                 }
                                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             }
@@ -284,25 +270,14 @@ namespace UAS_MES.Make
                         //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
                         else
                         {
-                            string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
-                            if (outboxcode != "")
+                            if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                             {
-                                if (outboxcode == pa_outboxcode.Text)
-                                {
-                                    dh.UpdateByCondition("package", "pa_status=0", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                    //删除明细行的数据
-                                    dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
-                                    //更新已装数
-                                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1,pa_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                    //清除序列号箱号
-                                    dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
-                                    OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green);
-                                    LoadGridData();
-                                }
-                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red);
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
+                                LoadGridData();
+                                pa_status.Text = "0";
+                                OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green, sn_code);
                             }
-                            else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
+                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
                         }
                     }
                     else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
@@ -319,7 +294,7 @@ namespace UAS_MES.Make
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
             LoadCheckQTY();
-            pa_outboxcode.MakeCode = ms_makecode.Text;
+            pa_outboxcode.MakeCode = pa_makecode.Text;
             pa_outboxcode.ProdCode = pr_code.Text;
             pa_outboxcode.Caller = "PACKAGE";
             dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
@@ -347,6 +322,7 @@ namespace UAS_MES.Make
             {
                 dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                 pa_status.Text = "1";
+                pa_standardqty.Text = "";
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "封箱成功", pa_outboxcode.Text, "");
                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
             }

+ 41 - 12
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs

@@ -29,7 +29,7 @@
         private void InitializeComponent()
         {
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_PackageCollectionWeigh));
-            this.ms_makecode = new System.Windows.Forms.Label();
+            this.pa_makecode = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
             this.pa_code_label = new System.Windows.Forms.Label();
             this.PrintList_label = new System.Windows.Forms.Label();
@@ -85,6 +85,8 @@
             this.pa_downstatus = new System.Windows.Forms.Label();
             this.pa_checkno = new System.Windows.Forms.Label();
             this.pa_sccode = new System.Windows.Forms.Label();
+            this.ms_makecode = new System.Windows.Forms.Label();
+            this.pa_standardqty = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
             this.groupBoxWithBorder1.SuspendLayout();
@@ -93,16 +95,16 @@
             this.groupBoxWithBorder3.SuspendLayout();
             this.SuspendLayout();
             // 
-            // ms_makecode
+            // pa_makecode
             // 
-            this.ms_makecode.AutoSize = true;
-            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(1108, 536);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
-            this.ms_makecode.TabIndex = 76;
-            this.ms_makecode.Visible = false;
+            this.pa_makecode.AutoSize = true;
+            this.pa_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_makecode.Location = new System.Drawing.Point(1108, 536);
+            this.pa_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_makecode.Name = "pa_makecode";
+            this.pa_makecode.Size = new System.Drawing.Size(0, 27);
+            this.pa_makecode.TabIndex = 76;
+            this.pa_makecode.Visible = false;
             // 
             // label13
             // 
@@ -494,6 +496,7 @@
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 27);
             this.pr_code.TabIndex = 177;
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // AutoGenBoxCode
             // 
@@ -789,11 +792,35 @@
             this.pa_sccode.TabIndex = 181;
             this.pa_sccode.Visible = false;
             // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode.Location = new System.Drawing.Point(1008, 579);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
+            this.ms_makecode.TabIndex = 182;
+            this.ms_makecode.Visible = false;
+            // 
+            // pa_standardqty
+            // 
+            this.pa_standardqty.AutoSize = true;
+            this.pa_standardqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_standardqty.Location = new System.Drawing.Point(1047, 589);
+            this.pa_standardqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_standardqty.Name = "pa_standardqty";
+            this.pa_standardqty.Size = new System.Drawing.Size(0, 27);
+            this.pa_standardqty.TabIndex = 183;
+            this.pa_standardqty.Visible = false;
+            // 
             // Make_PackageCollectionWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1172, 727);
+            this.Controls.Add(this.pa_standardqty);
+            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.pa_sccode);
             this.Controls.Add(this.pa_checkno);
             this.Controls.Add(this.pa_downstatus);
@@ -812,7 +839,7 @@
             this.Controls.Add(this.PackageDetail);
             this.Controls.Add(this.Cancel);
             this.Controls.Add(this.label13);
-            this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.pa_makecode);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Make_PackageCollectionWeigh";
@@ -837,7 +864,7 @@
         }
 
         #endregion
-        private System.Windows.Forms.Label ms_makecode;
+        private System.Windows.Forms.Label pa_makecode;
         private System.Windows.Forms.Label label13;
         private System.Windows.Forms.Label pa_code_label;
         private System.Windows.Forms.Label PrintList_label;
@@ -894,5 +921,7 @@
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label pr_outboxinnerqty_label;
         private System.Windows.Forms.Label pr_code;
+        private System.Windows.Forms.Label ms_makecode;
+        private System.Windows.Forms.Label pa_standardqty;
     }
 }

+ 91 - 115
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -143,30 +143,14 @@ namespace UAS_MES.Make
         {
             //加载表单数据
             string Err = "";
-            if (pa_outboxcode.Text != "")
-            {
-                sql.Clear();
-                sql.Append("select pr_cartonmaxw,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
-                sql.Append("pa_status,pr_packrule,pr_detail,pa_packageqty,pr_outboxinnerqty,pa_standardqty,pa_currentqty from package left join ");
-                sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
-                Err = "箱号";
-            }
-            else
-            {
-                sql.Clear();
-                sql.Append("select pr_cartonmaxw,pr_cartonminw,pr_cartongw,ms_makecode,pa_status,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,");
-                sql.Append("pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_packageqty,pa_currentqty,");
-                sql.Append("pa_outboxcode from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
-                sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
-                Err = "序列号";
-            }
-            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            sql.Clear();
+            sql.Append("select pa_prodcode,pr_cartonmaxw,pa_makecode,pr_cartonunit,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
+            sql.Append("pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,0)pa_standardqty,pa_currentqty from package left join ");
+            sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            Err = "箱号";
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
-                if (pr_code.Text != "")
-                {
-                    dt.Columns.Remove(dt.Columns["pa_standardqty"]);
-                }
                 //重量的临时变量
                 string _weight = dt.Rows[0]["pr_cartongw"].ToString();
                 string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
@@ -177,6 +161,9 @@ namespace UAS_MES.Make
                 MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
                 StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
                 BaseUtil.SetFormValue(this.Controls, dt);
+                //保证按照箱内容量展示
+                if (pa_standardqty.Text != "0")
+                    pr_outboxinnerqty.Text = pa_standardqty.Text;
                 if (Weight - MinWeight == MaxWeight - Weight)
                     pr_cartonboxgw.Text = Weight + "±" + (MaxWeight - Weight);
                 else
@@ -194,43 +181,6 @@ namespace UAS_MES.Make
             pa_currentqty.Text = dh.getFieldDataByCondition("package", "pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
         }
 
-        private void InsertDetail()
-        {
-            if (dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_id='" + oMsID + "'").ToString() == sn_code.Text)
-            {
-                if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) < int.Parse(pr_outboxinnerqty.Text))
-                {
-                    sql.Clear();
-                    sql.Append("insert into packagedetail(pd_id,pd_paid,pd_outboxcode,pd_innerqty,pd_barcode) ");
-                    sql.Append("select packagedetail_seq.nextval,pa_id,pa_outboxcode,pa_totalqty,'" + sn_code.Text + "' from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    dh.ExecuteSql(sql.GetString(), "insert");
-                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty+1,pa_currentqty=pa_currentqty+1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                    dh.UpdateByCondition("makeserial", "ms_outboxcode='" + pa_outboxcode.Text + "'", "ms_id='" + oMsID + "'");
-                    if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
-                    {
-                        LoadCheckQTY();
-                        OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
-                        //满箱更新状态为1
-                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
-                        {
-                            //检查重量合格
-                            if (float.Parse(weight.Text) > MinWeight && float.Parse(weight.Text) < MaxWeight)
-                            {
-                                dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                if (AutoPrint.Checked)
-                                    Print_Click(new object(), new EventArgs());
-                            }
-                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
-                        }
-                        LoadGridData();
-                        sn_code.Clear();
-                    }
-                }
-                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已采集满\n", Color.Red);
-            }
-            else OperateResult.AppendText("序列号" + sn_code.Text + "不存在", Color.Red, sn_code);
-        }
-
         private void Print_Click(object sender, EventArgs e)
         {
             if (PrintLabel.Items.Count != 0)
@@ -266,50 +216,77 @@ namespace UAS_MES.Make
                 {
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
+                        sql.Clear();
+                        sql.Append("select ms_makecode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");
+                        sql.Append("pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                        sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
+                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            StandardQTY = decimal.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
+                            BaseUtil.SetFormValue(this.Controls, dt);
+                        }
+                        if (pa_standardqty.Text != "0" && pa_standardqty.Text != "")
+                        {
+                            pr_outboxinnerqty.Value = int.Parse(pa_standardqty.Text);
+                        }
                         if (pa_outboxcode.Text == "")
                         {
-                            LoadData();
-                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                            string boxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                            if (boxcode != "")
+                            {
+                                pa_outboxcode.Text = boxcode;
                                 LoadGridData();
+                            }
                             else
                             {
-                                LoadData();
-                                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                                if (AutoGenBoxCode.Checked && (pa_status.Text == "1" || pa_status.Text == ""))
+                                    pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
                             }
                         }
-                        //按工单核对装箱
-                        switch (pr_packrule.Text)
+                        if (pa_outboxcode.Text == "")
                         {
-                            case "M":
-                                if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
-                                {
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
-                                    return;
-                                }
-                                break;
-                            case "S":
-                                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
-                                {
-                                    sql.Clear();
-                                    sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
-                                    sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
-                                    DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                    if (dt.Rows.Count == 0)
+                            OperateResult.AppendText(">>箱号不能为空\n", Color.Red, sn_code);
+                            return;
+                        }
+                        if (pa_status.Text != "1")
+                        {
+                            //按工单核对装箱
+                            switch (pr_packrule.Text.ToUpper())
+                            {
+                                case "MAKE":
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != pa_makecode.Text)
                                     {
-                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
                                         return;
                                     }
-                                }
-                                break;
-                            case "":
-                                if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
-                                {
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
-                                    return;
-                                }
-                                break;
-                            default:
-                                break;
+                                    break;
+                                case "SALE":
+                                    if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                    {
+                                        sql.Clear();
+                                        sql.Append("select 1 from package left join make on pa_salecode=ma_salecode and pa_prodcode=ma_prodcode left join makeserial ");
+                                        sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
+                                        DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                        if (dt.Rows.Count == 0)
+                                        {
+                                            OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                            return;
+                                        }
+                                    }
+                                    break;
+                                case "PROD":
+                                    if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
+                                    {
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                    break;
+                                case "MIX":
+                                    break;
+                                default:
+                                    break;
+                            }
                         }
                         //判断箱内总数必须大于0
                         if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
@@ -341,15 +318,24 @@ namespace UAS_MES.Make
                                 {
                                     if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
                                     {
+                                        LoadCheckQTY();
                                         OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
-                                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
                                         //满箱更新状态为1
-                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == pr_outboxinnerqty.Value)
+                                        LoadData();
+                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == int.Parse(pr_outboxinnerqty.Text))
                                         {
-                                            dh.UpdateByCondition("package", "pa_status=1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                            if (AutoPrint.Checked)
-                                                Print_Click(new object(), new EventArgs());
+                                            //检查重量合格
+                                            if (float.Parse(weight.Text) > MinWeight && float.Parse(weight.Text) < MaxWeight)
+                                            {
+                                                dh.UpdateByCondition("package", "pa_status=1,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                                pa_standardqty.Text = "";
+                                                pa_status.Text = "1";
+                                                if (AutoPrint.Checked)
+                                                    Print_Click(new object(), new EventArgs());
+                                            }
+                                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "重量不符合标准重量\n", Color.Red);
                                         }
+
                                         LoadGridData();
                                         sn_code.Clear();
                                     }
@@ -360,25 +346,14 @@ namespace UAS_MES.Make
                         //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
                         else
                         {
-                            string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
-                            if (outboxcode != "")
+                            if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "标准", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
                             {
-                                if (outboxcode == pa_outboxcode.Text)
-                                {
-                                    dh.UpdateByCondition("package", "pa_status=0", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                    //删除明细行的数据
-                                    dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
-                                    //更新已装数
-                                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1,pa_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                    //清除序列号箱号
-                                    dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
-                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
-                                    OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green);
-                                    LoadGridData();
-                                }
-                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red);
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
+                                LoadGridData();
+                                pa_status.Text = "0";
+                                OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green, sn_code);
                             }
-                            else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
+                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
                         }
                     }
                     else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
@@ -395,7 +370,7 @@ namespace UAS_MES.Make
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
             LoadCheckQTY();
-            pa_outboxcode.MakeCode = ms_makecode.Text;
+            pa_outboxcode.MakeCode = pa_makecode.Text;
             pa_outboxcode.ProdCode = pr_code.Text;
             pa_outboxcode.Caller = "PACKAGE";
             dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
@@ -430,6 +405,7 @@ namespace UAS_MES.Make
             {
                 dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                 pa_status.Text = "1";
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "封箱成功", pa_outboxcode.Text, "");
                 OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
             }
             else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);

+ 29 - 8
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -552,14 +552,35 @@ namespace UAS_MES.Make
                 {
                     if (mbr_id != "")
                     {
-                        sql.Clear();
-                        sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
-                        sql.Append("mbl_sncode,mbl_makecode,mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval," + mbr_id);
-                        sql.Append(",'" + mbl_loc.Text.ToUpper() + "','" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
-                        sql.Append("sysdate,'" + User.UserCode + "' from dual");
-                        dh.ExecuteSql(sql.GetString(), "insert");
-                        dt = (DataTable)dh.ExecuteSql("select mbl_id,mbl_loc from makebadrsloc where mbl_mbrid=" + mbr_id, "select");
-                        BaseUtil.FillDgvWithDataTable(mbl_locdgv, dt);
+                        if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' and mbl_sncode='" + GetSNCode.Text + "' and mbl_loc='" + mbl_loc.Text.ToUpper() + "'"))
+                        {
+                            sql.Clear();
+                            sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
+                            sql.Append("mbl_sncode,mbl_makecode,mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval," + mbr_id);
+                            sql.Append(",'" + mbl_loc.Text.ToUpper() + "','" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
+                            sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                            dh.ExecuteSql(sql.GetString(), "insert");
+                            dt = (DataTable)dh.ExecuteSql("select mbl_id,mbl_loc from makebadrsloc where mbl_mbrid=" + mbr_id, "select");
+                            BaseUtil.FillDgvWithDataTable(mbl_locdgv, dt);
+                            sql.Clear();
+                            sql.Append("select bd_soncode from bom inner join bomdetail on bo_id = bd_bomid ");
+                            sql.Append("where bo_mothercode='" + ms_prodcode.Text + "' and bd_location<>' 'and  ");
+                            sql.Append(" instr(','||bd_location||',','," + mbl_loc.Text.ToUpper() + ",')>0  order by bd_detno desc ");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            if (dt.Rows.Count > 0)
+                            {
+                                sql.Clear();
+                                sql.Append("insert into makebadrspart(mbp_id,mbp_mbrid,mbp_part,mbp_badcode,");
+                                sql.Append("mbp_brcode,mbp_sncode,mbp_makecode,mbp_indate,mbp_inman)");
+                                sql.Append("select makebadrspart_seq.nextval," + mbr_id + ",'" + dt.Rows[0][0].ToString() + "',");
+                                sql.Append("'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
+                                sql.Append("sysdate,'" + User.UserCode + "' from dual");
+                                dh.ExecuteSql(sql.GetString(), "insert");
+                                dt = (DataTable)dh.ExecuteSql("select mbp_id,mbp_part from makebadrspart where mbp_mbrid=" + mbr_id, "select");
+                                BaseUtil.FillDgvWithDataTable(mbp_partdgv, dt);
+                            }
+                        }
+                        else OperatResult.AppendText(">>已存在该不良位置\n", Color.Red);
                     }
                     else OperatResult.AppendText(">>请先选择不良原因\n", Color.Red);
                 }

+ 39 - 15
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -30,6 +30,8 @@ namespace UAS_MES.Make
         DataTable ListA;
         //存放工单信息
         DataTable dt;
+        //存放序列号防呆规则
+        DataTable rules;
         //step  记录检验规则的进度
         int step = 0;
         //存放关联信息类型
@@ -174,6 +176,16 @@ namespace UAS_MES.Make
                         else if (step == 1)
                         {
                             OperateResult.AppendText(">>" + code.Text + "\n", Color.Black);
+                            //判断工单是否导入了序列号清单
+                            if (dh.CheckExist("makesnlist", "msl_makecode='" + oMakecode + "' and msl_type='after'"))
+                            {
+                                if (!dh.CheckExist("makesnlist", "msl_makecode='" + oMakecode + "' and msl_sncode='" + code.Text + "'  and msl_type='after'"))
+                                {
+                                    //有序列号清单,输入的序列号却不在范围内
+                                    OperateResult.AppendText(">>序列号" + code.Text + "错误,不在工单设定的序列号范围内\n", Color.Red, code);
+                                    return;
+                                }
+                            }
                             //判断用户是否锁定输入SN长度,
                             if (!checkLengthOrPre(SNLength_checkBox, SNLength, "长度", "SN"))
                             {
@@ -468,12 +480,16 @@ namespace UAS_MES.Make
             TSNLength_checkBox.Enabled = true;
             SNPre_checkBox.Enabled = true;
             SNLength_checkBox.Enabled = true;
-
+            //判断工单是否导入了序列号清单
+            if (dh.CheckExist("makesnlist", "msl_makecode='" + oMakecode + "' and msl_type='after'"))
+            {
+                return;
+            }
             //查询表工单序列号防呆规则表
-            dt = (DataTable)dh.ExecuteSql("select msr_startno,msr_endno,msr_system,msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode='" + ms_macode.Text + "'", "select");
-            if (dt.Rows.Count > 0)
+            rules = (DataTable)dh.ExecuteSql("select msr_startno,msr_endno,msr_system,msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode='" + oMakecode + "'", "select");
+            if (rules.Rows.Count > 0)
             {
-                foreach (DataRow dr in dt.Rows)
+                foreach (DataRow dr in rules.Rows)
                 {
                     //如果有值,则这个字段自动勾选,并且不可编辑
                     if (dr["msr_type"].ToString().ToLower() == "before")
@@ -548,17 +564,25 @@ namespace UAS_MES.Make
             {
                 /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
                  *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
-                //dt = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = " + ma_prodcode.Text, "select");
-                //if (dt.Rows.Count > 0)
-                //{
-                //    //将产品序列号防呆规则查出的数据填充
-                //    beforeTransSNPre.Text = dt.Rows[0]["psr_prefix"].ToString();
-                //    beforeTransSNPre.ReadOnly = true;
-                //    beforeTransSNPre_checkBox.Checked = true;
-                //    beforeTransSNLength.Text = dt.Rows[0]["psr_length"].ToString();
-                //    beforeTransSNLength.ReadOnly = true;
-                //    beforeTransSNLength_checkBox.Checked = true;
-                //}
+                rules = (DataTable)dh.ExecuteSql("select psr_prefix,psr_length from productsnrule where psr_prodcode ='"+ dt.Rows[0]["ma_prodcode"].ToString()+"' and psr_type='after'", "select");
+                if (rules.Rows.Count > 0)
+                {
+                    //将产品序列号防呆规则查出的数据填充
+                    if (rules.Rows[0]["psr_prefix"].ToString() != "")
+                    {
+                        SNPre.Text = rules.Rows[0]["psr_prefix"].ToString();
+                        SNPre.Enabled = false;
+                        SNPre_checkBox.Checked = true;
+                        SNPre_checkBox.Enabled = false;
+                    }
+                    if (rules.Rows[0]["psr_length"].ToString() != "")
+                    {
+                        TSNLength.Text = rules.Rows[0]["psr_length"].ToString();
+                        TSNLength.Enabled = false;
+                        TSNLength_checkBox.Checked = true;
+                        TSNLength_checkBox.Enabled = false;
+                    }
+                }
             }
         }
         /// <summary>

+ 39 - 16
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -17,7 +17,7 @@ namespace UAS_MES.Make
 
         DataTable dt;
 
-        DataTable Dbfind;
+        DataTable rules;
 
         LogStringBuilder sql = new LogStringBuilder();
 
@@ -159,6 +159,16 @@ namespace UAS_MES.Make
                         //bsncode不为空,说明输入的是转换后的序列号
                         else
                         {
+                            //判断工单是否导入了序列号清单
+                            if (dh.CheckExist("makesnlist", "msl_makecode='"+oMakeCode+"' and msl_type='after'"))
+                            {
+                                if (!dh.CheckExist("makesnlist", "msl_makecode='"+oMakeCode+"' and msl_sncode='"+sncode.Text+"'  and msl_type='after'"))
+                                {
+                                    //有序列号清单,输入的序列号却不在范围内
+                                    OperateResult.AppendText(">>序列号"+sncode.Text+"错误,不在工单设定的序列号范围内\n", Color.Red, sncode);
+                                    return;
+                                }
+                            }
                             //判断用户是否锁定输入转换后序列号长度,
                             if (!checkLengthOrPre(afterTransSNLength_checkBox, afterTransSNLength, "长度"))
                                 return;
@@ -299,11 +309,16 @@ namespace UAS_MES.Make
             beforeTransSNLength_checkBox.Enabled = true;
             afterTransSNPre_checkBox.Enabled = true;
             afterTransSNLength_checkBox.Enabled = true;
-            //查询表工单序列号防呆规则表
-            dt = (DataTable)dh.ExecuteSql("select msr_startno,msr_endno,msr_system,msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode='" + ma_code.Text + "'", "select");
-            if (dt.Rows.Count > 0)
+            //判断工单是否导入了序列号清单
+            if (dh.CheckExist("makesnlist", "msl_makecode='" + oMakeCode + "' and msl_type='after'"))
+            {
+                return;
+            }
+                //查询表工单序列号防呆规则表
+                rules = (DataTable)dh.ExecuteSql("select msr_startno,msr_endno,msr_system,msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode='" + oMakeCode + "'", "select");
+            if (rules.Rows.Count > 0)
             {
-                foreach (DataRow dr in dt.Rows)
+                foreach (DataRow dr in rules.Rows)
                 {
                     //如果有值,则这个字段自动勾选,并且不可编辑
                     if (dr["msr_type"].ToString().ToLower() == "before")
@@ -378,17 +393,25 @@ namespace UAS_MES.Make
             {
                 /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
                  *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
-                //dt = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = " + ma_prodcode.Text, "select");
-                //if (dt.Rows.Count > 0)
-                //{
-                //    //将产品序列号防呆规则查出的数据填充
-                //    beforeTransSNPre.Text = dt.Rows[0]["psr_prefix"].ToString();
-                //    beforeTransSNPre.ReadOnly = true;
-                //    beforeTransSNPre_checkBox.Checked = true;
-                //    beforeTransSNLength.Text = dt.Rows[0]["psr_length"].ToString();
-                //    beforeTransSNLength.ReadOnly = true;
-                //    beforeTransSNLength_checkBox.Checked = true;
-                //}
+                rules = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = '"+ dt.Rows[0]["ma_prodcode"].ToString()+"' and psr_type='after'", "select");
+                if (rules.Rows.Count > 0)
+                {
+                    //将产品序列号防呆规则查出的数据填充
+                    if (rules.Rows[0]["psr_prefix"].ToString()!="")
+                    {
+                        afterTransSNPre.Text = rules.Rows[0]["psr_prefix"].ToString();
+                        afterTransSNPre.Enabled = false;
+                        afterTransSNPre_checkBox.Checked = true;
+                        afterTransSNPre_checkBox.Enabled = false;
+                    }
+                    if (rules.Rows[0]["psr_length"].ToString() != "")
+                    {
+                        afterTransSNLength.Text = rules.Rows[0]["psr_length"].ToString();
+                        afterTransSNLength.Enabled = false;
+                        afterTransSNLength_checkBox.Checked = true;
+                        afterTransSNLength_checkBox.Enabled = false;
+                    }
+                }
             }
         }
         /// <summary>

+ 899 - 0
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.Designer.cs

@@ -0,0 +1,899 @@
+namespace UAS_MES.Make
+{
+    partial class Make_SpecialCartonPack
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_SpecialCartonPack));
+            this.ms_makecode = new System.Windows.Forms.Label();
+            this.label13 = new System.Windows.Forms.Label();
+            this.pa_code_label = new System.Windows.Forms.Label();
+            this.PrintList_label = new System.Windows.Forms.Label();
+            this.PrintNum_label = new System.Windows.Forms.Label();
+            this.Cancel = new System.Windows.Forms.CheckBox();
+            this.pa_id = new System.Windows.Forms.Label();
+            this.PrintLabel = new System.Windows.Forms.ComboBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.PrintNum = new System.Windows.Forms.NumericUpDown();
+            this.pa_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode();
+            this.PrintList = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.Printing = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.PackageDetail = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
+            this.pd_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_prodcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_innerqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.AutoPrint = new UAS_MES.CustomControl.CustomCheckBox.AutoPrintCheckBox();
+            this.groupBoxWithBorder1 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.pr_outboxinnerqty = new System.Windows.Forms.NumericUpDown();
+            this.pa_currentqty_label = new System.Windows.Forms.Label();
+            this.pr_detail_label = new System.Windows.Forms.Label();
+            this.pa_currentqty = new System.Windows.Forms.Label();
+            this.pr_code_label = new System.Windows.Forms.Label();
+            this.pr_detail = new System.Windows.Forms.Label();
+            this.pr_outboxinnerqty_label = new System.Windows.Forms.Label();
+            this.pr_code = new System.Windows.Forms.Label();
+            this.AutoGenBoxCode = new System.Windows.Forms.CheckBox();
+            this.groupBoxWithBorder2 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.ob_nowcheckqty = new System.Windows.Forms.Label();
+            this.ob_batchqty = new System.Windows.Forms.Label();
+            this.ob_nowcheckqty_label = new System.Windows.Forms.Label();
+            this.ob_batchqty_label = new System.Windows.Forms.Label();
+            this.SendCheck = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.Packing = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.pr_packrule = new System.Windows.Forms.Label();
+            this.pa_status = new System.Windows.Forms.Label();
+            this.ob_checkno = new System.Windows.Forms.Label();
+            this.groupBoxWithBorder3 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.pr_cartonunit1 = new System.Windows.Forms.Label();
+            this.pr_cartonunit = new System.Windows.Forms.Label();
+            this.pr_cartonboxgw = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.weight = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.Baurate = new System.Windows.Forms.Label();
+            this.ComList = new System.Windows.Forms.Label();
+            this.pa_downstatus = new System.Windows.Forms.Label();
+            this.pa_checkno = new System.Windows.Forms.Label();
+            this.pa_sccode = new System.Windows.Forms.Label();
+            ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
+            this.groupBoxWithBorder1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pr_outboxinnerqty)).BeginInit();
+            this.groupBoxWithBorder2.SuspendLayout();
+            this.groupBoxWithBorder3.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // ms_makecode
+            // 
+            this.ms_makecode.AutoSize = true;
+            this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode.Location = new System.Drawing.Point(1108, 536);
+            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode.Name = "ms_makecode";
+            this.ms_makecode.Size = new System.Drawing.Size(0, 27);
+            this.ms_makecode.TabIndex = 76;
+            this.ms_makecode.Visible = false;
+            // 
+            // label13
+            // 
+            this.label13.AutoSize = true;
+            this.label13.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label13.ForeColor = System.Drawing.Color.Black;
+            this.label13.Location = new System.Drawing.Point(13, 689);
+            this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label13.Name = "label13";
+            this.label13.Size = new System.Drawing.Size(72, 27);
+            this.label13.TabIndex = 105;
+            this.label13.Text = "序列号";
+            // 
+            // pa_code_label
+            // 
+            this.pa_code_label.AutoSize = true;
+            this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_code_label.Location = new System.Drawing.Point(13, 46);
+            this.pa_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_code_label.Name = "pa_code_label";
+            this.pa_code_label.Size = new System.Drawing.Size(52, 27);
+            this.pa_code_label.TabIndex = 113;
+            this.pa_code_label.Text = "箱号";
+            // 
+            // PrintList_label
+            // 
+            this.PrintList_label.AutoSize = true;
+            this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintList_label.Location = new System.Drawing.Point(15, 46);
+            this.PrintList_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PrintList_label.Name = "PrintList_label";
+            this.PrintList_label.Size = new System.Drawing.Size(112, 27);
+            this.PrintList_label.TabIndex = 116;
+            this.PrintList_label.Text = "打印机列表";
+            // 
+            // PrintNum_label
+            // 
+            this.PrintNum_label.AutoSize = true;
+            this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.PrintNum_label.Location = new System.Drawing.Point(251, 147);
+            this.PrintNum_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.PrintNum_label.Name = "PrintNum_label";
+            this.PrintNum_label.Size = new System.Drawing.Size(52, 27);
+            this.PrintNum_label.TabIndex = 124;
+            this.PrintNum_label.Text = "份数";
+            // 
+            // Cancel
+            // 
+            this.Cancel.AutoSize = true;
+            this.Cancel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Cancel.Location = new System.Drawing.Point(413, 691);
+            this.Cancel.Margin = new System.Windows.Forms.Padding(4);
+            this.Cancel.Name = "Cancel";
+            this.Cancel.Size = new System.Drawing.Size(114, 31);
+            this.Cancel.TabIndex = 129;
+            this.Cancel.Text = "取消装箱";
+            this.Cancel.UseVisualStyleBackColor = true;
+            // 
+            // pa_id
+            // 
+            this.pa_id.AutoSize = true;
+            this.pa_id.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_id.Location = new System.Drawing.Point(1065, 536);
+            this.pa_id.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_id.Name = "pa_id";
+            this.pa_id.Size = new System.Drawing.Size(0, 27);
+            this.pa_id.TabIndex = 153;
+            this.pa_id.Visible = false;
+            // 
+            // PrintLabel
+            // 
+            this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.PrintLabel.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.PrintLabel.FormattingEnabled = true;
+            this.PrintLabel.Location = new System.Drawing.Point(157, 95);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintLabel.Name = "PrintLabel";
+            this.PrintLabel.Size = new System.Drawing.Size(199, 28);
+            this.PrintLabel.TabIndex = 159;
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label3.Location = new System.Drawing.Point(15, 95);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(92, 27);
+            this.label3.TabIndex = 160;
+            this.label3.Text = "打印标签";
+            // 
+            // PrintNum
+            // 
+            this.PrintNum.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.PrintNum.Location = new System.Drawing.Point(311, 147);
+            this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Size = new System.Drawing.Size(57, 27);
+            this.PrintNum.TabIndex = 164;
+            this.PrintNum.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // pa_outboxcode
+            // 
+            this.pa_outboxcode.Caller = null;
+            this.pa_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.pa_outboxcode.Location = new System.Drawing.Point(130, 49);
+            this.pa_outboxcode.MakeCode = null;
+            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(8, 9, 8, 9);
+            this.pa_outboxcode.Name = "pa_outboxcode";
+            this.pa_outboxcode.Pr_id = null;
+            this.pa_outboxcode.ProdCode = null;
+            this.pa_outboxcode.ShowClickIcon = false;
+            this.pa_outboxcode.Size = new System.Drawing.Size(176, 28);
+            this.pa_outboxcode.TabIndex = 163;
+            this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_code_KeyDown);
+            // 
+            // PrintList
+            // 
+            this.PrintList.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.PrintList.Location = new System.Drawing.Point(157, 46);
+            this.PrintList.Margin = new System.Windows.Forms.Padding(8, 9, 8, 9);
+            this.PrintList.Name = "PrintList";
+            this.PrintList.Size = new System.Drawing.Size(199, 28);
+            this.PrintList.TabIndex = 158;
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(5, 524);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(595, 149);
+            this.OperateResult.TabIndex = 155;
+            this.OperateResult.Text = "";
+            // 
+            // Printing
+            // 
+            this.Printing.AllPower = "ifall";
+            this.Printing.BackColor = System.Drawing.Color.Transparent;
+            this.Printing.DownImage = ((System.Drawing.Image)(resources.GetObject("Printing.DownImage")));
+            this.Printing.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Printing.Image = null;
+            this.Printing.IsShowBorder = true;
+            this.Printing.Location = new System.Drawing.Point(389, 144);
+            this.Printing.Margin = new System.Windows.Forms.Padding(4);
+            this.Printing.MoveImage = ((System.Drawing.Image)(resources.GetObject("Printing.MoveImage")));
+            this.Printing.Name = "Printing";
+            this.Printing.NormalImage = ((System.Drawing.Image)(resources.GetObject("Printing.NormalImage")));
+            this.Printing.Power = null;
+            this.Printing.Size = new System.Drawing.Size(80, 30);
+            this.Printing.TabIndex = 150;
+            this.Printing.Tag = "ifread";
+            this.Printing.Text = "打印";
+            this.Printing.UseVisualStyleBackColor = true;
+            this.Printing.Click += new System.EventHandler(this.Print_Click);
+            // 
+            // Clean
+            // 
+            this.Clean.AllPower = null;
+            this.Clean.BackColor = System.Drawing.Color.Transparent;
+            this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
+            this.Clean.Image = null;
+            this.Clean.IsShowBorder = true;
+            this.Clean.Location = new System.Drawing.Point(618, 643);
+            this.Clean.Margin = new System.Windows.Forms.Padding(4);
+            this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
+            this.Clean.Name = "Clean";
+            this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
+            this.Clean.Power = null;
+            this.Clean.Size = new System.Drawing.Size(80, 30);
+            this.Clean.TabIndex = 148;
+            this.Clean.Text = "清除";
+            this.Clean.UseVisualStyleBackColor = true;
+            this.Clean.Click += new System.EventHandler(this.Clean_Click);
+            // 
+            // sn_code
+            // 
+            this.sn_code.AllPower = "ifall";
+            this.sn_code.BackColor = System.Drawing.Color.White;
+            this.sn_code.ID = null;
+            this.sn_code.Location = new System.Drawing.Point(101, 691);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(4);
+            this.sn_code.Name = "sn_code";
+            this.sn_code.Power = "ifwrite";
+            this.sn_code.Size = new System.Drawing.Size(260, 25);
+            this.sn_code.Str = null;
+            this.sn_code.Str1 = null;
+            this.sn_code.Str2 = null;
+            this.sn_code.TabIndex = 135;
+            this.sn_code.Tag = "IfWrite";
+            this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.barcode_KeyDown);
+            // 
+            // PackageDetail
+            // 
+            this.PackageDetail.AllowUserToAddRows = false;
+            this.PackageDetail.AllowUserToDeleteRows = false;
+            this.PackageDetail.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
+            this.PackageDetail.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
+            this.PackageDetail.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.pd_barcode,
+            this.pa_outboxcode1,
+            this.pa_prodcode1,
+            this.pd_innerqty,
+            this.pa_indate,
+            this.pd_id});
+            this.PackageDetail.Location = new System.Drawing.Point(5, 214);
+            this.PackageDetail.Margin = new System.Windows.Forms.Padding(4);
+            this.PackageDetail.Name = "PackageDetail";
+            this.PackageDetail.ReadOnly = true;
+            this.PackageDetail.RowTemplate.Height = 23;
+            this.PackageDetail.Size = new System.Drawing.Size(881, 300);
+            this.PackageDetail.TabIndex = 134;
+            this.PackageDetail.DataSourceChanged += new System.EventHandler(this.PackageDetail_DataSourceChanged);
+            // 
+            // pd_barcode
+            // 
+            this.pd_barcode.DataPropertyName = "pd_barcode";
+            this.pd_barcode.HeaderText = "序列号";
+            this.pd_barcode.Name = "pd_barcode";
+            this.pd_barcode.ReadOnly = true;
+            this.pd_barcode.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.pd_barcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Programmatic;
+            this.pd_barcode.Width = 202;
+            // 
+            // pa_outboxcode1
+            // 
+            this.pa_outboxcode1.DataPropertyName = "pa_outboxcode";
+            this.pa_outboxcode1.HeaderText = "箱号";
+            this.pa_outboxcode1.Name = "pa_outboxcode1";
+            this.pa_outboxcode1.ReadOnly = true;
+            this.pa_outboxcode1.Width = 201;
+            // 
+            // pa_prodcode1
+            // 
+            this.pa_prodcode1.DataPropertyName = "pa_prodcode";
+            this.pa_prodcode1.HeaderText = "产品编号";
+            this.pa_prodcode1.Name = "pa_prodcode1";
+            this.pa_prodcode1.ReadOnly = true;
+            this.pa_prodcode1.Visible = false;
+            // 
+            // pd_innerqty
+            // 
+            this.pd_innerqty.DataPropertyName = "pd_innerqty";
+            this.pd_innerqty.HeaderText = "箱内数量";
+            this.pd_innerqty.Name = "pd_innerqty";
+            this.pd_innerqty.ReadOnly = true;
+            this.pd_innerqty.Visible = false;
+            this.pd_innerqty.Width = 80;
+            // 
+            // pa_indate
+            // 
+            this.pa_indate.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pa_indate.DataPropertyName = "pa_indate";
+            this.pa_indate.HeaderText = "装箱日期";
+            this.pa_indate.MinimumWidth = 300;
+            this.pa_indate.Name = "pa_indate";
+            this.pa_indate.ReadOnly = true;
+            this.pa_indate.Width = 300;
+            // 
+            // pd_id
+            // 
+            this.pd_id.DataPropertyName = "pd_id";
+            this.pd_id.HeaderText = "ID";
+            this.pd_id.Name = "pd_id";
+            this.pd_id.ReadOnly = true;
+            this.pd_id.Visible = false;
+            // 
+            // AutoPrint
+            // 
+            this.AutoPrint.Checked = false;
+            this.AutoPrint.Location = new System.Drawing.Point(126, 147);
+            this.AutoPrint.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.AutoPrint.Name = "AutoPrint";
+            this.AutoPrint.Size = new System.Drawing.Size(112, 27);
+            this.AutoPrint.TabIndex = 166;
+            // 
+            // groupBoxWithBorder1
+            // 
+            this.groupBoxWithBorder1.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_detail_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_currentqty);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_detail);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty_label);
+            this.groupBoxWithBorder1.Controls.Add(this.pr_code);
+            this.groupBoxWithBorder1.Controls.Add(this.AutoGenBoxCode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_outboxcode);
+            this.groupBoxWithBorder1.Controls.Add(this.pa_code_label);
+            this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(5, 8);
+            this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(548, 196);
+            this.groupBoxWithBorder1.TabIndex = 171;
+            this.groupBoxWithBorder1.TabStop = false;
+            this.groupBoxWithBorder1.Text = "装箱信息";
+            this.groupBoxWithBorder1.TextColor = System.Drawing.Color.Black;
+            // 
+            // pr_outboxinnerqty
+            // 
+            this.pr_outboxinnerqty.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.pr_outboxinnerqty.Location = new System.Drawing.Point(130, 94);
+            this.pr_outboxinnerqty.Maximum = new decimal(new int[] {
+            1000,
+            0,
+            0,
+            0});
+            this.pr_outboxinnerqty.Name = "pr_outboxinnerqty";
+            this.pr_outboxinnerqty.Size = new System.Drawing.Size(142, 27);
+            this.pr_outboxinnerqty.TabIndex = 180;
+            this.pr_outboxinnerqty.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pr_outboxinnerqty_KeyDown);
+            this.pr_outboxinnerqty.Leave += new System.EventHandler(this.pr_outboxinnerqty_Leave);
+            // 
+            // pa_currentqty_label
+            // 
+            this.pa_currentqty_label.AutoSize = true;
+            this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_currentqty_label.Location = new System.Drawing.Point(279, 94);
+            this.pa_currentqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_currentqty_label.Name = "pa_currentqty_label";
+            this.pa_currentqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pa_currentqty_label.TabIndex = 175;
+            this.pa_currentqty_label.Text = "已装数量";
+            // 
+            // pr_detail_label
+            // 
+            this.pr_detail_label.AutoSize = true;
+            this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail_label.Location = new System.Drawing.Point(279, 147);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Name = "pr_detail_label";
+            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.TabIndex = 173;
+            this.pr_detail_label.Text = "产品名称";
+            // 
+            // pa_currentqty
+            // 
+            this.pa_currentqty.AutoSize = true;
+            this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_currentqty.Location = new System.Drawing.Point(389, 94);
+            this.pa_currentqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_currentqty.Name = "pa_currentqty";
+            this.pa_currentqty.Size = new System.Drawing.Size(0, 27);
+            this.pa_currentqty.TabIndex = 179;
+            // 
+            // pr_code_label
+            // 
+            this.pr_code_label.AutoSize = true;
+            this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code_label.Location = new System.Drawing.Point(13, 147);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Name = "pr_code_label";
+            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.TabIndex = 174;
+            this.pr_code_label.Text = "产品编号";
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSize = true;
+            this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_detail.Location = new System.Drawing.Point(389, 147);
+            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.Size = new System.Drawing.Size(0, 27);
+            this.pr_detail.TabIndex = 178;
+            // 
+            // pr_outboxinnerqty_label
+            // 
+            this.pr_outboxinnerqty_label.AutoSize = true;
+            this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(13, 94);
+            this.pr_outboxinnerqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
+            this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_outboxinnerqty_label.TabIndex = 176;
+            this.pr_outboxinnerqty_label.Text = "箱内容量";
+            // 
+            // pr_code
+            // 
+            this.pr_code.AutoSize = true;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(130, 147);
+            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.TabIndex = 177;
+            // 
+            // AutoGenBoxCode
+            // 
+            this.AutoGenBoxCode.AutoSize = true;
+            this.AutoGenBoxCode.Checked = true;
+            this.AutoGenBoxCode.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.AutoGenBoxCode.Location = new System.Drawing.Point(331, 45);
+            this.AutoGenBoxCode.Name = "AutoGenBoxCode";
+            this.AutoGenBoxCode.Size = new System.Drawing.Size(154, 31);
+            this.AutoGenBoxCode.TabIndex = 171;
+            this.AutoGenBoxCode.Text = "自动生成箱号";
+            this.AutoGenBoxCode.UseVisualStyleBackColor = true;
+            // 
+            // groupBoxWithBorder2
+            // 
+            this.groupBoxWithBorder2.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder2.Controls.Add(this.ob_nowcheckqty);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_batchqty);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_nowcheckqty_label);
+            this.groupBoxWithBorder2.Controls.Add(this.ob_batchqty_label);
+            this.groupBoxWithBorder2.Controls.Add(this.SendCheck);
+            this.groupBoxWithBorder2.Controls.Add(this.Packing);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintLabel);
+            this.groupBoxWithBorder2.Controls.Add(this.label3);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintNum);
+            this.groupBoxWithBorder2.Controls.Add(this.AutoPrint);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintList);
+            this.groupBoxWithBorder2.Controls.Add(this.Printing);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintList_label);
+            this.groupBoxWithBorder2.Controls.Add(this.PrintNum_label);
+            this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(560, 8);
+            this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(595, 196);
+            this.groupBoxWithBorder2.TabIndex = 172;
+            this.groupBoxWithBorder2.TabStop = false;
+            this.groupBoxWithBorder2.Text = "打印";
+            this.groupBoxWithBorder2.TextColor = System.Drawing.Color.Black;
+            // 
+            // ob_nowcheckqty
+            // 
+            this.ob_nowcheckqty.AutoSize = true;
+            this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(476, 93);
+            this.ob_nowcheckqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_nowcheckqty.Name = "ob_nowcheckqty";
+            this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 27);
+            this.ob_nowcheckqty.TabIndex = 178;
+            // 
+            // ob_batchqty
+            // 
+            this.ob_batchqty.AutoSize = true;
+            this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty.Location = new System.Drawing.Point(476, 45);
+            this.ob_batchqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_batchqty.Name = "ob_batchqty";
+            this.ob_batchqty.Size = new System.Drawing.Size(0, 27);
+            this.ob_batchqty.TabIndex = 177;
+            // 
+            // ob_nowcheckqty_label
+            // 
+            this.ob_nowcheckqty_label.AutoSize = true;
+            this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(368, 93);
+            this.ob_nowcheckqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
+            this.ob_nowcheckqty_label.Size = new System.Drawing.Size(92, 27);
+            this.ob_nowcheckqty_label.TabIndex = 176;
+            this.ob_nowcheckqty_label.Text = "当前批数";
+            // 
+            // ob_batchqty_label
+            // 
+            this.ob_batchqty_label.AutoSize = true;
+            this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_batchqty_label.Location = new System.Drawing.Point(368, 45);
+            this.ob_batchqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_batchqty_label.Name = "ob_batchqty_label";
+            this.ob_batchqty_label.Size = new System.Drawing.Size(92, 27);
+            this.ob_batchqty_label.TabIndex = 175;
+            this.ob_batchqty_label.Text = "标准批数";
+            // 
+            // SendCheck
+            // 
+            this.SendCheck.AllPower = "ifall";
+            this.SendCheck.BackColor = System.Drawing.Color.Transparent;
+            this.SendCheck.DownImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.DownImage")));
+            this.SendCheck.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.SendCheck.Image = null;
+            this.SendCheck.IsShowBorder = true;
+            this.SendCheck.Location = new System.Drawing.Point(492, 144);
+            this.SendCheck.Margin = new System.Windows.Forms.Padding(4);
+            this.SendCheck.MoveImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.MoveImage")));
+            this.SendCheck.Name = "SendCheck";
+            this.SendCheck.NormalImage = ((System.Drawing.Image)(resources.GetObject("SendCheck.NormalImage")));
+            this.SendCheck.Power = null;
+            this.SendCheck.Size = new System.Drawing.Size(80, 30);
+            this.SendCheck.TabIndex = 174;
+            this.SendCheck.Tag = "ifread";
+            this.SendCheck.Text = "送检";
+            this.SendCheck.UseVisualStyleBackColor = true;
+            this.SendCheck.Click += new System.EventHandler(this.SendCheck_Click);
+            // 
+            // Packing
+            // 
+            this.Packing.AllPower = null;
+            this.Packing.BackColor = System.Drawing.Color.Transparent;
+            this.Packing.DownImage = ((System.Drawing.Image)(resources.GetObject("Packing.DownImage")));
+            this.Packing.Font = new System.Drawing.Font("微软雅黑", 9F);
+            this.Packing.Image = null;
+            this.Packing.IsShowBorder = true;
+            this.Packing.Location = new System.Drawing.Point(20, 144);
+            this.Packing.Margin = new System.Windows.Forms.Padding(4);
+            this.Packing.MoveImage = ((System.Drawing.Image)(resources.GetObject("Packing.MoveImage")));
+            this.Packing.Name = "Packing";
+            this.Packing.NormalImage = ((System.Drawing.Image)(resources.GetObject("Packing.NormalImage")));
+            this.Packing.Power = null;
+            this.Packing.Size = new System.Drawing.Size(80, 30);
+            this.Packing.TabIndex = 173;
+            this.Packing.Text = "封箱";
+            this.Packing.UseVisualStyleBackColor = true;
+            this.Packing.Click += new System.EventHandler(this.Packing_Click);
+            // 
+            // pr_packrule
+            // 
+            this.pr_packrule.AutoSize = true;
+            this.pr_packrule.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_packrule.Location = new System.Drawing.Point(1132, 568);
+            this.pr_packrule.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_packrule.Name = "pr_packrule";
+            this.pr_packrule.Size = new System.Drawing.Size(0, 27);
+            this.pr_packrule.TabIndex = 173;
+            this.pr_packrule.Visible = false;
+            // 
+            // pa_status
+            // 
+            this.pa_status.AutoSize = true;
+            this.pa_status.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_status.Location = new System.Drawing.Point(1036, 536);
+            this.pa_status.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_status.Name = "pa_status";
+            this.pa_status.Size = new System.Drawing.Size(0, 27);
+            this.pa_status.TabIndex = 174;
+            this.pa_status.Visible = false;
+            // 
+            // ob_checkno
+            // 
+            this.ob_checkno.AutoSize = true;
+            this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_checkno.Location = new System.Drawing.Point(1090, 536);
+            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_checkno.Name = "ob_checkno";
+            this.ob_checkno.Size = new System.Drawing.Size(0, 27);
+            this.ob_checkno.TabIndex = 175;
+            this.ob_checkno.Visible = false;
+            this.ob_checkno.TextChanged += new System.EventHandler(this.ob_checkno_TextChanged);
+            // 
+            // groupBoxWithBorder3
+            // 
+            this.groupBoxWithBorder3.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder3.Controls.Add(this.pr_cartonunit1);
+            this.groupBoxWithBorder3.Controls.Add(this.pr_cartonunit);
+            this.groupBoxWithBorder3.Controls.Add(this.pr_cartonboxgw);
+            this.groupBoxWithBorder3.Controls.Add(this.label4);
+            this.groupBoxWithBorder3.Controls.Add(this.weight);
+            this.groupBoxWithBorder3.Controls.Add(this.label2);
+            this.groupBoxWithBorder3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.groupBoxWithBorder3.Location = new System.Drawing.Point(898, 213);
+            this.groupBoxWithBorder3.Name = "groupBoxWithBorder3";
+            this.groupBoxWithBorder3.Size = new System.Drawing.Size(257, 301);
+            this.groupBoxWithBorder3.TabIndex = 172;
+            this.groupBoxWithBorder3.TabStop = false;
+            this.groupBoxWithBorder3.Text = "称量信息";
+            this.groupBoxWithBorder3.TextColor = System.Drawing.Color.Black;
+            // 
+            // pr_cartonunit1
+            // 
+            this.pr_cartonunit1.AutoSize = true;
+            this.pr_cartonunit1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_cartonunit1.Location = new System.Drawing.Point(127, 172);
+            this.pr_cartonunit1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_cartonunit1.Name = "pr_cartonunit1";
+            this.pr_cartonunit1.Size = new System.Drawing.Size(25, 27);
+            this.pr_cartonunit1.TabIndex = 184;
+            this.pr_cartonunit1.Tag = "pr_cartonunit";
+            this.pr_cartonunit1.Text = "g";
+            // 
+            // pr_cartonunit
+            // 
+            this.pr_cartonunit.AutoSize = true;
+            this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_cartonunit.Location = new System.Drawing.Point(85, 45);
+            this.pr_cartonunit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_cartonunit.Name = "pr_cartonunit";
+            this.pr_cartonunit.Size = new System.Drawing.Size(25, 27);
+            this.pr_cartonunit.TabIndex = 183;
+            this.pr_cartonunit.Text = "g";
+            // 
+            // pr_cartonboxgw
+            // 
+            this.pr_cartonboxgw.AutoSize = true;
+            this.pr_cartonboxgw.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_cartonboxgw.Location = new System.Drawing.Point(82, 233);
+            this.pr_cartonboxgw.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_cartonboxgw.Name = "pr_cartonboxgw";
+            this.pr_cartonboxgw.Size = new System.Drawing.Size(0, 27);
+            this.pr_cartonboxgw.TabIndex = 182;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label4.Location = new System.Drawing.Point(30, 172);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.TabIndex = 181;
+            this.label4.Text = "标准重量";
+            // 
+            // weight
+            // 
+            this.weight.AutoSize = true;
+            this.weight.Font = new System.Drawing.Font("微软雅黑", 20F);
+            this.weight.ForeColor = System.Drawing.Color.Lime;
+            this.weight.Location = new System.Drawing.Point(79, 92);
+            this.weight.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.weight.Name = "weight";
+            this.weight.Size = new System.Drawing.Size(0, 45);
+            this.weight.TabIndex = 180;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(30, 45);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(52, 27);
+            this.label2.TabIndex = 179;
+            this.label2.Text = "重量";
+            // 
+            // Baurate
+            // 
+            this.Baurate.AutoSize = true;
+            this.Baurate.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Baurate.Location = new System.Drawing.Point(955, 536);
+            this.Baurate.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Baurate.Name = "Baurate";
+            this.Baurate.Size = new System.Drawing.Size(0, 27);
+            this.Baurate.TabIndex = 176;
+            this.Baurate.Visible = false;
+            // 
+            // ComList
+            // 
+            this.ComList.AutoSize = true;
+            this.ComList.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ComList.Location = new System.Drawing.Point(977, 536);
+            this.ComList.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ComList.Name = "ComList";
+            this.ComList.Size = new System.Drawing.Size(0, 27);
+            this.ComList.TabIndex = 177;
+            this.ComList.Visible = false;
+            // 
+            // pa_downstatus
+            // 
+            this.pa_downstatus.AutoSize = true;
+            this.pa_downstatus.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_downstatus.Location = new System.Drawing.Point(1108, 568);
+            this.pa_downstatus.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_downstatus.Name = "pa_downstatus";
+            this.pa_downstatus.Size = new System.Drawing.Size(0, 27);
+            this.pa_downstatus.TabIndex = 179;
+            this.pa_downstatus.Visible = false;
+            // 
+            // pa_checkno
+            // 
+            this.pa_checkno.AutoSize = true;
+            this.pa_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_checkno.Location = new System.Drawing.Point(1116, 589);
+            this.pa_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_checkno.Name = "pa_checkno";
+            this.pa_checkno.Size = new System.Drawing.Size(0, 27);
+            this.pa_checkno.TabIndex = 180;
+            this.pa_checkno.Visible = false;
+            // 
+            // pa_sccode
+            // 
+            this.pa_sccode.AutoSize = true;
+            this.pa_sccode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pa_sccode.Location = new System.Drawing.Point(1100, 568);
+            this.pa_sccode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_sccode.Name = "pa_sccode";
+            this.pa_sccode.Size = new System.Drawing.Size(0, 27);
+            this.pa_sccode.TabIndex = 181;
+            this.pa_sccode.Visible = false;
+            // 
+            // Make_SpecialCartonPack
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1172, 727);
+            this.Controls.Add(this.pa_sccode);
+            this.Controls.Add(this.pa_checkno);
+            this.Controls.Add(this.pa_downstatus);
+            this.Controls.Add(this.ComList);
+            this.Controls.Add(this.Baurate);
+            this.Controls.Add(this.groupBoxWithBorder3);
+            this.Controls.Add(this.ob_checkno);
+            this.Controls.Add(this.pa_status);
+            this.Controls.Add(this.pr_packrule);
+            this.Controls.Add(this.groupBoxWithBorder2);
+            this.Controls.Add(this.groupBoxWithBorder1);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.pa_id);
+            this.Controls.Add(this.Clean);
+            this.Controls.Add(this.sn_code);
+            this.Controls.Add(this.PackageDetail);
+            this.Controls.Add(this.Cancel);
+            this.Controls.Add(this.label13);
+            this.Controls.Add(this.ms_makecode);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Name = "Make_SpecialCartonPack";
+            this.Tag = "Make!SpecialCartonPack";
+            this.Text = "装箱称重";
+            this.Activated += new System.EventHandler(this.包装采集_Activated);
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.包装采集_FormClosing);
+            this.Load += new System.EventHandler(this.包装采集_Load);
+            this.SizeChanged += new System.EventHandler(this.包装采集_SizeChanged);
+            ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).EndInit();
+            this.groupBoxWithBorder1.ResumeLayout(true);
+            this.groupBoxWithBorder1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pr_outboxinnerqty)).EndInit();
+            this.groupBoxWithBorder2.ResumeLayout(true);
+            this.groupBoxWithBorder2.PerformLayout();
+            this.groupBoxWithBorder3.ResumeLayout(true);
+            this.groupBoxWithBorder3.PerformLayout();
+            this.ResumeLayout(true);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+        private System.Windows.Forms.Label ms_makecode;
+        private System.Windows.Forms.Label label13;
+        private System.Windows.Forms.Label pa_code_label;
+        private System.Windows.Forms.Label PrintList_label;
+        private System.Windows.Forms.Label PrintNum_label;
+        private System.Windows.Forms.CheckBox Cancel;
+
+        private CustomControl.DataGrid_View.DataGridViewWithSerialNum PackageDetail;
+        private CustomControl.TextBoxWithIcon.EnterTextBox sn_code;
+        private CustomControl.ButtonUtil.NormalButton Clean;
+        private CustomControl.ButtonUtil.NormalButton Printing;
+        private System.Windows.Forms.Label pa_id;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private CustomControl.ComBoxWithFocus.PrinterCombox PrintList;
+        private System.Windows.Forms.ComboBox PrintLabel;
+        private System.Windows.Forms.Label label3;
+        private CustomControl.TextBoxWithIcon.TextBoxGeneratePaCode pa_outboxcode;
+        private System.Windows.Forms.NumericUpDown PrintNum;
+        private CustomControl.CustomCheckBox.AutoPrintCheckBox AutoPrint;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder1;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder2;
+        private CustomControl.ButtonUtil.NormalButton Packing;
+        private System.Windows.Forms.CheckBox AutoGenBoxCode;
+        private System.Windows.Forms.Label pr_packrule;
+        private System.Windows.Forms.Label pa_status;
+        private CustomControl.ButtonUtil.NormalButton SendCheck;
+        private System.Windows.Forms.Label ob_batchqty;
+        private System.Windows.Forms.Label ob_nowcheckqty_label;
+        private System.Windows.Forms.Label ob_batchqty_label;
+        private System.Windows.Forms.Label ob_nowcheckqty;
+        private System.Windows.Forms.Label ob_checkno;
+        private CustomControl.GroupBoxWithBorder.GroupBoxWithBorder groupBoxWithBorder3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label weight;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label pr_cartonboxgw;
+        private System.Windows.Forms.Label Baurate;
+        private System.Windows.Forms.Label ComList;
+        private System.Windows.Forms.Label pr_cartonunit;
+        private System.Windows.Forms.Label pr_cartonunit1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_barcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_outboxcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_prodcode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_innerqty;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pa_indate;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_id;
+        private System.Windows.Forms.Label pa_downstatus;
+        private System.Windows.Forms.Label pa_checkno;
+        private System.Windows.Forms.Label pa_sccode;
+        private System.Windows.Forms.NumericUpDown pr_outboxinnerqty;
+        private System.Windows.Forms.Label pa_currentqty_label;
+        private System.Windows.Forms.Label pr_detail_label;
+        private System.Windows.Forms.Label pa_currentqty;
+        private System.Windows.Forms.Label pr_code_label;
+        private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.Label pr_outboxinnerqty_label;
+        private System.Windows.Forms.Label pr_code;
+    }
+}

+ 489 - 0
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -0,0 +1,489 @@
+using LabelManager2;
+using System;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.Entity;
+using UAS_MES.PublicMethod;
+using System.Drawing;
+using System.Threading;
+using UAS_MES.PublicForm;
+using System.IO.Ports;
+using System.IO;
+using System.Text.RegularExpressions;
+
+namespace UAS_MES.Make
+{
+    public partial class Make_SpecialCartonPack : Form
+    {
+        DataHelper dh;
+        DataTable dt;
+        LogStringBuilder sql = new LogStringBuilder();
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        ApplicationClass lbl;
+        Thread thread;
+        DataTable Dbfind;
+        string ErrorMessage = "";
+        string oMakeCode = "";
+        string oMsID = "";
+        //称量的标准重量
+        double Weight;
+        //最大重量
+        double MaxWeight;
+        //最小重量
+        double MinWeight;
+
+        int StandardQTY = 0;
+
+        string oOutBoxCode = "";
+
+        //创建串口实例
+        SerialPort serialPort1 = new SerialPort();
+
+        //true的时候表示从串口读取数据
+        bool GetData = true;
+
+        System.DateTime[] indate;
+
+        public Make_SpecialCartonPack()
+        {
+            InitializeComponent();
+        }
+
+        //创建打印进程
+        private void NewPrint()
+        {
+            try
+            {
+                lbl = new ApplicationClass();
+                BaseUtil.WriteLbl(lbl);
+            }
+            catch (Exception ex)
+            {
+                OperateResult.AppendText("未正确安装CodeSoft软件\n", Color.Red);
+            }
+        }
+
+        private void 包装采集_Load(object sender, EventArgs e)
+        {
+            pa_outboxcode.ShowClickIcon = false;
+            ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
+            Baurate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
+            //设置DbFind的必须的数据
+            PrintNum.Value = 1;
+            asc.controllInitializeSize(this);
+            thread = new Thread(NewPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(thread, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+            dh = new DataHelper();
+            thread = new Thread(getSerialData);
+            try
+            {
+                GetData = true;
+                serialPort1.PortName = ComList.Text;
+                serialPort1.BaudRate = int.Parse(Baurate.Text);
+                serialPort1.Open();
+                thread.Start();
+            }
+            catch (Exception mes)
+            {
+                if (Baurate.Text == "" || ComList.Text == "")
+                    OperateResult.AppendText(">>请先在电子秤调试界面维护波特率和串口\n", Color.Red);
+                else
+                    OperateResult.AppendText(">>" + mes.Message + "\n", Color.Red);
+            }
+        }
+
+
+        private void getSerialData()
+        {
+            if (serialPort1.IsOpen)
+            {
+                if (!SystemInf.OpenPort.Contains(serialPort1.PortName))
+                {
+                    SystemInf.OpenPort.Add(serialPort1.PortName);
+                    try
+                    {
+                        while (GetData)
+                        {
+                            try
+                            {
+                                weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
+                                if (pr_cartonunit.Text == "kg")
+                                    weight.Text = (double.Parse(weight.Text) / 1000).ToString();
+                            }
+                            catch (Exception)
+                            {
+                                GetData = false;
+                            }
+                        }
+                    }
+                    catch (IOException ex) { MessageBox.Show(ex.Message); }
+                }
+                else OperateResult.AppendText(">>端口已被占用,请关闭其他窗口\n", Color.Red);
+            }
+        }
+
+        private void 包装采集_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+
+        private void 包装采集_Activated(object sender, EventArgs e)
+        {
+            pa_outboxcode.Focus();
+        }
+
+        //刷新表单的数据的数据
+        private void LoadData()
+        {
+            //加载表单数据
+            string Err = "";
+            if (pa_outboxcode.Text != "")
+            {
+                sql.Clear();
+                sql.Append("select pr_cartonmaxw,pr_cartonunit,pr_cartonminw,pr_cartongw,pa_outboxcode,pa_sccode,nvl(pa_downstatus,0) pa_downstatus,pa_checkno,");
+                sql.Append("pa_status,pr_packrule,pr_detail,pa_packageqty,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_standardqty,pa_currentqty from package left join ");
+                sql.Append("product on pa_prodcode=pr_code where pa_outboxcode='" + pa_outboxcode.Text + "'");
+                Err = "箱号";
+            }
+            else
+            {
+                sql.Clear();
+                sql.Append("select pr_cartonmaxw,pr_cartonunit,pr_cartonminw,pr_cartongw,ms_makecode,pa_sccode,pa_status,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,");
+                sql.Append("pa_checkno,pr_packrule,pr_code,pr_detail,nvl(pa_standardqty,pr_outboxinnerqty) pr_outboxinnerqty,pa_packageqty,pa_currentqty,");
+                sql.Append("pa_outboxcode from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");
+                sql.Append("on pd_barcode=ms_sncode left join package on pa_id =pd_paid where ms_id='" + oMsID + "'");
+                Err = "序列号";
+            }
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                //重量的临时变量
+                string _weight = dt.Rows[0]["pr_cartongw"].ToString();
+                string _maxweight = dt.Rows[0]["pr_cartonmaxw"].ToString();
+                string _minweight = dt.Rows[0]["pr_cartonminw"].ToString();
+                //赋值重量单位
+                Weight = double.Parse(_weight == "" ? "0" : _weight);
+                MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
+                StandardQTY = int.Parse(dt.Rows[0]["pr_outboxinnerqty"].ToString());
+                BaseUtil.SetFormValue(this.Controls, dt);
+                if (Weight - MinWeight == MaxWeight - Weight)
+                    pr_cartonboxgw.Text = Weight + "±" + (MaxWeight - Weight);
+                else
+                    pr_cartonboxgw.Text = MinWeight + "-" + MaxWeight;
+            }
+            else OperateResult.AppendText(">>" + Err + "不存在\n", Color.Red);
+        }
+
+        private void LoadGridData()
+        {
+            //加载Grid数据
+            dt = (DataTable)dh.ExecuteSql("select pa_outboxcode,pa_prodcode,pd_barcode,pd_innerqty,pa_indate from packageDetail left join package on pa_id=pd_paid where pa_outboxcode='" + pa_outboxcode.Text + "'", "select");
+            BaseUtil.FillDgvWithDataTable(PackageDetail, dt);
+        }
+
+        private void Print_Click(object sender, EventArgs e)
+        {
+            if (PrintLabel.Items.Count != 0)
+            {
+                if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() == "1")
+                {
+                    dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
+                    OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
+                    Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                }
+                else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "尚未封箱,请封箱后执行打印\n", Color.Red);
+            }
+            else OperateResult.AppendText(">>产品" + pr_code.Text + "未维护打印标签\n", Color.Red);
+        }
+
+        //加载工单信息和装箱明细信息
+        private void pa_code_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                LoadData();
+                LoadGridData();
+            }
+        }
+
+        //输入序列号的回车事件
+        private void barcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            //当用户输入回车键的时候
+            if (e.KeyCode == Keys.Enter)
+            {
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
+                {
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
+                    {
+                        if (pa_outboxcode.Text == "")
+                        {
+                            sql.Clear();
+                            sql.Append("select ms_prodcode from makeserial where ms_id='" + oMsID + "'");
+                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                            pa_outboxcode.MakeCode = oMakeCode;
+                            pa_outboxcode.ProdCode = dt.Rows[0]["ms_prodcode"].ToString();
+                            pa_outboxcode.Caller = "PACKAGE";
+                            LoadData();
+                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                                LoadGridData();
+                            else
+                                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                        }
+                        //判断箱内总数必须大于0
+                        if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
+                        {
+                            OperateResult.AppendText(">>箱内容量必须大于0\n", Color.Red);
+                            return;
+                        }
+                        //如果未勾选了取消录入
+                        if (!Cancel.Checked)
+                        {
+                            //判断序列号是否已经装箱
+                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                            {
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "已经装箱!\n", Color.Red, sn_code);
+                            }
+                            else
+                            {
+                                //满箱之后采集下一个之前自动清除内容,生成新的箱号
+                                if ((AutoGenBoxCode.Checked && pa_currentqty.Text != "" && pr_outboxinnerqty.Text == pa_currentqty.Text) || pa_status.Text == "1")
+                                {
+                                    pa_currentqty.Text = "";
+                                    pa_outboxcode.Text = "";
+                                    pa_status.Text = "0";
+                                    BaseUtil.CleanDGVData(PackageDetail);
+                                    pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                                }
+                                if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "特殊", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
+                                {
+                                    if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code.Text, "包装采集", "装箱成功", User.UserCode, out ErrorMessage))
+                                    {
+                                        LoadCheckQTY();
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "采集成功!\n", Color.Green);
+                                        //满箱更新状态为1
+                                        if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) + 1 == int.Parse(pr_outboxinnerqty.Text))
+                                        {
+                                            dh.UpdateByCondition("package", "pa_status=1,pa_weight='" + weight.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                            if (AutoPrint.Checked)
+                                                Print_Click(new object(), new EventArgs());
+                                        }
+                                        LoadData();
+                                        LoadGridData();
+                                        sn_code.Clear();
+                                    }
+                                }
+                                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                            }
+                        }
+                        //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
+                        else
+                        {
+                            if (LogicHandler.Packing(sn_code.Text, pa_outboxcode.Text, AutoGenBoxCode.Checked, "特殊", User.UserSourceCode, User.UserCode, pr_outboxinnerqty.Text, Cancel.Checked, out oOutBoxCode, out ErrorMessage))
+                            {
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "取消采集成功", sn_code.Text, "");
+                                LoadGridData();
+                                OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green, sn_code);
+                            }
+                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
+                        }
+                    }
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
+                }
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
+            }
+        }
+
+        private void Clean_Click(object sender, EventArgs e)
+        {
+            OperateResult.Clear();
+        }
+
+        private void pr_code_TextChanged(object sender, EventArgs e)
+        {
+
+        }
+
+        private void 包装采集_FormClosing(object sender, FormClosingEventArgs e)
+        {
+            BaseUtil.ClosePrint(lbl);
+            if (serialPort1.IsOpen)
+            {
+                GetData = false;
+                serialPort1.Close();
+                SystemInf.OpenPort.Remove(serialPort1.PortName);
+                thread.Interrupt();
+            }
+            dh.Dispose();
+        }
+
+        private void Packing_Click(object sender, EventArgs e)
+        {
+            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "' and pa_status<>1"))
+            {
+                dh.UpdateByCondition("package", "pa_status=1,pa_totalqty=pa_currentqty,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                pa_status.Text = "1";
+                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "封箱成功\n", Color.Green);
+            }
+            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "错误或者已封箱\n", Color.Red);
+        }
+
+        private void SendCheck_Click(object sender, EventArgs e)
+        {
+            if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "0")
+            {
+                sql.Clear();
+                sql.Append("update oqcbatch set ob_status='UNCHECK' where ob_checkno ='" + ob_checkno.Text + "'");
+                dh.ExecuteSql(sql.GetString(), "select");
+                ob_nowcheckqty.Text = "";
+                ob_batchqty.Text = "";
+                ob_nowcheckqty.ForeColor = Color.Black;
+                SendCheck.Enabled = false;
+                OperateResult.AppendText(">>批次" + ob_checkno.Text + "送检成功\n", Color.Green);
+                LogicHandler.InsertMakeProcess(sn_code.Text, oMakeCode, User.UserSourceCode, "手动送检", "手动送检成功", User.UserCode);
+                //记录操作日志
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
+                ob_checkno.Text = "";
+            }
+            else OperateResult.AppendText(">>必须封箱才能送检\n", Color.Red);
+
+
+        }
+
+        bool AutoCut;
+
+        private void LoadCheckQTY()
+        {
+            sql.Clear();
+            string condition = "";
+            int nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
+            int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+            if (nowcheckqty + 1 == batchqty && AutoCut)
+            {
+                condition = "and ob_status='UNCHECK' and ob_checkno='" + ob_checkno.Text + "'";
+            }
+            else
+            {
+                condition = "and ob_status='ENTERING' ";
+            }
+            sql.Append("select ob_batchqty,ob_nowcheckqty,ob_checkno from oqcbatch where ");
+            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pr_code.Text + "' and ");
+            sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                ob_batchqty.Text = dt.Rows[0]["ob_batchqty"].ToString();
+                ob_nowcheckqty.Text = dt.Rows[0]["ob_nowcheckqty"].ToString();
+                ob_checkno.Text = dt.Rows[0]["ob_checkno"].ToString();
+                nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
+                batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                if (nowcheckqty == batchqty)
+                {
+                    ob_nowcheckqty.ForeColor = Color.Red;
+                    OperateResult.AppendText(">>当前采集数量已达到送检数量\n", Color.Red);
+                }
+            }
+            else
+            {
+                ob_batchqty.Text = "";
+                ob_nowcheckqty.Text = "";
+                ob_checkno.Text = "";
+                SendCheck.Enabled = false;
+            }
+            if (ob_batchqty.Text != "")
+            {
+                SendCheck.Enabled = true;
+            }
+            else
+            {
+                SendCheck.Enabled = false;
+            }
+        }
+
+        private void ob_checkno_TextChanged(object sender, EventArgs e)
+        {
+            if (ob_checkno.Text != "")
+            {
+                string Cut = dh.getFieldDataByCondition("product left join oqcbatch on ob_prodcode=pr_code", "pr_ifautocutcheckno", "ob_checkno='" + ob_checkno.Text + "'").ToString();
+                if (Cut == "" || Cut == "0")
+                    AutoCut = false;
+                else
+                    AutoCut = true;
+                SendCheck.Enabled = true;
+            }
+        }
+
+        private void pr_outboxinnerqty_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+                ResetPackQTY();
+        }
+
+        private void pr_outboxinnerqty_Leave(object sender, EventArgs e)
+        {
+            ResetPackQTY();
+        }
+
+        private void ResetPackQTY()
+        {
+            //数据不符合限制的时候保持原有值
+            int curretnqty = int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text);
+            if (!(pr_outboxinnerqty.Value >= curretnqty))
+            {
+                pr_outboxinnerqty.Value = StandardQTY;
+            }
+            else
+            {
+                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                {
+                    string checknostatus = dh.getFieldDataByCondition("oqcbatch", "ob_status", "ob_checkno='" + pa_checkno.Text + "'").ToString();
+                    if (checknostatus == "" || checknostatus == "ENTERING")
+                    {
+                        if (pa_downstatus.Text == "0")
+                        {
+                            if (dh.CheckExist("source", "sc_code='" + pa_sccode.Text + "' and  sc_stepcode='" + User.CurrentStepCode + "'"))
+                            {
+                                dh.UpdateByCondition("package", "pa_standardqty='" + pr_outboxinnerqty.Value + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "修改箱内容量", "原容量" + StandardQTY + ",修改为" + pr_outboxinnerqty.Value + "'", pa_outboxcode.Text, pa_checkno.Text);
+                                return;
+                            }
+                            else
+                                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "当前所在工序不是登录岗位资源所在工序,不允许修改数量\n", Color.Red);
+                        }
+                        else
+                            OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "处于下地状态,不允许修改标准容量\n", Color.Red);
+                    }
+                    else
+                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "处于送检中,不允许修改标准容量\n", Color.Red);
+                }
+                else
+                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "不存在,修改容量无效\n", Color.Red);
+                pr_outboxinnerqty.Value = StandardQTY;
+            }
+        }
+
+        private void PackageDetail_DataSourceChanged(object sender, EventArgs e)
+        {
+            if (PackageDetail.RowCount == 1)
+            {
+                LoadCheckQTY();
+                dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
+                PrintLabel.DataSource = dt;
+                PrintLabel.DisplayMember = "pl_laname";
+                PrintLabel.ValueMember = "pl_labelcode";
+                ftpOperater ftp = new ftpOperater();
+                indate = new System.DateTime[dt.Rows.Count];
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    BaseUtil.GetPrintLabel(dt.Rows[i]["pl_labelname"].ToString(), dt.Rows[i]["pl_labelurl"].ToString(), dt.Rows[i]["pl_indate"].ToString());
+                    indate[i] = Convert.ToDateTime(dt.Rows[i]["pl_indate"].ToString());
+                }
+            }
+        }
+    }
+}

+ 291 - 0
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.resx

@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="Printing.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Printing.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Printing.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Clean.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Clean.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <metadata name="pd_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_prodcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_indate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <data name="SendCheck.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="SendCheck.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="SendCheck.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Packing.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Packing.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Packing.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+</root>

+ 241 - 0
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.Designer.cs

@@ -0,0 +1,241 @@
+namespace UAS_MES.Packing
+{
+    partial class Packing_CartonSplit
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.label1 = new System.Windows.Forms.Label();
+            this.lock_outbox = new System.Windows.Forms.CheckBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.pa_currentqty = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.pa_prodcode = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.packtype = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.count = new System.Windows.Forms.Label();
+            this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
+            this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.pa_outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.SuspendLayout();
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(39, 29);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(62, 31);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "箱号";
+            // 
+            // lock_outbox
+            // 
+            this.lock_outbox.AutoSize = true;
+            this.lock_outbox.Location = new System.Drawing.Point(342, 35);
+            this.lock_outbox.Name = "lock_outbox";
+            this.lock_outbox.Size = new System.Drawing.Size(22, 21);
+            this.lock_outbox.TabIndex = 2;
+            this.lock_outbox.UseVisualStyleBackColor = true;
+            this.lock_outbox.CheckedChanged += new System.EventHandler(this.lock_outbox_CheckedChanged);
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(676, 29);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.TabIndex = 3;
+            this.label2.Text = "箱内数量";
+            // 
+            // pa_currentqty
+            // 
+            this.pa_currentqty.AutoSize = true;
+            this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pa_currentqty.Location = new System.Drawing.Point(792, 29);
+            this.pa_currentqty.Name = "pa_currentqty";
+            this.pa_currentqty.Size = new System.Drawing.Size(0, 31);
+            this.pa_currentqty.TabIndex = 4;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label4.Location = new System.Drawing.Point(39, 116);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(110, 31);
+            this.label4.TabIndex = 5;
+            this.label4.Text = "产品编号";
+            // 
+            // pa_prodcode
+            // 
+            this.pa_prodcode.AutoSize = true;
+            this.pa_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.pa_prodcode.Location = new System.Drawing.Point(160, 116);
+            this.pa_prodcode.Name = "pa_prodcode";
+            this.pa_prodcode.Size = new System.Drawing.Size(0, 31);
+            this.pa_prodcode.TabIndex = 6;
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label6.Location = new System.Drawing.Point(669, 116);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(120, 31);
+            this.label6.TabIndex = 7;
+            this.label6.Text = "工单/合同";
+            // 
+            // packtype
+            // 
+            this.packtype.AutoSize = true;
+            this.packtype.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.packtype.Location = new System.Drawing.Point(802, 116);
+            this.packtype.Name = "packtype";
+            this.packtype.Size = new System.Drawing.Size(0, 31);
+            this.packtype.TabIndex = 8;
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label8.Location = new System.Drawing.Point(39, 486);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(86, 31);
+            this.label8.TabIndex = 9;
+            this.label8.Text = "序列号";
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(554, 486);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(52, 27);
+            this.label9.TabIndex = 10;
+            this.label9.Text = "计数";
+            // 
+            // count
+            // 
+            this.count.AutoSize = true;
+            this.count.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.count.Location = new System.Drawing.Point(670, 486);
+            this.count.Name = "count";
+            this.count.Size = new System.Drawing.Size(24, 27);
+            this.count.TabIndex = 12;
+            this.count.Text = "0";
+            // 
+            // OperateResult
+            // 
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Location = new System.Drawing.Point(31, 204);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.OperateResult.Name = "OperateResult";
+            this.OperateResult.Size = new System.Drawing.Size(915, 246);
+            this.OperateResult.TabIndex = 196;
+            this.OperateResult.Text = "";
+            // 
+            // sncode
+            // 
+            this.sncode.AllPower = null;
+            this.sncode.BackColor = System.Drawing.Color.White;
+            this.sncode.ID = null;
+            this.sncode.Location = new System.Drawing.Point(159, 486);
+            this.sncode.Name = "sncode";
+            this.sncode.Power = null;
+            this.sncode.Size = new System.Drawing.Size(196, 28);
+            this.sncode.Str = null;
+            this.sncode.Str1 = null;
+            this.sncode.Str2 = null;
+            this.sncode.TabIndex = 11;
+            this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
+            // 
+            // pa_outboxcode
+            // 
+            this.pa_outboxcode.AllPower = null;
+            this.pa_outboxcode.BackColor = System.Drawing.Color.White;
+            this.pa_outboxcode.ID = null;
+            this.pa_outboxcode.Location = new System.Drawing.Point(127, 32);
+            this.pa_outboxcode.Name = "pa_outboxcode";
+            this.pa_outboxcode.Power = null;
+            this.pa_outboxcode.Size = new System.Drawing.Size(196, 28);
+            this.pa_outboxcode.Str = null;
+            this.pa_outboxcode.Str1 = null;
+            this.pa_outboxcode.Str2 = null;
+            this.pa_outboxcode.TabIndex = 1;
+            this.pa_outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_outboxcode_KeyDown);
+            // 
+            // Packing_CartonSplit
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(982, 581);
+            this.Controls.Add(this.OperateResult);
+            this.Controls.Add(this.count);
+            this.Controls.Add(this.sncode);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.label8);
+            this.Controls.Add(this.packtype);
+            this.Controls.Add(this.label6);
+            this.Controls.Add(this.pa_prodcode);
+            this.Controls.Add(this.label4);
+            this.Controls.Add(this.pa_currentqty);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.lock_outbox);
+            this.Controls.Add(this.pa_outboxcode);
+            this.Controls.Add(this.label1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Name = "Packing_CartonSplit";
+            this.Tag = "Packing!CartonSplit";
+            this.Text = "Packing_CartonSplit";
+            this.Load += new System.EventHandler(this.Packing_CartonSplit_Load);
+            this.SizeChanged += new System.EventHandler(this.Packing_CartonSplit_SizeChanged);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox pa_outboxcode;
+        private System.Windows.Forms.CheckBox lock_outbox;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label pa_currentqty;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label pa_prodcode;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label packtype;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label9;
+        private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
+        private System.Windows.Forms.Label count;
+        private CustomControl.RichText.RichTextAutoBottom OperateResult;
+    }
+}

+ 239 - 0
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.cs

@@ -0,0 +1,239 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Windows.Forms;
+using UAS_MES.DataOperate;
+using UAS_MES.Entity;
+using UAS_MES.PublicMethod;
+
+namespace UAS_MES.Packing
+{
+    public partial class Packing_CartonSplit : Form
+    {
+        //拼接sql的
+        LogStringBuilder sql = new LogStringBuilder();
+
+        DataHelper dh;
+
+        DataTable dt;//存放箱号查询信息
+
+        DataTable checknoInfo;
+
+        string error = "";//记录错误信息
+
+        string ms_id = "";
+
+        string outboxcode = "";
+
+        string pd_id = "";
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+        public Packing_CartonSplit()
+        {
+            InitializeComponent();
+        }
+        private void Packing_CartonSplit_Load(object sender, EventArgs e)
+        {
+            dh = new DataHelper();
+            asc.controllInitializeSize(this);
+            OperateResult.AppendText(">>请输入箱号\n", Color.Black);
+            pa_outboxcode.Focus();
+        }
+        private void pa_outboxcode_KeyDown(object sender, KeyEventArgs e)
+        {
+            //按下回车
+            if (e.KeyCode==Keys.Enter)
+            {
+                lKeyDown(false);
+            }
+        }
+
+        private void sncode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode==Keys.Enter) {
+                if (sncode.Text=="") {
+                    OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                    return;
+                }
+                //判断箱号是否为空
+                if (pa_outboxcode.Text=="") {
+                    OperateResult.AppendText("<<请先选择箱号\n", Color.Red, sncode);
+                    return;
+                }
+                OperateResult.AppendText(">>" + sncode.Text + "\n", Color.Black);
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out error))
+                {
+                    //验证序列号是否存在,是否装箱,箱号等于页面输入的箱号
+                    //select max(ms_id) from makeserial where ms_sncode=?
+                    ms_id = dh.getFieldDataByCondition("makeserial","max(ms_id)","ms_sncode='"+sncode.Text+"'").ToString();
+                    if (ms_id=="") {
+                        OperateResult.AppendText("<<序列号" + sncode.Text + "不存在\n", Color.Red, sncode);
+                        return;
+                    }
+                    outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode","ms_id='"+ms_id+"' and nvl(ms_outboxcode,' ')<>' '").ToString();
+                    if (outboxcode=="") {
+                        OperateResult.AppendText("<<序列号" + sncode.Text + "未装箱\n", Color.Red, sncode);
+                        return;
+                    }
+                    if (pa_outboxcode.Text!=outboxcode)
+                    {
+                        OperateResult.AppendText("<<序列号" + sncode.Text + "箱号为:" + outboxcode+",不在箱号:"+pa_outboxcode.Text+ "中,无法拆箱\n", Color.Red, sncode);
+                        return;
+                    }
+                    //验证箱号
+                    if (!checkOutboxcode(false))
+                    {
+                        return;
+                    }
+                    //验证是否在箱内
+                    pd_id = dh.getFieldDataByCondition("packagedetail", "pd_id", "pd_outboxcode='"+pa_outboxcode.Text+"' and pd_barcode='"+sncode.Text+"'").ToString();
+                    if (pd_id=="")
+                    {
+                        OperateResult.AppendText("<<序列号" + sncode.Text + "不在箱号:" + pa_outboxcode.Text+ "内,不允许拆箱\n", Color.Red, sncode);
+                        return;
+                    }
+                    //进行拆箱处理
+                    //删除明细
+                    dh.ExecuteSql("delete from packagedetail where pd_id='"+pd_id+"'", "select");
+                    //更新序列号
+                    dh.ExecuteSql("update makeserial set ms_outboxcode='' where ms_id='"+ms_id+"'", "update");
+                    //更新箱内当前数量
+                    dh.ExecuteSql("update package set pa_currentqty=pa_currentqty-1 where pa_outboxcode='"+pa_outboxcode.Text+"'", "update");
+                    //记录拆箱操作日志
+                    LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,packtype.Text,User.UserLineCode,User.UserSourceCode,"卡通箱拆箱", "卡通箱拆箱成功,序列号:"+sncode.Text+",箱号:"+pa_outboxcode.Text,sncode.Text,"");
+                    //提示拆箱成功
+                    OperateResult.AppendText("<<拆箱成功,序列号:"+sncode.Text+",已从箱号:"+pa_outboxcode.Text+ "内移除\n", Color.Green);
+                    //刷新箱内数量
+                    pa_currentqty.Text = int.Parse(pa_currentqty.Text)-1+"";
+                    //计数加1
+                    count.Text = int.Parse(count.Text) + 1 + "";
+                    sncode.Text = "";
+                }
+                else
+                {
+                    OperateResult.AppendText("<<"+error+ "\n", Color.Red, sncode);
+                }
+            }
+        }
+        private bool checkOutboxcode(bool flag)
+        {
+            //校验箱号
+            sql.Clear();
+            sql.Append("select pa_prodcode,pr_detail,pr_spec,pa_standardqty,nvl(pa_currentqty,0) pa_currentqty,pa_salecode,pa_makecode,");
+            sql.Append("pa_packtype,nvl(pa_downstatus,0) pa_downstatus,pa_checkno from package left join product on ");
+            sql.Append("pr_code=pa_prodcode where pa_outboxcode='" + pa_outboxcode.Text + "'  and PA_TYPE=1");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            //查询无值,提示用户 “箱号不存在”,清空输入框中的值
+            if (dt.Rows.Count == 0)
+            {
+                if (flag)
+                {
+                    MessageBox.Show("箱号"+pa_outboxcode.Text+"不存在");
+                    return false;
+                }
+                OperateResult.AppendText("<<箱号"+pa_outboxcode.Text+"不存在\n", Color.Red, pa_outboxcode);
+                return false;
+            }
+            //判断是否下地
+            if (dt.Rows[0]["pa_downstatus"].ToString() != "0")
+            {
+                if (flag)
+                {
+                    MessageBox.Show("箱号" + pa_outboxcode.Text + "处于下地状态不允许操作");
+                    return false;
+                }
+                OperateResult.AppendText("<<箱号" + pa_outboxcode.Text + "处于下地状态不允许操作\n", Color.Red, pa_outboxcode);
+                return false;
+            }
+            //判断是否有抽检批次号,并且未判定
+            if (dt.Rows[0]["pa_checkno"].ToString() != "")
+            {
+                checknoInfo = (DataTable)dh.ExecuteSql("select count(1) cn from oqcbatch where ob_checkno='" + dt.Rows[0]["pa_checkno"].ToString() + "' and ob_status not in('OK','NG')", "select");
+                //cn>0 ,则返回提示用户“箱号处于送检状态,不允许拆箱”
+                if (int.Parse(checknoInfo.Rows[0]["cn"].ToString()) > 0)
+                {
+                    if (flag)
+                    {
+                        MessageBox.Show("箱号" + pa_outboxcode.Text + "处于送检状态,不允许拆箱");
+                        return false;
+                    }
+                    OperateResult.AppendText("<<箱号" + pa_outboxcode.Text + "处于送检状态,不允许拆箱\n", Color.Red, pa_outboxcode);
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        private void lock_outbox_CheckedChanged(object sender, EventArgs e)
+        {
+            if (!lock_outbox.Checked)
+            {
+                if (!pa_outboxcode.Enabled)
+                {
+                    //取消勾选,箱号不可编辑时设置可编辑
+                    pa_outboxcode.Enabled = true;
+                }
+                    pa_outboxcode.Focus();
+            }
+            else
+            {
+                //勾选
+                if (!lKeyDown(true))
+                {
+                    lock_outbox.Checked = false;
+                }
+            }
+        }
+
+        private void Packing_CartonSplit_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+        }
+        private bool lKeyDown(bool flag)
+        {
+            //输入不能为空
+            if (pa_outboxcode.Text == "")
+            {
+                if (flag)
+                {
+                    MessageBox.Show("输入不能为空");
+                    return false; ;
+                }
+                OperateResult.AppendText("<<输入不能为空\n", Color.Red);
+                return false;
+            }
+            if (pa_outboxcode.Enabled)
+            {
+                OperateResult.AppendText(">>" + pa_outboxcode.Text + "\n", Color.Black);
+            }
+            //验证箱号
+            if (!checkOutboxcode(flag))
+            {
+                return false;
+            }
+            //判定通过,则自动勾选,显示箱号相关信息
+            BaseUtil.SetFormValue(this.Controls, dt);
+            //特殊赋值
+            if (dt.Rows[0]["pa_packtype"].ToString() == "SALE")
+            {
+                packtype.Text = dt.Rows[0]["pa_salecode"].ToString();
+            }
+            else if (dt.Rows[0]["pa_packtype"].ToString() == "MAKE")
+            {
+                packtype.Text = dt.Rows[0]["pa_makecode"].ToString();
+            }
+            else if (dt.Rows[0]["pa_packtype"].ToString() == "MIX" || dt.Rows[0]["pa_packtype"].ToString() == "SPEC")
+            {
+                pa_prodcode.Text = "混包";
+            }
+            pa_outboxcode.Enabled = false;
+            lock_outbox.Checked = true;
+            sncode.Focus();
+            return true;
+        }
+    }
+}

+ 120 - 0
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 114 - 84
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.Designer.cs

@@ -67,9 +67,10 @@
             // 
             this.sn_code_label.AutoSize = true;
             this.sn_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sn_code_label.Location = new System.Drawing.Point(19, 480);
+            this.sn_code_label.Location = new System.Drawing.Point(19, 580);
+            this.sn_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sn_code_label.Name = "sn_code_label";
-            this.sn_code_label.Size = new System.Drawing.Size(58, 21);
+            this.sn_code_label.Size = new System.Drawing.Size(72, 27);
             this.sn_code_label.TabIndex = 176;
             this.sn_code_label.Text = "序列号";
             // 
@@ -78,10 +79,11 @@
             this.sn_code.AllPower = null;
             this.sn_code.BackColor = System.Drawing.Color.White;
             this.sn_code.ID = null;
-            this.sn_code.Location = new System.Drawing.Point(83, 480);
+            this.sn_code.Location = new System.Drawing.Point(108, 582);
+            this.sn_code.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.sn_code.Name = "sn_code";
             this.sn_code.Power = null;
-            this.sn_code.Size = new System.Drawing.Size(196, 21);
+            this.sn_code.Size = new System.Drawing.Size(260, 25);
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
@@ -91,9 +93,10 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(9, 185);
+            this.OperateResult.Location = new System.Drawing.Point(12, 231);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(889, 272);
+            this.OperateResult.Size = new System.Drawing.Size(1184, 339);
             this.OperateResult.TabIndex = 175;
             this.OperateResult.Text = "";
             // 
@@ -109,11 +112,11 @@
             this.groupBoxWithBorder2.Controls.Add(this.newpack);
             this.groupBoxWithBorder2.Controls.Add(this.movepack);
             this.groupBoxWithBorder2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder2.Location = new System.Drawing.Point(455, 10);
-            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder2.Location = new System.Drawing.Point(607, 12);
+            this.groupBoxWithBorder2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.groupBoxWithBorder2.Name = "groupBoxWithBorder2";
-            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder2.Size = new System.Drawing.Size(446, 157);
+            this.groupBoxWithBorder2.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.groupBoxWithBorder2.Size = new System.Drawing.Size(595, 196);
             this.groupBoxWithBorder2.TabIndex = 174;
             this.groupBoxWithBorder2.TabStop = false;
             this.groupBoxWithBorder2.Text = "转移箱";
@@ -123,12 +126,14 @@
             // 
             this.pa_standardqty.AllPower = null;
             this.pa_standardqty.BackColor = System.Drawing.Color.White;
+            this.pa_standardqty.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.pa_standardqty.ID = null;
-            this.pa_standardqty.Location = new System.Drawing.Point(121, 117);
+            this.pa_standardqty.Location = new System.Drawing.Point(161, 146);
+            this.pa_standardqty.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pa_standardqty.Name = "pa_standardqty";
             this.pa_standardqty.Negative = false;
             this.pa_standardqty.Power = null;
-            this.pa_standardqty.Size = new System.Drawing.Size(196, 29);
+            this.pa_standardqty.Size = new System.Drawing.Size(199, 27);
             this.pa_standardqty.Str = null;
             this.pa_standardqty.Str1 = null;
             this.pa_standardqty.Str2 = null;
@@ -138,36 +143,40 @@
             // 
             this.pa_currentqty.AutoSize = true;
             this.pa_currentqty.CutLength = null;
-            this.pa_currentqty.Location = new System.Drawing.Point(351, 62);
-            this.pa_currentqty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_currentqty.Location = new System.Drawing.Point(468, 78);
+            this.pa_currentqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_currentqty.MaximumSize = new System.Drawing.Size(267, 0);
             this.pa_currentqty.Name = "pa_currentqty";
-            this.pa_currentqty.Size = new System.Drawing.Size(0, 21);
+            this.pa_currentqty.Size = new System.Drawing.Size(0, 27);
             this.pa_currentqty.TabIndex = 173;
             // 
             // label4
             // 
             this.label4.AutoSize = true;
-            this.label4.Location = new System.Drawing.Point(277, 62);
+            this.label4.Location = new System.Drawing.Point(369, 78);
+            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(74, 21);
+            this.label4.Size = new System.Drawing.Size(92, 27);
             this.label4.TabIndex = 6;
             this.label4.Text = "箱内数量";
             // 
             // label3
             // 
             this.label3.AutoSize = true;
-            this.label3.Location = new System.Drawing.Point(36, 117);
+            this.label3.Location = new System.Drawing.Point(48, 146);
+            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(74, 21);
+            this.label3.Size = new System.Drawing.Size(92, 27);
             this.label3.TabIndex = 5;
             this.label3.Text = "标准容量";
             // 
             // label2
             // 
             this.label2.AutoSize = true;
-            this.label2.Location = new System.Drawing.Point(36, 62);
+            this.label2.Location = new System.Drawing.Point(48, 78);
+            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(74, 21);
+            this.label2.Size = new System.Drawing.Size(92, 27);
             this.label2.TabIndex = 4;
             this.label2.Text = "目标箱号";
             // 
@@ -175,11 +184,13 @@
             // 
             this.pa_outboxcode.AllPower = null;
             this.pa_outboxcode.BackColor = System.Drawing.Color.White;
+            this.pa_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.pa_outboxcode.ID = null;
-            this.pa_outboxcode.Location = new System.Drawing.Point(121, 59);
+            this.pa_outboxcode.Location = new System.Drawing.Point(161, 78);
+            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Power = null;
-            this.pa_outboxcode.Size = new System.Drawing.Size(150, 29);
+            this.pa_outboxcode.Size = new System.Drawing.Size(199, 27);
             this.pa_outboxcode.Str = null;
             this.pa_outboxcode.Str1 = null;
             this.pa_outboxcode.Str2 = null;
@@ -189,9 +200,10 @@
             // newpack
             // 
             this.newpack.AutoSize = true;
-            this.newpack.Location = new System.Drawing.Point(140, 28);
+            this.newpack.Location = new System.Drawing.Point(187, 35);
+            this.newpack.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.newpack.Name = "newpack";
-            this.newpack.Size = new System.Drawing.Size(60, 25);
+            this.newpack.Size = new System.Drawing.Size(73, 31);
             this.newpack.TabIndex = 1;
             this.newpack.TabStop = true;
             this.newpack.Text = "新箱";
@@ -201,9 +213,10 @@
             // movepack
             // 
             this.movepack.AutoSize = true;
-            this.movepack.Location = new System.Drawing.Point(40, 28);
+            this.movepack.Location = new System.Drawing.Point(53, 35);
+            this.movepack.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.movepack.Name = "movepack";
-            this.movepack.Size = new System.Drawing.Size(60, 25);
+            this.movepack.Size = new System.Drawing.Size(73, 31);
             this.movepack.TabIndex = 0;
             this.movepack.TabStop = true;
             this.movepack.Text = "移箱";
@@ -231,11 +244,11 @@
             this.groupBoxWithBorder1.Controls.Add(this.pr_outboxinnerqty_label);
             this.groupBoxWithBorder1.Controls.Add(this.pa_code_label);
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(9, 10);
-            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(12, 12);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(442, 157);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(589, 196);
             this.groupBoxWithBorder1.TabIndex = 173;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "原箱信息";
@@ -245,10 +258,11 @@
             // 
             this.pa_packtype.AutoSize = true;
             this.pa_packtype.CutLength = null;
-            this.pa_packtype.Location = new System.Drawing.Point(116, 13);
-            this.pa_packtype.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_packtype.Location = new System.Drawing.Point(155, 16);
+            this.pa_packtype.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_packtype.MaximumSize = new System.Drawing.Size(267, 0);
             this.pa_packtype.Name = "pa_packtype";
-            this.pa_packtype.Size = new System.Drawing.Size(0, 21);
+            this.pa_packtype.Size = new System.Drawing.Size(0, 27);
             this.pa_packtype.TabIndex = 181;
             this.pa_packtype.Visible = false;
             // 
@@ -256,10 +270,11 @@
             // 
             this.pa_type.AutoSize = true;
             this.pa_type.CutLength = null;
-            this.pa_type.Location = new System.Drawing.Point(404, 19);
-            this.pa_type.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_type.Location = new System.Drawing.Point(539, 24);
+            this.pa_type.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_type.MaximumSize = new System.Drawing.Size(267, 0);
             this.pa_type.Name = "pa_type";
-            this.pa_type.Size = new System.Drawing.Size(0, 21);
+            this.pa_type.Size = new System.Drawing.Size(0, 27);
             this.pa_type.TabIndex = 180;
             this.pa_type.Visible = false;
             // 
@@ -267,10 +282,11 @@
             // 
             this.pa_custcode.AutoSize = true;
             this.pa_custcode.CutLength = null;
-            this.pa_custcode.Location = new System.Drawing.Point(360, 21);
-            this.pa_custcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_custcode.Location = new System.Drawing.Point(480, 26);
+            this.pa_custcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_custcode.MaximumSize = new System.Drawing.Size(267, 0);
             this.pa_custcode.Name = "pa_custcode";
-            this.pa_custcode.Size = new System.Drawing.Size(0, 21);
+            this.pa_custcode.Size = new System.Drawing.Size(0, 27);
             this.pa_custcode.TabIndex = 179;
             this.pa_custcode.Visible = false;
             // 
@@ -278,10 +294,11 @@
             // 
             this.pa_salecode.AutoSize = true;
             this.pa_salecode.CutLength = null;
-            this.pa_salecode.Location = new System.Drawing.Point(285, 13);
-            this.pa_salecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_salecode.Location = new System.Drawing.Point(380, 16);
+            this.pa_salecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_salecode.MaximumSize = new System.Drawing.Size(267, 0);
             this.pa_salecode.Name = "pa_salecode";
-            this.pa_salecode.Size = new System.Drawing.Size(0, 21);
+            this.pa_salecode.Size = new System.Drawing.Size(0, 27);
             this.pa_salecode.TabIndex = 178;
             this.pa_salecode.Visible = false;
             // 
@@ -289,10 +306,11 @@
             // 
             this.pa_level.AutoSize = true;
             this.pa_level.CutLength = null;
-            this.pa_level.Location = new System.Drawing.Point(108, 13);
-            this.pa_level.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_level.Location = new System.Drawing.Point(144, 16);
+            this.pa_level.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_level.MaximumSize = new System.Drawing.Size(267, 0);
             this.pa_level.Name = "pa_level";
-            this.pa_level.Size = new System.Drawing.Size(0, 21);
+            this.pa_level.Size = new System.Drawing.Size(0, 27);
             this.pa_level.TabIndex = 177;
             this.pa_level.Visible = false;
             // 
@@ -300,59 +318,65 @@
             // 
             this.lastsccode.AutoSize = true;
             this.lastsccode.CutLength = null;
-            this.lastsccode.Location = new System.Drawing.Point(326, 117);
-            this.lastsccode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.lastsccode.Location = new System.Drawing.Point(435, 146);
+            this.lastsccode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.lastsccode.MaximumSize = new System.Drawing.Size(267, 0);
             this.lastsccode.Name = "lastsccode";
-            this.lastsccode.Size = new System.Drawing.Size(0, 21);
+            this.lastsccode.Size = new System.Drawing.Size(0, 27);
             this.lastsccode.TabIndex = 176;
             // 
             // ms_msmakecode
             // 
             this.ms_msmakecode.AutoSize = true;
             this.ms_msmakecode.CutLength = null;
-            this.ms_msmakecode.Location = new System.Drawing.Point(326, 81);
-            this.ms_msmakecode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ms_msmakecode.Location = new System.Drawing.Point(435, 101);
+            this.ms_msmakecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_msmakecode.MaximumSize = new System.Drawing.Size(267, 0);
             this.ms_msmakecode.Name = "ms_msmakecode";
-            this.ms_msmakecode.Size = new System.Drawing.Size(0, 21);
+            this.ms_msmakecode.Size = new System.Drawing.Size(0, 27);
             this.ms_msmakecode.TabIndex = 175;
             // 
             // laststepcode
             // 
             this.laststepcode.AutoSize = true;
             this.laststepcode.CutLength = null;
-            this.laststepcode.Location = new System.Drawing.Point(108, 117);
-            this.laststepcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.laststepcode.Location = new System.Drawing.Point(148, 146);
+            this.laststepcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.laststepcode.MaximumSize = new System.Drawing.Size(267, 0);
             this.laststepcode.Name = "laststepcode";
-            this.laststepcode.Size = new System.Drawing.Size(0, 21);
+            this.laststepcode.Size = new System.Drawing.Size(0, 27);
             this.laststepcode.TabIndex = 174;
             // 
             // ms_prodcode
             // 
             this.ms_prodcode.AutoSize = true;
             this.ms_prodcode.CutLength = null;
-            this.ms_prodcode.Location = new System.Drawing.Point(111, 81);
-            this.ms_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
+            this.ms_prodcode.Location = new System.Drawing.Point(148, 101);
+            this.ms_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_prodcode.MaximumSize = new System.Drawing.Size(267, 0);
             this.ms_prodcode.Name = "ms_prodcode";
-            this.ms_prodcode.Size = new System.Drawing.Size(0, 21);
+            this.ms_prodcode.Size = new System.Drawing.Size(0, 27);
             this.ms_prodcode.TabIndex = 173;
             // 
             // pa_qty
             // 
             this.pa_qty.AutoSize = true;
             this.pa_qty.CutLength = null;
-            this.pa_qty.Location = new System.Drawing.Point(326, 42);
-            this.pa_qty.MaximumSize = new System.Drawing.Size(200, 0);
+            this.pa_qty.Location = new System.Drawing.Point(435, 52);
+            this.pa_qty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_qty.MaximumSize = new System.Drawing.Size(267, 0);
             this.pa_qty.Name = "pa_qty";
-            this.pa_qty.Size = new System.Drawing.Size(0, 21);
+            this.pa_qty.Size = new System.Drawing.Size(0, 27);
             this.pa_qty.TabIndex = 172;
             // 
             // label1
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(214, 41);
+            this.label1.Location = new System.Drawing.Point(285, 51);
+            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(74, 21);
+            this.label1.Size = new System.Drawing.Size(92, 27);
             this.label1.TabIndex = 171;
             this.label1.Text = "箱内数量";
             // 
@@ -360,9 +384,10 @@
             // 
             this.pa_currentqty_label.AutoSize = true;
             this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty_label.Location = new System.Drawing.Point(214, 117);
+            this.pa_currentqty_label.Location = new System.Drawing.Point(285, 146);
+            this.pa_currentqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_currentqty_label.Name = "pa_currentqty_label";
-            this.pa_currentqty_label.Size = new System.Drawing.Size(106, 21);
+            this.pa_currentqty_label.Size = new System.Drawing.Size(132, 27);
             this.pa_currentqty_label.TabIndex = 95;
             this.pa_currentqty_label.Text = "最后所在资源";
             // 
@@ -370,9 +395,10 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(214, 81);
+            this.pr_detail_label.Location = new System.Drawing.Point(285, 101);
+            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(81, 21);
+            this.pr_detail_label.Size = new System.Drawing.Size(101, 27);
             this.pr_detail_label.TabIndex = 80;
             this.pr_detail_label.Text = "工单/合同";
             // 
@@ -380,23 +406,24 @@
             // 
             this.ms_outboxcode.Caller = null;
             this.ms_outboxcode.Font = new System.Drawing.Font("微软雅黑", 9F);
-            this.ms_outboxcode.Location = new System.Drawing.Point(112, 41);
+            this.ms_outboxcode.Location = new System.Drawing.Point(149, 51);
             this.ms_outboxcode.MakeCode = null;
-            this.ms_outboxcode.Margin = new System.Windows.Forms.Padding(6, 7, 6, 7);
+            this.ms_outboxcode.Margin = new System.Windows.Forms.Padding(8, 9, 8, 9);
             this.ms_outboxcode.Name = "ms_outboxcode";
             this.ms_outboxcode.Pr_id = null;
             this.ms_outboxcode.ProdCode = null;
             this.ms_outboxcode.ShowClickIcon = false;
-            this.ms_outboxcode.Size = new System.Drawing.Size(103, 22);
+            this.ms_outboxcode.Size = new System.Drawing.Size(137, 28);
             this.ms_outboxcode.TabIndex = 163;
             // 
             // pr_code_label
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(5, 81);
+            this.pr_code_label.Location = new System.Drawing.Point(7, 101);
+            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
+            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
             this.pr_code_label.TabIndex = 81;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -404,9 +431,10 @@
             // 
             this.pr_outboxinnerqty_label.AutoSize = true;
             this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(5, 117);
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(7, 146);
+            this.pr_outboxinnerqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
-            this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(106, 21);
+            this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(132, 27);
             this.pr_outboxinnerqty_label.TabIndex = 97;
             this.pr_outboxinnerqty_label.Text = "最后所在工序";
             // 
@@ -414,17 +442,19 @@
             // 
             this.pa_code_label.AutoSize = true;
             this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_code_label.Location = new System.Drawing.Point(5, 42);
+            this.pa_code_label.Location = new System.Drawing.Point(7, 52);
+            this.pa_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pa_code_label.Name = "pa_code_label";
-            this.pa_code_label.Size = new System.Drawing.Size(58, 21);
+            this.pa_code_label.Size = new System.Drawing.Size(72, 27);
             this.pa_code_label.TabIndex = 113;
             this.pa_code_label.Text = "原箱号";
             // 
             // 清除
             // 
-            this.清除.Location = new System.Drawing.Point(608, 477);
+            this.清除.Location = new System.Drawing.Point(1132, 578);
+            this.清除.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.清除.Name = "清除";
-            this.清除.Size = new System.Drawing.Size(75, 23);
+            this.清除.Size = new System.Drawing.Size(64, 29);
             this.清除.TabIndex = 178;
             this.清除.Text = "清除";
             this.清除.UseVisualStyleBackColor = true;
@@ -432,9 +462,9 @@
             // 
             // Packing_CartonTransfer
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(910, 527);
+            this.ClientSize = new System.Drawing.Size(1213, 628);
             this.Controls.Add(this.清除);
             this.Controls.Add(this.sn_code);
             this.Controls.Add(this.sn_code_label);
@@ -442,17 +472,17 @@
             this.Controls.Add(this.groupBoxWithBorder2);
             this.Controls.Add(this.groupBoxWithBorder1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(2);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "Packing_CartonTransfer";
             this.Tag = "Packing!CartonTransfer";
             this.Text = "卡通箱转移";
             this.Load += new System.EventHandler(this.卡通箱转移_Load);
             this.SizeChanged += new System.EventHandler(this.卡通箱转移_SizeChanged);
-            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
-            this.groupBoxWithBorder1.ResumeLayout(false);
+            this.groupBoxWithBorder1.ResumeLayout(true);
             this.groupBoxWithBorder1.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 6 - 8
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -71,7 +71,6 @@ namespace UAS_MES.Packing
                     pa_standardqty.Enabled = true;
                     pa_outboxcode.Focus();
                 }
-
             }
         }
 
@@ -95,8 +94,6 @@ namespace UAS_MES.Packing
             }
         }
 
-
-
         private void sn_code_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
@@ -163,12 +160,12 @@ namespace UAS_MES.Packing
                                                     sql.Append("values ('" + pa_id + "','" + pa_outboxcode.Text + "','" + msprodcode + "',sysdate,'" + pa_level.Text + "','0','0'");
                                                     sql.Append(",'" + ms_makecode + "','0',sysdate,'" + pa_salecode.Text + "','" + pa_custcode.Text + "','" + pa_type.Text + "','0','" + pa_packtype.Text + "','" + pa_standardqty.Text + "')");
                                                     dh.ExecuteSql(sql.GetString(), "insert");
-
+                                                    //删除原明细
+                                                    dh.ExecuteSql("delete from packagedetail where pd_paid='" + old_pa_id + "'", "delete");
                                                     sql.Clear();
                                                     sql.Append("insert into packagedetail (PD_ID,PD_PAID,PD_OUTBOXCODE,PD_BARCODE,PD_INNERQTY,PD_PRODCODE,PD_MAKECODE,PD_BUILDDATE,PD_YMD)");
-                                                    sql.Append("values (packagedetail_seq.nextval,'" + pa_id + "','" + pa_outboxcode.Text + "','" + sn_code.Text + "','1','" + msprodcode + "','" + ms_makecode + "',sysdate,to_char(sysdate,'yymmdd'))");
+                                                    sql.Append("values (packagedetail_seq.nextval,'" + pa_id + "','" + pa_outboxcode.Text + "','" + sn_code.Text + "','1','" + msprodcode + "','" + ms_makecode + "',sysdate,to_char(sysdate,'yyyymmdd'))");
                                                     dh.ExecuteSql(sql.GetString(), "insert");
-
                                                     //更新原箱数量
                                                     dh.UpdateByCondition("package", "pa_currentqty=pa_currentqty-1", "pa_outboxcode = '" + ms_outboxcode + "'");
                                                     //更新目标箱数量
@@ -257,12 +254,13 @@ namespace UAS_MES.Packing
                                             return;
                                         }
 
+                                        //删除原明细
+                                        dh.ExecuteSql("delete from packagedetail where pd_paid='" + old_pa_id + "'", "delete");
                                         //更新操作
                                         sql.Clear();
                                         sql.Append("insert into packagedetail (PD_ID,PD_PAID,PD_OUTBOXCODE,PD_BARCODE,PD_INNERQTY,PD_PRODCODE,PD_MAKECODE,PD_BUILDDATE,PD_YMD)");
-                                        sql.Append("values (packagedetail_seq.nextval,'" + old_pa_id + "','" + pa_outboxcode.Text + "','" + sn_code.Text + "','1','" + msprodcode + "','" + ms_makecode + "',sysdate,to_char(sysdate,'yymmdd'))");
+                                        sql.Append("values (packagedetail_seq.nextval,'" + old_pa_id + "','" + pa_outboxcode.Text + "','" + sn_code.Text + "','1','" + msprodcode + "','" + ms_makecode + "',sysdate,to_char(sysdate,'yyyymmdd'))");
                                         dh.ExecuteSql(sql.GetString(), "insert");
-
                                         //更新原箱数量
                                         dh.UpdateByCondition("package", "pa_currentqty=pa_currentqty-1", "pa_outboxcode = '" + ms_outboxcode + "'");
                                         //更新目标箱数量

+ 67 - 100
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.Designer.cs

@@ -85,10 +85,9 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(28, 15);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(21, 12);
             this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 145;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -96,10 +95,9 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(387, 15);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(290, 12);
             this.pr_detail_label.Name = "pr_detail_label";
-            this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 144;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -107,10 +105,9 @@
             // 
             this.pr_spec_label.AutoSize = true;
             this.pr_spec_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_spec_label.Location = new System.Drawing.Point(781, 14);
-            this.pr_spec_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_spec_label.Location = new System.Drawing.Point(586, 11);
             this.pr_spec_label.Name = "pr_spec_label";
-            this.pr_spec_label.Size = new System.Drawing.Size(92, 27);
+            this.pr_spec_label.Size = new System.Drawing.Size(74, 21);
             this.pr_spec_label.TabIndex = 150;
             this.pr_spec_label.Text = "产品规格";
             // 
@@ -123,10 +120,9 @@
             this.CodeSoft.AutoSize = true;
             this.CodeSoft.Checked = true;
             this.CodeSoft.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CodeSoft.Location = new System.Drawing.Point(1291, 15);
-            this.CodeSoft.Margin = new System.Windows.Forms.Padding(4);
+            this.CodeSoft.Location = new System.Drawing.Point(968, 12);
             this.CodeSoft.Name = "CodeSoft";
-            this.CodeSoft.Size = new System.Drawing.Size(122, 31);
+            this.CodeSoft.Size = new System.Drawing.Size(99, 25);
             this.CodeSoft.TabIndex = 161;
             this.CodeSoft.TabStop = true;
             this.CodeSoft.Text = "CodeSoft";
@@ -136,10 +132,9 @@
             // 
             this.labelSoft_label.AutoSize = true;
             this.labelSoft_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.labelSoft_label.Location = new System.Drawing.Point(1165, 15);
-            this.labelSoft_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.labelSoft_label.Location = new System.Drawing.Point(874, 12);
             this.labelSoft_label.Name = "labelSoft_label";
-            this.labelSoft_label.Size = new System.Drawing.Size(92, 27);
+            this.labelSoft_label.Size = new System.Drawing.Size(74, 21);
             this.labelSoft_label.TabIndex = 163;
             this.labelSoft_label.Text = "模板软件";
             // 
@@ -147,30 +142,27 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1119, 112);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(839, 90);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(132, 27);
+            this.label1.Size = new System.Drawing.Size(106, 21);
             this.label1.TabIndex = 164;
             this.label1.Text = "模板参数预览";
             // 
             // la_name
             // 
             this.la_name.Enabled = false;
-            this.la_name.Location = new System.Drawing.Point(127, 650);
-            this.la_name.Margin = new System.Windows.Forms.Padding(4);
+            this.la_name.Location = new System.Drawing.Point(95, 520);
             this.la_name.Name = "la_name";
-            this.la_name.Size = new System.Drawing.Size(213, 25);
+            this.la_name.Size = new System.Drawing.Size(161, 21);
             this.la_name.TabIndex = 201;
             // 
             // la_name_label
             // 
             this.la_name_label.AutoSize = true;
             this.la_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.la_name_label.Location = new System.Drawing.Point(19, 650);
-            this.la_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.la_name_label.Location = new System.Drawing.Point(14, 520);
             this.la_name_label.Name = "la_name_label";
-            this.la_name_label.Size = new System.Drawing.Size(92, 27);
+            this.la_name_label.Size = new System.Drawing.Size(74, 21);
             this.la_name_label.TabIndex = 202;
             this.la_name_label.Text = "模板名称";
             // 
@@ -179,10 +171,9 @@
             this.FTPShare.AutoSize = true;
             this.FTPShare.Checked = true;
             this.FTPShare.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.FTPShare.Location = new System.Drawing.Point(1067, 602);
-            this.FTPShare.Margin = new System.Windows.Forms.Padding(4);
+            this.FTPShare.Location = new System.Drawing.Point(800, 482);
             this.FTPShare.Name = "FTPShare";
-            this.FTPShare.Size = new System.Drawing.Size(83, 19);
+            this.FTPShare.Size = new System.Drawing.Size(66, 16);
             this.FTPShare.TabIndex = 200;
             this.FTPShare.Text = "FTP共享";
             this.FTPShare.UseVisualStyleBackColor = true;
@@ -190,10 +181,9 @@
             // 
             // OpenFolder
             // 
-            this.OpenFolder.Location = new System.Drawing.Point(639, 650);
-            this.OpenFolder.Margin = new System.Windows.Forms.Padding(4);
+            this.OpenFolder.Location = new System.Drawing.Point(479, 520);
             this.OpenFolder.Name = "OpenFolder";
-            this.OpenFolder.Size = new System.Drawing.Size(51, 28);
+            this.OpenFolder.Size = new System.Drawing.Size(38, 22);
             this.OpenFolder.TabIndex = 192;
             this.OpenFolder.Text = "浏览";
             this.OpenFolder.UseVisualStyleBackColor = true;
@@ -203,30 +193,27 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(371, 598);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(278, 478);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(92, 27);
+            this.label3.Size = new System.Drawing.Size(74, 21);
             this.label3.TabIndex = 199;
             this.label3.Text = "模板类型";
             // 
             // FolderPath
             // 
             this.FolderPath.Enabled = false;
-            this.FolderPath.Location = new System.Drawing.Point(476, 650);
-            this.FolderPath.Margin = new System.Windows.Forms.Padding(4);
+            this.FolderPath.Location = new System.Drawing.Point(357, 520);
             this.FolderPath.Name = "FolderPath";
-            this.FolderPath.Size = new System.Drawing.Size(155, 25);
+            this.FolderPath.Size = new System.Drawing.Size(117, 21);
             this.FolderPath.TabIndex = 193;
             // 
             // FolderPath_Label
             // 
             this.FolderPath_Label.AutoSize = true;
             this.FolderPath_Label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.FolderPath_Label.Location = new System.Drawing.Point(371, 650);
-            this.FolderPath_Label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.FolderPath_Label.Location = new System.Drawing.Point(278, 520);
             this.FolderPath_Label.Name = "FolderPath_Label";
-            this.FolderPath_Label.Size = new System.Drawing.Size(92, 27);
+            this.FolderPath_Label.Size = new System.Drawing.Size(74, 21);
             this.FolderPath_Label.TabIndex = 194;
             this.FolderPath_Label.Text = "本地路径";
             // 
@@ -234,10 +221,9 @@
             // 
             this.la_code_label.AutoSize = true;
             this.la_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.la_code_label.Location = new System.Drawing.Point(16, 598);
-            this.la_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.la_code_label.Location = new System.Drawing.Point(12, 478);
             this.la_code_label.Name = "la_code_label";
-            this.la_code_label.Size = new System.Drawing.Size(92, 27);
+            this.la_code_label.Size = new System.Drawing.Size(74, 21);
             this.la_code_label.TabIndex = 195;
             this.la_code_label.Text = "模板编号";
             // 
@@ -245,29 +231,26 @@
             // 
             this.LabelParam.AutoScroll = true;
             this.LabelParam.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.LabelParam.Location = new System.Drawing.Point(1116, 152);
-            this.LabelParam.Margin = new System.Windows.Forms.Padding(4);
+            this.LabelParam.Location = new System.Drawing.Point(837, 122);
             this.LabelParam.Name = "LabelParam";
-            this.LabelParam.Size = new System.Drawing.Size(343, 432);
+            this.LabelParam.Size = new System.Drawing.Size(258, 346);
             this.LabelParam.TabIndex = 203;
             // 
             // label2
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(717, 598);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(538, 478);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(92, 27);
+            this.label2.Size = new System.Drawing.Size(74, 21);
             this.label2.TabIndex = 205;
             this.label2.Text = "产品编号";
             // 
             // OpernSaveFolder
             // 
-            this.OpernSaveFolder.Location = new System.Drawing.Point(1067, 649);
-            this.OpernSaveFolder.Margin = new System.Windows.Forms.Padding(4);
+            this.OpernSaveFolder.Location = new System.Drawing.Point(800, 519);
             this.OpernSaveFolder.Name = "OpernSaveFolder";
-            this.OpernSaveFolder.Size = new System.Drawing.Size(51, 28);
+            this.OpernSaveFolder.Size = new System.Drawing.Size(38, 22);
             this.OpernSaveFolder.TabIndex = 209;
             this.OpernSaveFolder.Text = "浏览";
             this.OpernSaveFolder.UseVisualStyleBackColor = true;
@@ -275,21 +258,18 @@
             // 
             // SavePath
             // 
-            this.SavePath.Location = new System.Drawing.Point(827, 651);
-            this.SavePath.Margin = new System.Windows.Forms.Padding(4);
+            this.SavePath.Location = new System.Drawing.Point(620, 521);
             this.SavePath.Name = "SavePath";
-            this.SavePath.Size = new System.Drawing.Size(213, 25);
+            this.SavePath.Size = new System.Drawing.Size(161, 21);
             this.SavePath.TabIndex = 210;
-            this.SavePath.Text = "\\\\172.16.11.99\\ShareTest";
             // 
             // SavePath_label
             // 
             this.SavePath_label.AutoSize = true;
             this.SavePath_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.SavePath_label.Location = new System.Drawing.Point(713, 651);
-            this.SavePath_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.SavePath_label.Location = new System.Drawing.Point(535, 521);
             this.SavePath_label.Name = "SavePath_label";
-            this.SavePath_label.Size = new System.Drawing.Size(92, 27);
+            this.SavePath_label.Size = new System.Drawing.Size(74, 21);
             this.SavePath_label.TabIndex = 211;
             this.SavePath_label.Text = "存放路径";
             // 
@@ -300,13 +280,12 @@
             this.Delete.DownImage = ((System.Drawing.Image)(resources.GetObject("Delete.DownImage")));
             this.Delete.Image = ((System.Drawing.Image)(resources.GetObject("Delete.Image")));
             this.Delete.IsShowBorder = true;
-            this.Delete.Location = new System.Drawing.Point(857, 69);
-            this.Delete.Margin = new System.Windows.Forms.Padding(4);
+            this.Delete.Location = new System.Drawing.Point(643, 55);
             this.Delete.MoveImage = ((System.Drawing.Image)(resources.GetObject("Delete.MoveImage")));
             this.Delete.Name = "Delete";
             this.Delete.NormalImage = ((System.Drawing.Image)(resources.GetObject("Delete.NormalImage")));
             this.Delete.Power = "IfWrite";
-            this.Delete.Size = new System.Drawing.Size(84, 30);
+            this.Delete.Size = new System.Drawing.Size(63, 24);
             this.Delete.TabIndex = 208;
             this.Delete.Tag = "Ifdelete";
             this.Delete.Text = "删除";
@@ -318,10 +297,10 @@
             this.pagination1.AddEnable = false;
             this.pagination1.Cursor = System.Windows.Forms.Cursors.Hand;
             this.pagination1.DeleteEnable = false;
-            this.pagination1.Location = new System.Drawing.Point(0, 690);
-            this.pagination1.Margin = new System.Windows.Forms.Padding(5);
+            this.pagination1.Location = new System.Drawing.Point(0, 552);
+            this.pagination1.Margin = new System.Windows.Forms.Padding(4);
             this.pagination1.Name = "pagination1";
-            this.pagination1.Size = new System.Drawing.Size(1469, 40);
+            this.pagination1.Size = new System.Drawing.Size(1102, 32);
             this.pagination1.TabIndex = 207;
             // 
             // pr_code2
@@ -329,11 +308,10 @@
             this.pr_code2.AllPower = null;
             this.pr_code2.BackColor = System.Drawing.Color.White;
             this.pr_code2.ID = null;
-            this.pr_code2.Location = new System.Drawing.Point(137, 18);
-            this.pr_code2.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_code2.Location = new System.Drawing.Point(103, 14);
             this.pr_code2.Name = "pr_code2";
             this.pr_code2.Power = null;
-            this.pr_code2.Size = new System.Drawing.Size(199, 25);
+            this.pr_code2.Size = new System.Drawing.Size(150, 21);
             this.pr_code2.Str = null;
             this.pr_code2.Str1 = null;
             this.pr_code2.Str2 = null;
@@ -347,13 +325,12 @@
             this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
             this.Save.Image = ((System.Drawing.Image)(resources.GetObject("Save.Image")));
             this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(1140, 649);
-            this.Save.Margin = new System.Windows.Forms.Padding(4);
+            this.Save.Location = new System.Drawing.Point(855, 519);
             this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
             this.Save.Name = "Save";
             this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
             this.Save.Power = "IfWrite";
-            this.Save.Size = new System.Drawing.Size(80, 30);
+            this.Save.Size = new System.Drawing.Size(60, 24);
             this.Save.TabIndex = 198;
             this.Save.Tag = "IfWrite";
             this.Save.Text = "保存";
@@ -373,10 +350,9 @@
             "栈板标",
             "SN标签",
             "自定义"});
-            this.la_type.Location = new System.Drawing.Point(476, 598);
-            this.la_type.Margin = new System.Windows.Forms.Padding(4);
+            this.la_type.Location = new System.Drawing.Point(357, 478);
             this.la_type.Name = "la_type";
-            this.la_type.Size = new System.Drawing.Size(213, 23);
+            this.la_type.Size = new System.Drawing.Size(161, 20);
             this.la_type.TabIndex = 197;
             // 
             // la_code
@@ -386,14 +362,13 @@
             this.la_code.Condition = null;
             this.la_code.DBTitle = "模板查询";
             this.la_code.FormName = null;
-            this.la_code.Location = new System.Drawing.Point(127, 598);
-            this.la_code.Margin = new System.Windows.Forms.Padding(4);
+            this.la_code.Location = new System.Drawing.Point(95, 478);
             this.la_code.Name = "la_code";
             this.la_code.Power = null;
             this.la_code.ReturnData = null;
             this.la_code.SelectField = null;
             this.la_code.SetValueField = null;
-            this.la_code.Size = new System.Drawing.Size(213, 26);
+            this.la_code.Size = new System.Drawing.Size(160, 21);
             this.la_code.TabIndex = 196;
             this.la_code.TableName = null;
             this.la_code.Tag = "IfRead";
@@ -401,10 +376,9 @@
             // 
             // ChooseAll
             // 
-            this.ChooseAll.Location = new System.Drawing.Point(21, 94);
-            this.ChooseAll.Margin = new System.Windows.Forms.Padding(4);
+            this.ChooseAll.Location = new System.Drawing.Point(16, 75);
             this.ChooseAll.Name = "ChooseAll";
-            this.ChooseAll.Size = new System.Drawing.Size(51, 25);
+            this.ChooseAll.Size = new System.Drawing.Size(38, 20);
             this.ChooseAll.TabIndex = 174;
             this.ChooseAll.Text = "全选";
             this.ChooseAll.UseVisualStyleBackColor = true;
@@ -429,11 +403,10 @@
             this.pl_labelurl,
             this.pl_id,
             this.pl_prodcode});
-            this.LabelDataGridView.Location = new System.Drawing.Point(21, 126);
-            this.LabelDataGridView.Margin = new System.Windows.Forms.Padding(4);
+            this.LabelDataGridView.Location = new System.Drawing.Point(16, 101);
             this.LabelDataGridView.Name = "LabelDataGridView";
             this.LabelDataGridView.RowTemplate.Height = 23;
-            this.LabelDataGridView.Size = new System.Drawing.Size(1077, 458);
+            this.LabelDataGridView.Size = new System.Drawing.Size(808, 366);
             this.LabelDataGridView.TabIndex = 172;
             this.LabelDataGridView.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelDataGridView_CellContentClick);
             this.LabelDataGridView.CellFormatting += new System.Windows.Forms.DataGridViewCellFormattingEventHandler(this.LabelDataGridView_CellFormatting);
@@ -555,14 +528,13 @@
             this.pr_code.Condition = null;
             this.pr_code.DBTitle = "产品编号查询";
             this.pr_code.FormName = null;
-            this.pr_code.Location = new System.Drawing.Point(827, 598);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_code.Location = new System.Drawing.Point(620, 478);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = null;
             this.pr_code.ReturnData = null;
             this.pr_code.SelectField = null;
             this.pr_code.SetValueField = null;
-            this.pr_code.Size = new System.Drawing.Size(213, 26);
+            this.pr_code.Size = new System.Drawing.Size(160, 21);
             this.pr_code.TabIndex = 159;
             this.pr_code.TableName = null;
             this.pr_code.Tag = "pr_code";
@@ -575,13 +547,12 @@
             this.UpdateGrid.DownImage = ((System.Drawing.Image)(resources.GetObject("UpdateGrid.DownImage")));
             this.UpdateGrid.Image = ((System.Drawing.Image)(resources.GetObject("UpdateGrid.Image")));
             this.UpdateGrid.IsShowBorder = true;
-            this.UpdateGrid.Location = new System.Drawing.Point(728, 69);
-            this.UpdateGrid.Margin = new System.Windows.Forms.Padding(4);
+            this.UpdateGrid.Location = new System.Drawing.Point(546, 55);
             this.UpdateGrid.MoveImage = ((System.Drawing.Image)(resources.GetObject("UpdateGrid.MoveImage")));
             this.UpdateGrid.Name = "UpdateGrid";
             this.UpdateGrid.NormalImage = ((System.Drawing.Image)(resources.GetObject("UpdateGrid.NormalImage")));
             this.UpdateGrid.Power = "IfWrite";
-            this.UpdateGrid.Size = new System.Drawing.Size(84, 30);
+            this.UpdateGrid.Size = new System.Drawing.Size(63, 24);
             this.UpdateGrid.TabIndex = 154;
             this.UpdateGrid.Tag = "IfWrite";
             this.UpdateGrid.Text = "更新";
@@ -595,13 +566,12 @@
             this.Screen.DownImage = ((System.Drawing.Image)(resources.GetObject("Screen.DownImage")));
             this.Screen.Image = ((System.Drawing.Image)(resources.GetObject("Screen.Image")));
             this.Screen.IsShowBorder = true;
-            this.Screen.Location = new System.Drawing.Point(596, 69);
-            this.Screen.Margin = new System.Windows.Forms.Padding(4);
+            this.Screen.Location = new System.Drawing.Point(447, 55);
             this.Screen.MoveImage = ((System.Drawing.Image)(resources.GetObject("Screen.MoveImage")));
             this.Screen.Name = "Screen";
             this.Screen.NormalImage = ((System.Drawing.Image)(resources.GetObject("Screen.NormalImage")));
             this.Screen.Power = "IfRead";
-            this.Screen.Size = new System.Drawing.Size(84, 30);
+            this.Screen.Size = new System.Drawing.Size(63, 24);
             this.Screen.TabIndex = 153;
             this.Screen.Tag = "IfRead";
             this.Screen.Text = "筛选";
@@ -613,11 +583,10 @@
             this.pr_spec.AllPower = null;
             this.pr_spec.BackColor = System.Drawing.Color.White;
             this.pr_spec.ID = null;
-            this.pr_spec.Location = new System.Drawing.Point(900, 15);
-            this.pr_spec.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_spec.Location = new System.Drawing.Point(675, 12);
             this.pr_spec.Name = "pr_spec";
             this.pr_spec.Power = null;
-            this.pr_spec.Size = new System.Drawing.Size(199, 25);
+            this.pr_spec.Size = new System.Drawing.Size(150, 21);
             this.pr_spec.Str = null;
             this.pr_spec.Str1 = null;
             this.pr_spec.Str2 = null;
@@ -629,11 +598,10 @@
             this.pr_detail.AllPower = null;
             this.pr_detail.BackColor = System.Drawing.Color.White;
             this.pr_detail.ID = null;
-            this.pr_detail.Location = new System.Drawing.Point(497, 16);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_detail.Location = new System.Drawing.Point(373, 13);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Power = null;
-            this.pr_detail.Size = new System.Drawing.Size(199, 25);
+            this.pr_detail.Size = new System.Drawing.Size(150, 21);
             this.pr_detail.Str = null;
             this.pr_detail.Str1 = null;
             this.pr_detail.Str2 = null;
@@ -648,9 +616,9 @@
             // 
             // SystemSetting_LabelMaintain
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1467, 730);
+            this.ClientSize = new System.Drawing.Size(1100, 584);
             this.Controls.Add(this.OpernSaveFolder);
             this.Controls.Add(this.SavePath);
             this.Controls.Add(this.SavePath_label);
@@ -684,7 +652,6 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.pr_detail_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "SystemSetting_LabelMaintain";
             this.Tag = "Make!ProLabel";
             this.Text = "产品标签维护";

+ 3 - 3
UAS-MES/FunctionCode/SystemSetting/SystemSetting_LabelMaintain.cs

@@ -122,8 +122,8 @@ namespace UAS_MES.SystemSetting
             pr_detail.KeyDown += ScreenEvent;
             pr_spec.KeyDown += ScreenEvent;
 
-            //SavePath.Text = BaseUtil.GetCacheData("SavePath").ToString();
-            BaseUtil.SetCacheData("SavePath", SavePath.Text);
+            SavePath.Text = Properties.Settings.Default.Properties["FTPAddress"].DefaultValue.ToString();
+            //BaseUtil.SetCacheData("SavePath", SavePath.Text);
 
             ftp = new ftpOperater();
         }
@@ -244,7 +244,7 @@ namespace UAS_MES.SystemSetting
             }
             else
             {
-                sql.Append("select pl_labelurl,pl_labeltype,pl_isdefault,pl_prodcode,pl_id,pl_labelcode,pl_detno,pl_labelsoft,pr_detail,pr_spec,pr_code from productlabel left join product on pl_prodcode=pr_code");
+                sql.Append("select pl_labelurl,pl_labeltype,pl_labelname,pl_isdefault,pl_prodcode,pl_id,pl_labelcode,pl_detno,pl_labelsoft,pr_detail,pr_spec,pr_code from productlabel left join product on pl_prodcode=pr_code");
                 //设置筛选的条件
                 condition.Append(BaseUtil.GetScreenSqlCondition(pr_code2, pr_detail, pr_spec));
                 //最终刷选条件拼接成的sql

+ 3 - 3
UAS-MES/Main.cs

@@ -83,7 +83,7 @@ namespace UAS_MES
         private void Main_Load(object sender, EventArgs e)
         {
             //杀死全部未关闭的打印进程
-            string[] lines = System.IO.File.ReadAllLines(lblpath + @"\" + "lblprocess" + ".txt");
+            string[] lines = System.IO.File.ReadAllLines(SystemInf.CacheFolder+ "lblprocess.txt");
             foreach (string line in lines)
             {
                 if (line != "")
@@ -104,12 +104,12 @@ namespace UAS_MES
                         catch (Exception)
                         {
                         }
-                        FileStream fs = new FileStream(lblpath + @"\" + "lblprocess" + ".txt", FileMode.Open, FileAccess.Read);
+                        FileStream fs = new FileStream(SystemInf.CacheFolder+ "lblprocess.txt", FileMode.Open, FileAccess.Read);
                         StreamReader sr = new StreamReader(fs);
                         String s = sr.ReadToEnd();
                         sr.Close();
                         fs.Close();
-                        FileStream fas = new FileStream(lblpath + @"\" + "lblprocess" + ".txt", FileMode.Create, FileAccess.ReadWrite);
+                        FileStream fas = new FileStream(SystemInf.CacheFolder + "lblprocess.txt", FileMode.Create, FileAccess.ReadWrite);
                         StreamWriter sw = new StreamWriter(fas);
                         sw.Write(s.Replace(line+"\r\n",""));
                         sw.Flush();

+ 11 - 11
UAS-MES/Program.cs

@@ -4,6 +4,7 @@ using System.Security.Principal;
 using System.Text;
 using System.Windows.Forms;
 using System.Xml;
+using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 
 namespace UAS_MES
@@ -35,22 +36,21 @@ namespace UAS_MES
                 Application.AddMessageFilter(g);
                 //启用异常记录日志的操作
                 string sysdisc = Environment.GetEnvironmentVariable("windir").Substring(0, 1);
-                string lblpath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\Log\cacheInfo";
                 //创建标签缓存的文件夹
                 if (!Directory.Exists(ftpOperater.DownLoadTo))
                     Directory.CreateDirectory(ftpOperater.DownLoadTo);
-                if (!Directory.Exists(sysdisc + @":\Log"))
-                    Directory.CreateDirectory(sysdisc + @":\Log");
-                FileStream fs = new FileStream(sysdisc + @":\Log\" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
+                if (!Directory.Exists(SystemInf.LogFolder))
+                    Directory.CreateDirectory(SystemInf.LogFolder);
+                FileStream fs = new FileStream(SystemInf.LogFolder + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fs.Close();
                 //创建存储登录信息的文件
-                if (!Directory.Exists(sysdisc + @":\Log\cacheInfo"))
-                    Directory.CreateDirectory(sysdisc + @":\Log\cacheInfo");
-                FileStream fcaches = new FileStream(sysdisc + @":\Log\cacheInfo\cacheInfo.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite);
+                if (!Directory.Exists(SystemInf.CacheFolder))
+                    Directory.CreateDirectory(SystemInf.CacheFolder);
+                FileStream fcaches = new FileStream(SystemInf.CacheFilePath, FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fcaches.Close();
                 //判断是否xml文件大小为0
-                FileInfo info = new FileInfo(sysdisc + @":\Log\cacheInfo\cacheInfo.xml");
-                if (info.Length==0)
+                FileInfo info = new FileInfo(SystemInf.CacheFilePath);
+                if (info.Length == 0)
                 {
                     XmlDocument doc = new XmlDocument();
                     //创建类型声明节点  
@@ -59,10 +59,10 @@ namespace UAS_MES
                     //创建根节点  
                     XmlElement xeRoot = doc.CreateElement("cacheInfo");
                     doc.AppendChild(xeRoot);
-                    doc.Save(Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\Log\cacheInfo\cacheInfo.xml");
+                    doc.Save(SystemInf.CacheFilePath);
                 }
                 //创建记录打印进程的文件
-                FileStream fas = new FileStream(lblpath + @"\" + "lblprocess" + ".txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
+                FileStream fas = new FileStream(SystemInf.CacheFolder + "lblprocess.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
                 fas.Close();
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                     Application.Run(new Login());

+ 1 - 1
UAS-MES/Properties/Settings.Designer.cs

@@ -109,7 +109,7 @@ namespace UAS_MES.Properties {
         
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
-        [global::System.Configuration.DefaultSettingValueAttribute("ftp://172.16.11.99/print/|uasmes|Administrator1@#")]
+        [global::System.Configuration.DefaultSettingValueAttribute("\\\\172.16.11.99\\ShareTest")]
         public string FTPAddress {
             get {
                 return ((string)(this["FTPAddress"]));

+ 1 - 1
UAS-MES/Properties/Settings.settings

@@ -24,7 +24,7 @@
       <Value Profile="(Default)" />
     </Setting>
     <Setting Name="FTPAddress" Type="System.String" Scope="User">
-      <Value Profile="(Default)">ftp://172.16.11.99/print/|uasmes|Administrator1@#</Value>
+      <Value Profile="(Default)">\\172.16.11.99\ShareTest</Value>
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
       <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>

+ 2 - 2
UAS-MES/PublicForm/ChangePwd.cs

@@ -50,8 +50,8 @@ namespace UAS_MES.PublicForm
                 String[] password = new string[1];
                 String[] username = new string[1];
                 password[0] = newpwd.Text;
-                username[0] = UserName.Text;
-                string SQL1 = "update  employee set em_password = :passowrd where em_code= :emcode ";
+                username[0] = UserName.Text.ToUpper();
+                string SQL1 = "update  employee set em_password = :passowrd where upper(em_code)= :emcode ";
                 dh.BatchInsert(SQL1, new string[] { "passowrd", "emcode" }, password, username);
                 MessageBox.Show("修改密码成功");
                 Close();

+ 4 - 5
UAS-MES/PublicMethod/BaseUtil.cs

@@ -987,8 +987,7 @@ namespace UAS_MES.PublicMethod
             }
             var temp = ProInf.Keys.Max();
             String str = SystemInf.ProcessesID + "|" + ProInf[temp];
-            string lblpath = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\Log\cacheInfo";
-            FileStream fs = new FileStream(lblpath + @"\" + "lblprocess" + ".txt", FileMode.Append, FileAccess.Write);
+            FileStream fs = new FileStream(SystemInf.CacheFolder + "lblprocess.txt", FileMode.Append, FileAccess.Write);
             StreamWriter sw = new StreamWriter(fs);
             sw.WriteLine(str, Encoding.UTF8);
             sw.Close();
@@ -1005,7 +1004,7 @@ namespace UAS_MES.PublicMethod
                 XmlReaderSettings settings = new XmlReaderSettings();
                 //忽略文档里面的注释
                 settings.IgnoreComments = true;
-                XmlReader reader = XmlReader.Create(Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\Log\cacheInfo\cacheInfo.xml", settings);
+                XmlReader reader = XmlReader.Create(SystemInf.CacheFilePath, settings);
                 doc.Load(reader);
                 //先得到根节点
                 XmlNode rootNode = doc.SelectSingleNode("cacheInfo");
@@ -1057,7 +1056,7 @@ namespace UAS_MES.PublicMethod
                 XmlReaderSettings settings = new XmlReaderSettings();
                 //忽略文档里面的注释
                 settings.IgnoreComments = true;
-                XmlReader reader = XmlReader.Create(Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\Log\cacheInfo\cacheInfo.xml", settings);
+                XmlReader reader = XmlReader.Create(SystemInf.CacheFilePath, settings);
                 doc.Load(reader);
                 //先得到根节点
                 XmlNode rootNode = doc.SelectSingleNode("cacheInfo");
@@ -1088,7 +1087,7 @@ namespace UAS_MES.PublicMethod
                 }
                 //关闭Reader
                 reader.Close();
-                doc.Save(Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\Log\cacheInfo\cacheInfo.xml");
+                doc.Save(SystemInf.CacheFilePath);
             }
             catch (Exception e)
             {

+ 2 - 1
UAS-MES/PublicMethod/LogManager.cs

@@ -1,11 +1,12 @@
 using System;
 using System.IO;
+using UAS_MES.Entity;
 
 namespace UAS_MES.PublicMethod
 {
     class LogManager
     {
-        public static string LogAddress = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\" + @"Log\";
+        public static string LogAddress = SystemInf.LogFolder;
         /// <summary>
         /// 记录操作
         /// </summary>

+ 1 - 12
UAS-MES/PublicMethod/LogicHandler.cs

@@ -933,18 +933,7 @@ namespace UAS_MES.PublicMethod
 
         public static bool SetStepResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         {
-            oErrorMessage = "";
-            string StepCode = dh.getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "'").ToString();
-            string CurrentStep = GetStepCodeBySource(iSourceCode);
-            if (StepCode == CurrentStep)
-            {
-                InsertMakeProcess(iSN, iMakeCode, iSourceCode, iMPKind, iResult, iUserCode);
-                return true;
-            }
-            else
-            {
-                return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
-            }
+            return CS_SetResult(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
         }
 
         public static bool CS_SetResult(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)

+ 9 - 8
UAS-MES/PublicMethod/ftpOperater.cs

@@ -14,6 +14,7 @@ namespace UAS_MES.PublicMethod
 
         public static string DownLoadTo = Environment.GetEnvironmentVariable("windir").Substring(0, 1) + @":\" + @"打印标签\";
 
+        private string FTPInf;
         private string ftpServerIP;
         private string ftpUser;
         private string ftpPwd;
@@ -21,14 +22,14 @@ namespace UAS_MES.PublicMethod
 
         public ftpOperater()
         {
-            string[] FTPInf = Properties.Settings.Default.Properties["FTPAddress"].DefaultValue.ToString().Split('|');
-            this.ftpServerIP = FTPInf[0];
-            this.ftpUser = FTPInf[1];
-            this.ftpPwd = FTPInf[2];
-          
-
+            //string[] FTPInf = Properties.Settings.Default.Properties["FTPAddress"].DefaultValue.ToString().Split('|');
+            //this.ftpServerIP = FTPInf[0];
+            //this.ftpUser = FTPInf[1];
+            //this.ftpPwd = FTPInf[2];
+             string FTPInf = Properties.Settings.Default.Properties["FTPAddress"].DefaultValue.ToString();
+           
             //连接共享文件夹
-            status = BaseUtil.connectState(BaseUtil.GetCacheData("SavePath").ToString(), "Administrator", "malata@123456");
+            status = BaseUtil.connectState(FTPInf, "Administrator", "malata@123456");
 
         }
         #region
@@ -273,7 +274,7 @@ namespace UAS_MES.PublicMethod
         public string DownLoadFromSharePath(string URL,string fileName)
         {
             //目标路径
-            string targetPath = BaseUtil.GetCacheData("SavePath").ToString();
+            string targetPath = FTPInf;
             //var file = Directory.GetFiles(targetPath);
             string sourceFile = Path.Combine(URL);
             string destFile = Path.Combine(DownLoadTo, fileName);

+ 6 - 0
UAS_DLLTest/App.config

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    </startup>
+</configuration>

+ 528 - 0
UAS_DLLTest/Form1.Designer.cs

@@ -0,0 +1,528 @@
+namespace UAS_DLLTest
+{
+    partial class Form1
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows 窗体设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupBoxwithborder3 = new UAS_DLLTest.GroupBoxwithborder();
+            this.operateResult = new System.Windows.Forms.RichTextBox();
+            this.Parameters = new UAS_DLLTest.GroupBoxwithborder();
+            this.textBox9 = new System.Windows.Forms.TextBox();
+            this.textBox8 = new System.Windows.Forms.TextBox();
+            this.textBox7 = new System.Windows.Forms.TextBox();
+            this.textBox6 = new System.Windows.Forms.TextBox();
+            this.textBox5 = new System.Windows.Forms.TextBox();
+            this.textBox4 = new System.Windows.Forms.TextBox();
+            this.textBox3 = new System.Windows.Forms.TextBox();
+            this.textBox2 = new System.Windows.Forms.TextBox();
+            this.textBox1 = new System.Windows.Forms.TextBox();
+            this.label9 = new System.Windows.Forms.Label();
+            this.label8 = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.label6 = new System.Windows.Forms.Label();
+            this.label5 = new System.Windows.Forms.Label();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.clearResult = new System.Windows.Forms.CheckBox();
+            this.clearPara = new System.Windows.Forms.CheckBox();
+            this.clear = new System.Windows.Forms.Button();
+            this.confirm = new System.Windows.Forms.Button();
+            this.Methods = new UAS_DLLTest.GroupBoxwithborder();
+            this.SetPcbaData = new System.Windows.Forms.RadioButton();
+            this.GetMobileAllInfo = new System.Windows.Forms.RadioButton();
+            this.SetTestDetail = new System.Windows.Forms.RadioButton();
+            this.GetRcardMOInfo = new System.Windows.Forms.RadioButton();
+            this.SetMobileData = new System.Windows.Forms.RadioButton();
+            this.SetIMEIInfo = new System.Windows.Forms.RadioButton();
+            this.SetAddressInfo = new System.Windows.Forms.RadioButton();
+            this.CheckRoutePassed = new System.Windows.Forms.RadioButton();
+            this.GoMo = new System.Windows.Forms.RadioButton();
+            this.GetMEIOrNetCodeRange = new System.Windows.Forms.RadioButton();
+            this.GetAddressRangeByMO = new System.Windows.Forms.RadioButton();
+            this.CheckUserAndResourcePassed = new System.Windows.Forms.RadioButton();
+            this.groupBoxwithborder3.SuspendLayout();
+            this.Parameters.SuspendLayout();
+            this.Methods.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // groupBoxwithborder3
+            // 
+            this.groupBoxwithborder3.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxwithborder3.Controls.Add(this.operateResult);
+            this.groupBoxwithborder3.Location = new System.Drawing.Point(34, 495);
+            this.groupBoxwithborder3.Name = "groupBoxwithborder3";
+            this.groupBoxwithborder3.Size = new System.Drawing.Size(1219, 176);
+            this.groupBoxwithborder3.TabIndex = 2;
+            this.groupBoxwithborder3.TabStop = false;
+            this.groupBoxwithborder3.Text = "Result";
+            this.groupBoxwithborder3.TextColor = System.Drawing.Color.Black;
+            // 
+            // operateResult
+            // 
+            this.operateResult.Location = new System.Drawing.Point(17, 27);
+            this.operateResult.Name = "operateResult";
+            this.operateResult.Size = new System.Drawing.Size(1185, 143);
+            this.operateResult.TabIndex = 0;
+            this.operateResult.Text = "";
+            // 
+            // Parameters
+            // 
+            this.Parameters.BorderColor = System.Drawing.Color.Black;
+            this.Parameters.Controls.Add(this.textBox9);
+            this.Parameters.Controls.Add(this.textBox8);
+            this.Parameters.Controls.Add(this.textBox7);
+            this.Parameters.Controls.Add(this.textBox6);
+            this.Parameters.Controls.Add(this.textBox5);
+            this.Parameters.Controls.Add(this.textBox4);
+            this.Parameters.Controls.Add(this.textBox3);
+            this.Parameters.Controls.Add(this.textBox2);
+            this.Parameters.Controls.Add(this.textBox1);
+            this.Parameters.Controls.Add(this.label9);
+            this.Parameters.Controls.Add(this.label8);
+            this.Parameters.Controls.Add(this.label7);
+            this.Parameters.Controls.Add(this.label6);
+            this.Parameters.Controls.Add(this.label5);
+            this.Parameters.Controls.Add(this.label4);
+            this.Parameters.Controls.Add(this.label3);
+            this.Parameters.Controls.Add(this.label2);
+            this.Parameters.Controls.Add(this.label1);
+            this.Parameters.Controls.Add(this.clearResult);
+            this.Parameters.Controls.Add(this.clearPara);
+            this.Parameters.Controls.Add(this.clear);
+            this.Parameters.Controls.Add(this.confirm);
+            this.Parameters.Location = new System.Drawing.Point(34, 201);
+            this.Parameters.Name = "Parameters";
+            this.Parameters.Size = new System.Drawing.Size(1219, 275);
+            this.Parameters.TabIndex = 1;
+            this.Parameters.TabStop = false;
+            this.Parameters.Text = "Parameter";
+            this.Parameters.TextColor = System.Drawing.Color.Black;
+            // 
+            // textBox9
+            // 
+            this.textBox9.Location = new System.Drawing.Point(908, 124);
+            this.textBox9.Name = "textBox9";
+            this.textBox9.Size = new System.Drawing.Size(181, 28);
+            this.textBox9.TabIndex = 21;
+            // 
+            // textBox8
+            // 
+            this.textBox8.Location = new System.Drawing.Point(543, 121);
+            this.textBox8.Name = "textBox8";
+            this.textBox8.Size = new System.Drawing.Size(177, 28);
+            this.textBox8.TabIndex = 20;
+            // 
+            // textBox7
+            // 
+            this.textBox7.Location = new System.Drawing.Point(125, 121);
+            this.textBox7.Name = "textBox7";
+            this.textBox7.Size = new System.Drawing.Size(191, 28);
+            this.textBox7.TabIndex = 19;
+            // 
+            // textBox6
+            // 
+            this.textBox6.Location = new System.Drawing.Point(908, 76);
+            this.textBox6.Name = "textBox6";
+            this.textBox6.Size = new System.Drawing.Size(181, 28);
+            this.textBox6.TabIndex = 18;
+            // 
+            // textBox5
+            // 
+            this.textBox5.Location = new System.Drawing.Point(543, 76);
+            this.textBox5.Name = "textBox5";
+            this.textBox5.Size = new System.Drawing.Size(177, 28);
+            this.textBox5.TabIndex = 17;
+            // 
+            // textBox4
+            // 
+            this.textBox4.Location = new System.Drawing.Point(125, 76);
+            this.textBox4.Name = "textBox4";
+            this.textBox4.Size = new System.Drawing.Size(191, 28);
+            this.textBox4.TabIndex = 16;
+            // 
+            // textBox3
+            // 
+            this.textBox3.Location = new System.Drawing.Point(908, 32);
+            this.textBox3.Name = "textBox3";
+            this.textBox3.Size = new System.Drawing.Size(181, 28);
+            this.textBox3.TabIndex = 15;
+            // 
+            // textBox2
+            // 
+            this.textBox2.Location = new System.Drawing.Point(543, 33);
+            this.textBox2.Name = "textBox2";
+            this.textBox2.Size = new System.Drawing.Size(177, 28);
+            this.textBox2.TabIndex = 14;
+            // 
+            // textBox1
+            // 
+            this.textBox1.Location = new System.Drawing.Point(125, 33);
+            this.textBox1.Name = "textBox1";
+            this.textBox1.Size = new System.Drawing.Size(191, 28);
+            this.textBox1.TabIndex = 13;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Location = new System.Drawing.Point(815, 131);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(62, 18);
+            this.label9.TabIndex = 12;
+            this.label9.Text = "label9";
+            // 
+            // label8
+            // 
+            this.label8.AutoSize = true;
+            this.label8.Location = new System.Drawing.Point(450, 124);
+            this.label8.Name = "label8";
+            this.label8.Size = new System.Drawing.Size(62, 18);
+            this.label8.TabIndex = 11;
+            this.label8.Text = "label8";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Location = new System.Drawing.Point(40, 127);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(62, 18);
+            this.label7.TabIndex = 10;
+            this.label7.Text = "label7";
+            // 
+            // label6
+            // 
+            this.label6.AutoSize = true;
+            this.label6.Location = new System.Drawing.Point(815, 86);
+            this.label6.Name = "label6";
+            this.label6.Size = new System.Drawing.Size(62, 18);
+            this.label6.TabIndex = 9;
+            this.label6.Text = "label6";
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(450, 79);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(62, 18);
+            this.label5.TabIndex = 8;
+            this.label5.Text = "label5";
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(40, 81);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(62, 18);
+            this.label4.TabIndex = 7;
+            this.label4.Text = "label4";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(815, 42);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(62, 18);
+            this.label3.TabIndex = 6;
+            this.label3.Text = "label3";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(450, 43);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(62, 18);
+            this.label2.TabIndex = 5;
+            this.label2.Text = "label2";
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(40, 43);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(62, 18);
+            this.label1.TabIndex = 4;
+            this.label1.Text = "label1";
+            // 
+            // clearResult
+            // 
+            this.clearResult.AutoSize = true;
+            this.clearResult.Location = new System.Drawing.Point(927, 226);
+            this.clearResult.Name = "clearResult";
+            this.clearResult.Size = new System.Drawing.Size(133, 22);
+            this.clearResult.TabIndex = 3;
+            this.clearResult.Text = "clearResult";
+            this.clearResult.UseVisualStyleBackColor = true;
+            // 
+            // clearPara
+            // 
+            this.clearPara.AutoSize = true;
+            this.clearPara.Location = new System.Drawing.Point(799, 226);
+            this.clearPara.Name = "clearPara";
+            this.clearPara.Size = new System.Drawing.Size(115, 22);
+            this.clearPara.TabIndex = 2;
+            this.clearPara.Text = "clearPara";
+            this.clearPara.UseVisualStyleBackColor = true;
+            // 
+            // clear
+            // 
+            this.clear.Location = new System.Drawing.Point(593, 218);
+            this.clear.Name = "clear";
+            this.clear.Size = new System.Drawing.Size(92, 36);
+            this.clear.TabIndex = 1;
+            this.clear.Text = "clear";
+            this.clear.UseVisualStyleBackColor = true;
+            this.clear.Click += new System.EventHandler(this.clear_Click);
+            // 
+            // confirm
+            // 
+            this.confirm.Location = new System.Drawing.Point(453, 218);
+            this.confirm.Name = "confirm";
+            this.confirm.Size = new System.Drawing.Size(94, 36);
+            this.confirm.TabIndex = 0;
+            this.confirm.Text = "confirm";
+            this.confirm.UseVisualStyleBackColor = true;
+            this.confirm.Click += new System.EventHandler(this.confirm_Click);
+            // 
+            // Methods
+            // 
+            this.Methods.BorderColor = System.Drawing.Color.Black;
+            this.Methods.Controls.Add(this.SetPcbaData);
+            this.Methods.Controls.Add(this.GetMobileAllInfo);
+            this.Methods.Controls.Add(this.SetTestDetail);
+            this.Methods.Controls.Add(this.GetRcardMOInfo);
+            this.Methods.Controls.Add(this.SetMobileData);
+            this.Methods.Controls.Add(this.SetIMEIInfo);
+            this.Methods.Controls.Add(this.SetAddressInfo);
+            this.Methods.Controls.Add(this.CheckRoutePassed);
+            this.Methods.Controls.Add(this.GoMo);
+            this.Methods.Controls.Add(this.GetMEIOrNetCodeRange);
+            this.Methods.Controls.Add(this.GetAddressRangeByMO);
+            this.Methods.Controls.Add(this.CheckUserAndResourcePassed);
+            this.Methods.Location = new System.Drawing.Point(34, 24);
+            this.Methods.Name = "Methods";
+            this.Methods.Size = new System.Drawing.Size(1219, 151);
+            this.Methods.TabIndex = 0;
+            this.Methods.TabStop = false;
+            this.Methods.Text = "Method";
+            this.Methods.TextColor = System.Drawing.Color.Black;
+            // 
+            // SetPcbaData
+            // 
+            this.SetPcbaData.AutoSize = true;
+            this.SetPcbaData.Location = new System.Drawing.Point(440, 111);
+            this.SetPcbaData.Name = "SetPcbaData";
+            this.SetPcbaData.Size = new System.Drawing.Size(258, 22);
+            this.SetPcbaData.TabIndex = 13;
+            this.SetPcbaData.TabStop = true;
+            this.SetPcbaData.Text = "SetPcbaData(PCBA校准测试)";
+            this.SetPcbaData.UseVisualStyleBackColor = true;
+            // 
+            // GetMobileAllInfo
+            // 
+            this.GetMobileAllInfo.AutoSize = true;
+            this.GetMobileAllInfo.Location = new System.Drawing.Point(790, 83);
+            this.GetMobileAllInfo.Name = "GetMobileAllInfo";
+            this.GetMobileAllInfo.Size = new System.Drawing.Size(303, 22);
+            this.GetMobileAllInfo.TabIndex = 12;
+            this.GetMobileAllInfo.TabStop = true;
+            this.GetMobileAllInfo.Text = "GetMobileAllInfo(获取手机信息)";
+            this.GetMobileAllInfo.UseVisualStyleBackColor = true;
+            // 
+            // SetTestDetail
+            // 
+            this.SetTestDetail.AutoSize = true;
+            this.SetTestDetail.Location = new System.Drawing.Point(790, 55);
+            this.SetTestDetail.Name = "SetTestDetail";
+            this.SetTestDetail.Size = new System.Drawing.Size(276, 22);
+            this.SetTestDetail.TabIndex = 11;
+            this.SetTestDetail.TabStop = true;
+            this.SetTestDetail.Text = "SetTestDetail(记录测试结果)";
+            this.SetTestDetail.UseVisualStyleBackColor = true;
+            // 
+            // GetRcardMOInfo
+            // 
+            this.GetRcardMOInfo.AutoSize = true;
+            this.GetRcardMOInfo.Location = new System.Drawing.Point(790, 28);
+            this.GetRcardMOInfo.Name = "GetRcardMOInfo";
+            this.GetRcardMOInfo.Size = new System.Drawing.Size(285, 22);
+            this.GetRcardMOInfo.TabIndex = 10;
+            this.GetRcardMOInfo.TabStop = true;
+            this.GetRcardMOInfo.Text = "GetRcardMOInfo(获取工单信息)";
+            this.GetRcardMOInfo.UseVisualStyleBackColor = true;
+            // 
+            // SetMobileData
+            // 
+            this.SetMobileData.AutoSize = true;
+            this.SetMobileData.Location = new System.Drawing.Point(33, 111);
+            this.SetMobileData.Name = "SetMobileData";
+            this.SetMobileData.Size = new System.Drawing.Size(321, 22);
+            this.SetMobileData.TabIndex = 9;
+            this.SetMobileData.TabStop = true;
+            this.SetMobileData.Text = "SetMobileData(接收生产数据,转号)";
+            this.SetMobileData.UseVisualStyleBackColor = true;
+            // 
+            // SetIMEIInfo
+            // 
+            this.SetIMEIInfo.AutoSize = true;
+            this.SetIMEIInfo.Location = new System.Drawing.Point(440, 83);
+            this.SetIMEIInfo.Name = "SetIMEIInfo";
+            this.SetIMEIInfo.Size = new System.Drawing.Size(258, 22);
+            this.SetIMEIInfo.TabIndex = 8;
+            this.SetIMEIInfo.TabStop = true;
+            this.SetIMEIInfo.Text = "SetIMEIInfo(记录IMEI使用)";
+            this.SetIMEIInfo.UseVisualStyleBackColor = true;
+            // 
+            // SetAddressInfo
+            // 
+            this.SetAddressInfo.AutoSize = true;
+            this.SetAddressInfo.Location = new System.Drawing.Point(440, 55);
+            this.SetAddressInfo.Name = "SetAddressInfo";
+            this.SetAddressInfo.Size = new System.Drawing.Size(294, 22);
+            this.SetAddressInfo.TabIndex = 7;
+            this.SetAddressInfo.TabStop = true;
+            this.SetAddressInfo.Text = "SetAddressInfo(记录MACBT使用)";
+            this.SetAddressInfo.UseVisualStyleBackColor = true;
+            // 
+            // CheckRoutePassed
+            // 
+            this.CheckRoutePassed.AutoSize = true;
+            this.CheckRoutePassed.Location = new System.Drawing.Point(440, 27);
+            this.CheckRoutePassed.Name = "CheckRoutePassed";
+            this.CheckRoutePassed.Size = new System.Drawing.Size(267, 22);
+            this.CheckRoutePassed.TabIndex = 6;
+            this.CheckRoutePassed.TabStop = true;
+            this.CheckRoutePassed.Text = "CheckRoutePassed(检查途程)";
+            this.CheckRoutePassed.UseVisualStyleBackColor = true;
+            // 
+            // GoMo
+            // 
+            this.GoMo.AutoSize = true;
+            this.GoMo.Location = new System.Drawing.Point(790, 111);
+            this.GoMo.Name = "GoMo";
+            this.GoMo.Size = new System.Drawing.Size(159, 22);
+            this.GoMo.TabIndex = 5;
+            this.GoMo.TabStop = true;
+            this.GoMo.Text = "GoMo(归属工单)";
+            this.GoMo.UseVisualStyleBackColor = true;
+            // 
+            // GetMEIOrNetCodeRange
+            // 
+            this.GetMEIOrNetCodeRange.AutoSize = true;
+            this.GetMEIOrNetCodeRange.Location = new System.Drawing.Point(33, 83);
+            this.GetMEIOrNetCodeRange.Name = "GetMEIOrNetCodeRange";
+            this.GetMEIOrNetCodeRange.Size = new System.Drawing.Size(303, 22);
+            this.GetMEIOrNetCodeRange.TabIndex = 3;
+            this.GetMEIOrNetCodeRange.TabStop = true;
+            this.GetMEIOrNetCodeRange.Text = "GetMEIOrNetCodeRange(分配IMEI)";
+            this.GetMEIOrNetCodeRange.UseVisualStyleBackColor = true;
+            // 
+            // GetAddressRangeByMO
+            // 
+            this.GetAddressRangeByMO.AutoSize = true;
+            this.GetAddressRangeByMO.Location = new System.Drawing.Point(33, 55);
+            this.GetAddressRangeByMO.Name = "GetAddressRangeByMO";
+            this.GetAddressRangeByMO.Size = new System.Drawing.Size(303, 22);
+            this.GetAddressRangeByMO.TabIndex = 2;
+            this.GetAddressRangeByMO.TabStop = true;
+            this.GetAddressRangeByMO.Text = "GetAddressRangeByMO(分配MACBT)";
+            this.GetAddressRangeByMO.UseVisualStyleBackColor = true;
+            // 
+            // CheckUserAndResourcePassed
+            // 
+            this.CheckUserAndResourcePassed.AutoSize = true;
+            this.CheckUserAndResourcePassed.Location = new System.Drawing.Point(33, 27);
+            this.CheckUserAndResourcePassed.Name = "CheckUserAndResourcePassed";
+            this.CheckUserAndResourcePassed.Size = new System.Drawing.Size(357, 22);
+            this.CheckUserAndResourcePassed.TabIndex = 1;
+            this.CheckUserAndResourcePassed.TabStop = true;
+            this.CheckUserAndResourcePassed.Text = "CheckUserAndResourcePassed(登录检查)";
+            this.CheckUserAndResourcePassed.UseVisualStyleBackColor = true;
+            // 
+            // Form1
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(1285, 686);
+            this.Controls.Add(this.groupBoxwithborder3);
+            this.Controls.Add(this.Parameters);
+            this.Controls.Add(this.Methods);
+            this.Name = "Form1";
+            this.Text = "Form1";
+            this.Load += new System.EventHandler(this.Form1_Load);
+            this.groupBoxwithborder3.ResumeLayout(false);
+            this.Parameters.ResumeLayout(false);
+            this.Parameters.PerformLayout();
+            this.Methods.ResumeLayout(false);
+            this.Methods.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private GroupBoxwithborder Methods;
+        private System.Windows.Forms.RadioButton SetPcbaData;
+        private System.Windows.Forms.RadioButton GetMobileAllInfo;
+        private System.Windows.Forms.RadioButton SetTestDetail;
+        private System.Windows.Forms.RadioButton GetRcardMOInfo;
+        private System.Windows.Forms.RadioButton SetMobileData;
+        private System.Windows.Forms.RadioButton SetIMEIInfo;
+        private System.Windows.Forms.RadioButton SetAddressInfo;
+        private System.Windows.Forms.RadioButton CheckRoutePassed;
+        private System.Windows.Forms.RadioButton GoMo;
+        private System.Windows.Forms.RadioButton GetMEIOrNetCodeRange;
+        private System.Windows.Forms.RadioButton GetAddressRangeByMO;
+        private System.Windows.Forms.RadioButton CheckUserAndResourcePassed;
+        private GroupBoxwithborder Parameters;
+        private GroupBoxwithborder groupBoxwithborder3;
+        private System.Windows.Forms.CheckBox clearResult;
+        private System.Windows.Forms.CheckBox clearPara;
+        private System.Windows.Forms.Button clear;
+        private System.Windows.Forms.Button confirm;
+        private System.Windows.Forms.TextBox textBox9;
+        private System.Windows.Forms.TextBox textBox8;
+        private System.Windows.Forms.TextBox textBox7;
+        private System.Windows.Forms.TextBox textBox6;
+        private System.Windows.Forms.TextBox textBox5;
+        private System.Windows.Forms.TextBox textBox4;
+        private System.Windows.Forms.TextBox textBox3;
+        private System.Windows.Forms.TextBox textBox2;
+        private System.Windows.Forms.TextBox textBox1;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label label8;
+        private System.Windows.Forms.Label label7;
+        private System.Windows.Forms.Label label6;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.RichTextBox operateResult;
+    }
+}
+

+ 156 - 0
UAS_DLLTest/Form1.cs

@@ -0,0 +1,156 @@
+using BenQGuru.eMES.DLLService;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace UAS_DLLTest
+{
+    public partial class Form1 : Form
+    {
+        MESHelper helper;
+        Control.ControlCollection collection;
+        Control.ControlCollection groupBox2Childs;
+        ParameterInfo[] param;
+        List<string> outParams = new List<string>();
+        object[] allParams;
+        int icount = 0;
+        public Form1()
+        {
+            InitializeComponent();
+            helper = new MESHelper();
+            collection = Methods.Controls;
+            groupBox2Childs = Parameters.Controls;
+            //监听多个radiobutton的状态
+            for (int i = 0; i < collection.Count; i++)
+            {
+                if (collection[i] is RadioButton)
+                {
+                    ((RadioButton)collection[i]).CheckedChanged+= new EventHandler(radioButton_checkChanged);
+                }
+            }
+        }
+
+        private void radioButton_checkChanged(object sender, EventArgs e)
+        {
+            hideControl();
+            for (int i = 0; i < collection.Count; i++)
+            {
+                if (((RadioButton)collection[i]).Checked) {
+                    //显示当前选中的方法的所有参数
+                    //获取所有的参数
+                    icount = 0;
+                    param = helper.GetType().GetMethod(collection[i].Name).GetParameters();
+                    for (int j = 1; j < param.Length+1; j++)
+                    {
+                        //参数名i开头的才需要显示
+                        if (!param[j - 1].Name.StartsWith("o"))
+                        {
+                            icount += 1;
+                            //设置显示参数
+                            for (int k = 0; k < groupBox2Childs.Count; k++)
+                            {
+                                if (groupBox2Childs[k].Name == "label" + j)
+                                {
+                                    groupBox2Childs[k].Text = param[j - 1].Name;
+                                    groupBox2Childs[k].Visible = true;
+                                }
+                                else if (groupBox2Childs[k].Name == "textBox" + j)
+                                {
+                                    groupBox2Childs[k].Visible = true;
+                                }
+                            }
+                        }
+                    }
+                    allParams = new object[param.Length];
+                }
+            }
+        }
+
+        private void confirm_Click(object sender, EventArgs e)
+        {
+            //拿到所有已经填写的参数
+            for (int i = 0; i < groupBox2Childs.Count; i++)
+            {
+                for (int j = 1; j < allParams.Length; j++)
+                {
+                    if (j > icount)
+                    {
+                        allParams[j - 1] = new string(new char[] { });
+                    }
+                    else
+                    {
+                        if (groupBox2Childs[i].Name == "textBox" + j)
+                        {
+                            if (param[j - 1].ParameterType.ToString()!= "System.String[]")
+                            {
+                                allParams[j - 1] = ((TextBox)groupBox2Childs[i]).Text;
+                            }
+                            else
+                            {
+                                allParams[j - 1] = ((TextBox)groupBox2Childs[i]).Text.Split(',');
+                            }
+                        }
+                    }
+                }
+            }
+            //将out类型的参数放进去
+            string oResult = "";
+            //拿到需要触发的方法名
+            for (int i = 0; i < collection.Count; i++) {
+                if (((RadioButton)collection[i]).Checked)
+                {
+                    Type type = helper.GetType();
+                    MethodInfo method =  type.GetMethod(((RadioButton)collection[i]).Name);
+                    oResult = method.Invoke(helper, allParams).ToString();
+                }
+            }
+            //输出out出的信息
+            operateResult.AppendText("返回值:"+oResult+",");
+            for (int i=0;i<param.Length;i++) {
+                if (param[i].Name.StartsWith("o")) {
+                    operateResult.AppendText(param[i].Name + ":" + allParams[i]+",");
+                }
+            }
+            operateResult.AppendText("\n");
+        }
+
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            hideControl();
+        }
+
+        private void clear_Click(object sender, EventArgs e)
+        {
+            //清除信息
+            if (clearPara.Checked) {
+                for (int i=0;i<groupBox2Childs.Count;i++) {
+                    if (groupBox2Childs[i] is TextBox) {
+                        ((TextBox)groupBox2Childs[i]).Text = "";
+                    }
+                }
+            }
+            //清除日志
+            if (clearResult.Checked) {
+                operateResult.Clear();
+            }
+        }
+        private void hideControl()
+        {
+            //设置groupBox2中所有的label和textbox不可见
+            for (int i = 0; i < groupBox2Childs.Count; i++)
+            {
+                if ((groupBox2Childs[i] is Label) || (groupBox2Childs[i] is TextBox))
+                {
+                    groupBox2Childs[i].Visible = false;
+                }
+            }
+        }
+    }
+}

+ 120 - 0
UAS_DLLTest/Form1.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 36 - 0
UAS_DLLTest/GroupBoxwithborder.Designer.cs

@@ -0,0 +1,36 @@
+namespace UAS_DLLTest
+{
+    partial class GroupBoxwithborder
+    {
+        /// <summary>
+        /// 必需的设计器变量。
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary> 
+        /// 清理所有正在使用的资源。
+        /// </summary>
+        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region 组件设计器生成的代码
+
+        /// <summary>
+        /// 设计器支持所需的方法 - 不要修改
+        /// 使用代码编辑器修改此方法的内容。
+        /// </summary>
+        private void InitializeComponent()
+        {
+            components = new System.ComponentModel.Container();
+        }
+
+        #endregion
+    }
+}

+ 72 - 0
UAS_DLLTest/GroupBoxwithborder.cs

@@ -0,0 +1,72 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace UAS_DLLTest
+{
+    public partial class GroupBoxwithborder : GroupBox
+    {
+        /// <summary>
+        /// 获取和设置控件高亮色
+        /// </summary>
+        /// <value>高亮色</value>
+        [TypeConverter("System.Drawing.ColorConverter"),
+        Category("LoadingCircle"),
+        Description("获取和设置控件高亮色")]
+        public Color TextColor
+        {
+            get
+            {
+                return textcolor;
+            }
+            set
+            {
+                textcolor = value;
+                Invalidate();
+            }
+        }
+
+        public Color BorderColor
+        {
+            get
+            {
+                return bordercolor;
+            }
+
+            set
+            {
+                bordercolor = value;
+                Invalidate();
+            }
+        }
+
+        private Color textcolor;
+
+        private Color bordercolor;
+
+        public GroupBoxwithborder()
+        {
+            InitializeComponent();
+            this.Paint += this.groupBox1_Paint;
+        }
+
+        private void groupBox1_Paint(object sender, PaintEventArgs e)
+        {
+            e.Graphics.Clear(BackColor);
+            Brush br = new SolidBrush(textcolor);
+            e.Graphics.DrawString(Text, Font, br, 10, 1);
+            Pen LineColor = new Pen(bordercolor);
+            e.Graphics.DrawLine(LineColor, 1, 7, 8, 7);
+            e.Graphics.DrawLine(LineColor, e.Graphics.MeasureString(Text, Font).Width + 8, 7, Width - 2, 7);
+            e.Graphics.DrawLine(LineColor, 1, 7, 1, Height - 2);
+            e.Graphics.DrawLine(LineColor, 1, Height - 2, Width - 2, Height - 2);
+            e.Graphics.DrawLine(LineColor, Width - 2, 7, Width - 2, Height - 2);
+        }
+    }
+}

+ 22 - 0
UAS_DLLTest/Program.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace UAS_DLLTest
+{
+    static class Program
+    {
+        /// <summary>
+        /// 应用程序的主入口点。
+        /// </summary>
+        [STAThread]
+        static void Main()
+        {
+            Application.EnableVisualStyles();
+            Application.SetCompatibleTextRenderingDefault(false);
+            Application.Run(new Form1());
+        }
+    }
+}

+ 36 - 0
UAS_DLLTest/Properties/AssemblyInfo.cs

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

+ 71 - 0
UAS_DLLTest/Properties/Resources.Designer.cs

@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本: 4.0.30319.42000
+//
+//     对此文件的更改可能导致不正确的行为,如果
+//     重新生成代码,则所做更改将丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace UAS_DLLTest.Properties
+{
+
+
+    /// <summary>
+    ///   强类型资源类,用于查找本地化字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或删除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Resources
+    {
+
+        private static global::System.Resources.ResourceManager resourceMan;
+
+        private static global::System.Globalization.CultureInfo resourceCulture;
+
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Resources()
+        {
+        }
+
+        /// <summary>
+        ///   返回此类使用的缓存 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager
+        {
+            get
+            {
+                if ((resourceMan == null))
+                {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UAS_DLLTest.Properties.Resources", typeof(Resources).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+
+        /// <summary>
+        ///   覆盖当前线程的 CurrentUICulture 属性
+        ///   使用此强类型的资源类的资源查找。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture
+        {
+            get
+            {
+                return resourceCulture;
+            }
+            set
+            {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 117 - 0
UAS_DLLTest/Properties/Resources.resx

@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 30 - 0
UAS_DLLTest/Properties/Settings.Designer.cs

@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:4.0.30319.42000
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace UAS_DLLTest.Properties
+{
+
+
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+    internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+    {
+
+        private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+        public static Settings Default
+        {
+            get
+            {
+                return defaultInstance;
+            }
+        }
+    }
+}

+ 7 - 0
UAS_DLLTest/Properties/Settings.settings

@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
+  <Profiles>
+    <Profile Name="(Default)" />
+  </Profiles>
+  <Settings />
+</SettingsFile>

+ 87 - 0
UAS_DLLTest/UAS_DLLTest.csproj

@@ -0,0 +1,87 @@
+<?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>{B37433F6-7066-4D60-8A54-4AAD5D0F3D41}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UAS_DLLTest</RootNamespace>
+    <AssemblyName>UAS_DLLTest</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Net.Http" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Form1.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Form1.Designer.cs">
+      <DependentUpon>Form1.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Properties\Resources.resx">
+      <Generator>ResXFileCodeGenerator</Generator>
+      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+      <SubType>Designer</SubType>
+    </EmbeddedResource>
+    <Compile Include="Properties\Resources.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Resources.resx</DependentUpon>
+    </Compile>
+    <None Include="Properties\Settings.settings">
+      <Generator>SettingsSingleFileGenerator</Generator>
+      <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+    </None>
+    <Compile Include="Properties\Settings.Designer.cs">
+      <AutoGen>True</AutoGen>
+      <DependentUpon>Settings.settings</DependentUpon>
+      <DesignTimeSharedInput>True</DesignTimeSharedInput>
+    </Compile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </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>

+ 128 - 45
UAS_MesInterface(4.0)/MesHelper.cs

@@ -7,7 +7,7 @@ using System.Text;
 
 namespace BenQGuru.eMES.DLLService
 {
-
+     
     [Guid("99D0E96E-1058-415D-9874-D34537625284")]
     [InterfaceType(ComInterfaceType.InterfaceIsDual)]
     public interface IMESHelper
@@ -18,18 +18,18 @@ namespace BenQGuru.eMES.DLLService
         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 SetTestDetail(string iSN, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iResCode, out string oErrMessage);
+        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 iSnCode, string iIMEI1, 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 iMPKind, string iResult, string iErrCode, string flag, 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("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
     [ComSourceInterfaces(typeof(IMESHelper))]
-    [ClassInterface(ClassInterfaceType.AutoDispatch)]
+    [ClassInterface(ClassInterfaceType.None)]
     [ProgId("DllService.MESHelper")]
     public class MESHelper : IMESHelper
     {
@@ -58,6 +58,11 @@ namespace BenQGuru.eMES.DLLService
         /// <returns></returns>
         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" };
@@ -100,6 +105,11 @@ namespace BenQGuru.eMES.DLLService
         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 ";
@@ -168,6 +178,11 @@ namespace BenQGuru.eMES.DLLService
             oCode1 = "";
             oCode2 = "";
             oCdoe3 = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
             oErrMessage = "";
             string omakeCode = "";
             GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
@@ -190,7 +205,7 @@ namespace BenQGuru.eMES.DLLService
         /// 输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
         /// 如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
         /// </summary>
-        /// <param name="iSnCode"></param>
+        /// <param name="iSN"></param>
         /// <param name="iIMEI1"></param>
         /// <param name="iNetCode"></param>
         /// <param name="oIMEI1"></param>
@@ -204,7 +219,7 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="oID3"></param>
         /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public 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)
+        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 = "";
@@ -216,8 +231,13 @@ namespace BenQGuru.eMES.DLLService
             oID3 = "";
             oID4 = "";
             oID5 = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
             oErrMessage = "";
-            string[] param = new string[] { iSnCode, "", iIMEI1, iNetCode, oIMEI1, oIMEI2, "", oMEID, oNetCode, oPSN, oID1, oID2, oID3, 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];
@@ -246,6 +266,11 @@ namespace BenQGuru.eMES.DLLService
         {
             //取MakeProcess表中的执行记录ID最大的一个工单的号码
             oMoCode = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
             oErrMessage = "";
             string ms_id = getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "ms_sncode='" + iSN + "' or ms_firstsn in (select firstsn from makesnrelation where sn='" + iSN + "')").ToString();
             oMoCode = getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
@@ -278,9 +303,9 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="oID3"></param>
         /// <param name="oID4"></param>
         /// <param name="oID5"></param>
-        /// <param name="oErrorMessage"></param>
+        /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        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 oErrorMessage)
+        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 = "";
@@ -297,8 +322,13 @@ namespace BenQGuru.eMES.DLLService
             oID3 = "";
             oID4 = "";
             oID5 = "";
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
             //通过序列号获取最近操作的工单号
-            string ms_id = getFieldDataByCondition("makeserial", "ms_id", "ms_sncode='" + iSN + "'").ToString();
+            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 + "'");
@@ -317,18 +347,18 @@ namespace BenQGuru.eMES.DLLService
                     oID1 = dt.Rows[0]["ms_othid3"].ToString();
                     oID2 = dt.Rows[0]["ms_othid3"].ToString();
                     oID3 = dt.Rows[0]["ms_othid3"].ToString();
-                    oErrorMessage = "";
+                    oErrMessage = "";
                     return true;
                 }
                 else
                 {
-                    oErrorMessage = "序列号" + iSN + "不存在";
+                    oErrMessage = "序列号" + iSN + "不存在";
                     return false;
                 }
             }
             else
             {
-                oErrorMessage = "序列号" + iSN + "不存在";
+                oErrMessage = "序列号" + iSN + "不存在";
                 return false;
             }
         }
@@ -366,24 +396,34 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="iCode1"></param>
         /// <param name="iCode2"></param>
         /// <param name="iCode3"></param>
-        /// <param name="oErrorMessage"></param>
+        /// <param name="oErrMessage"></param>
         /// <returns></returns>
-        public bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage)
+        public bool SetAddressInfo(string iSN, string iWIFI, string iBT, string iCode1, string iCode2, string iCode3, out string oErrMessage)
         {
-            oErrorMessage = "";
-            string[] param = new string[] { iSN, iWIFI, iBT, iCode1, iCode2, iCode3, oErrorMessage };
+            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);
-            oErrorMessage = param[6];
-            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+            oErrMessage = param[6];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
                 return true;
             else
                 return false;
         }
 
-        public bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrorMessage)
+        public bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
         {
-            oErrorMessage = "";
+            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);
             switch (iResult)
@@ -393,7 +433,7 @@ namespace BenQGuru.eMES.DLLService
                 case "NG":
                     if (iErrCode == "")
                     {
-                        oErrorMessage = "测试结果为NG时必须传递不良代码";
+                        oErrMessage = "测试结果为NG时必须传递不良代码";
                         return false;
                     }
                     else
@@ -402,7 +442,7 @@ namespace BenQGuru.eMES.DLLService
                         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_soncode,mb_status) select makebad_seq.nextval");
-                        sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,'',");
+                        sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + CurrentStep + "','" + iSourceCode + "',:bc_code,'',");
                         sql.Append("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>();
@@ -412,11 +452,11 @@ namespace BenQGuru.eMES.DLLService
                         }
                         ExecuteSQLTran(InsertSQL.ToArray());
                         //将不良的序列号的状态码设为3
-                        ExecuteSql("update makeserial set ms_status='3' where ms_sncode=:sncode and ms_makecode=:macode", "update", iSN, iMakeCode);
+                        ExecuteSql("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'", "update");
                     }
                     break;
                 default:
-                    oErrorMessage = "测试结果必须为NG或者OK";
+                    oErrMessage = "测试结果必须为NG或者OK";
                     return false;
             }
             //不良采集为良品是更新
@@ -436,7 +476,7 @@ namespace BenQGuru.eMES.DLLService
                     }
                 }
             }
-            return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrorMessage);
+            return CS_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, iResult, out oErrMessage);
         }
 
         /// <summary>
@@ -445,15 +485,17 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="iMakeCode"></param>
         /// <param name="iSourceCode"></param>
         /// <param name="iSN"></param>
-        /// <param name="iMPKind"></param>
+        /// <param name="iOperater"></param>
         /// <param name="iResult"></param>
         /// <param name="iUserCode"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage)
+        public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperater, string iResult, string iErrCode, string flag, out string oErrorMessage)
         {
             oErrorMessage = "";
-            string[] param = new string[] { iTSN, iSN, iSourceCode, "", iResult, iErrCode, 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];
@@ -463,14 +505,19 @@ namespace BenQGuru.eMES.DLLService
                 return false;
         }
 
-        private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrorMessage)
+        private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, string iResult, out string oErrMessage)
         {
-            oErrorMessage = "";
-            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, iResult, oErrorMessage };
+            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);
-            oErrorMessage = param[5];
-            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+            oErrMessage = param[5];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
                 return true;
             else
                 return false;
@@ -493,18 +540,25 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="iTestResult"></param>
         /// <param name="oErrMessage"></param>                                                      
         /// <returns></returns>
-        public bool SetTestDetail(string iSN, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iResCode, out string oErrMessage)
+        public bool SetTestDetail(string iSN, string iTestResult, string iResCode, string[] iTestDetail, out string oErrMessage)
         {
+            if (iSN == "" || iSN == null)
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
             oErrMessage = "";
             sql.Length = 0;
             string omakeCode;
             GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
-            sql.Append("Insert into STEPTESTDETAIL (STD_ID,STD_SN,STD_MAKECODE,STD_CLASS,STD_SUBCLASS1,STD_SUBCLASS2,");
-            sql.Append("STD_SUBCLASS3,STD_MAXVALUE,STD_MINVALUE,STD_ACTUALVALUE,STD_VALUE1,STD_VALUE2,STD_VALUE3,STD_TESTRESULT,");
-            sql.Append("STD_DATE,STD_RESCODE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
-            sql.Append(":std_class,:std_subclass1,:std_subclass2,:std_subclass3,:std_maxvalue,:std_minvalue,:std_actualvalue,:std_value1,");
-            sql.Append(":std_value2,:std_value3,:std_testresult,sysdate,:std_rescode)");
-            ExecuteSql(sql.ToString(), "select", iSN, omakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iResCode);
+            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;
         }
 
@@ -526,10 +580,15 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="iID3"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public bool SetIMEIInfo(string iSnCode, string iIMEI1, out string oErrMessage)
+        public bool SetIMEIInfo(string iSN, string iIMEI1, out string oErrMessage)
         {
+            if (iSN == "")
+            {
+                oErrMessage = "SN不能为空";
+                return false;
+            }
             oErrMessage = "";
-            string[] param = new string[] { iSnCode, iIMEI1, "", "", "", "", "", "", "", "", 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];
@@ -539,11 +598,26 @@ namespace BenQGuru.eMES.DLLService
                 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>
         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 = "";
-            string[] param = new string[] { "", iResCode, iSN, "", omakecode, "", oErrMessage };
+            string[] param = new string[] { "", iResCode, iSN, iOperator, omakecode, "", 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];
@@ -556,6 +630,11 @@ namespace BenQGuru.eMES.DLLService
 
         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" };
@@ -792,7 +871,9 @@ namespace BenQGuru.eMES.DLLService
                     }
                 }
                 for (int i = 0; i < addpar.Length; i++)
+                {
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), names[i]));
+                }
             }
             switch (Type.ToUpper())
             {
@@ -865,6 +946,7 @@ namespace BenQGuru.eMES.DLLService
             command.Connection.Open();
             Reconnect(command);
             OracleTransaction tx = command.Connection.BeginTransaction(IsolationLevel.ReadCommitted);
+            command.Transaction = tx;
             try
             {
                 foreach (string sql in SQL)
@@ -872,6 +954,7 @@ namespace BenQGuru.eMES.DLLService
                     if (!String.IsNullOrEmpty(sql))
                     {
                         command.CommandText = sql;
+                        Console.WriteLine(sql);
                         command.ExecuteNonQuery();
                     }
                 }
@@ -913,8 +996,8 @@ namespace BenQGuru.eMES.DLLService
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
             {
-                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[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
             {

+ 1 - 1
UAS_MesInterface(4.0)/Properties/AssemblyInfo.cs

@@ -8,7 +8,7 @@ using System.Runtime.InteropServices;
 [assembly: AssemblyTitle("UAS_MesInterface(4.0)")]
 [assembly: AssemblyDescription("")]
 [assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
+[assembly: AssemblyCompany("深圳市优软科技有限公司")]
 [assembly: AssemblyProduct("UAS_MesInterface(4.0)")]
 [assembly: AssemblyCopyright("Copyright ©  2017")]
 [assembly: AssemblyTrademark("")]

+ 58 - 0
UAS_MesInterface(4.0)/UAS_MesInterface(4.0).csproj

@@ -0,0 +1,58 @@
+<?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>{A35F767D-0858-4061-AF7C-C5C594034668}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>BenQGuru.eMES.DLLService</RootNamespace>
+    <AssemblyName>BenQGuru.eMES.DLLService</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.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>

+ 28 - 16
UAS_MesInterface/MESHelper.cs

@@ -18,11 +18,11 @@ namespace BenQGuru.eMES.DLLService
         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 SetTestDetail(string iSN, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iResCode, out string oErrMessage);
+        bool SetTestDetail(string iSN, string iTestResult, string iResCode,ref 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 iSnCode, string iIMEI1, 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 iMPKind, string iResult, string iErrCode, string flag, 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);
     }
@@ -38,7 +38,7 @@ namespace BenQGuru.eMES.DLLService
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
         //系统默认的的连接字符串
-        private string ConnectionStrings = "Password=select!#%*(;User ID=MES_TEST;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.230.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+        private string ConnectionStrings = "Data Source=192.168.230.200/orcl;User ID=MES_TEST;PassWord=select!#%*(;";
         //用户选择的数据库的连接字符串
         private OracleConnection connection;
         //用户选择的数据库的连接字符串
@@ -442,7 +442,7 @@ namespace BenQGuru.eMES.DLLService
                         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_soncode,mb_status) select makebad_seq.nextval");
-                        sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,'',");
+                        sql.Append(",ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + CurrentStep + "','" + iSourceCode + "',:bc_code,'',");
                         sql.Append("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>();
@@ -485,17 +485,17 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="iMakeCode"></param>
         /// <param name="iSourceCode"></param>
         /// <param name="iSN"></param>
-        /// <param name="iMPKind"></param>
+        /// <param name="iOperater"></param>
         /// <param name="iResult"></param>
         /// <param name="iUserCode"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage)
+        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, "", iResult, iErrCode, oErrorMessage };
+            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];
@@ -540,9 +540,9 @@ namespace BenQGuru.eMES.DLLService
         /// <param name="iTestResult"></param>
         /// <param name="oErrMessage"></param>                                                      
         /// <returns></returns>
-        public bool SetTestDetail(string iSN, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iResCode, out string oErrMessage)
+        public bool SetTestDetail(string iSN, string iTestResult, string iResCode,ref string[] iTestDetail, out string oErrMessage)
         {
-            if (iSN == "")
+            if (iSN == "" || iSN == null)
             {
                 oErrMessage = "SN不能为空";
                 return false;
@@ -551,12 +551,14 @@ namespace BenQGuru.eMES.DLLService
             sql.Length = 0;
             string omakeCode;
             GetRcardMOInfo(iSN, out omakeCode, out oErrMessage);
-            sql.Append("Insert into STEPTESTDETAIL (STD_ID,STD_SN,STD_MAKECODE,STD_CLASS,STD_SUBCLASS1,STD_SUBCLASS2,");
-            sql.Append("STD_SUBCLASS3,STD_MAXVALUE,STD_MINVALUE,STD_ACTUALVALUE,STD_VALUE1,STD_VALUE2,STD_VALUE3,STD_TESTRESULT,");
-            sql.Append("STD_DATE,STD_RESCODE) values (STEPTESTDETAIL_SEQ.nextval,:std_sn,:std_makecode,");
-            sql.Append(":std_class,:std_subclass1,:std_subclass2,:std_subclass3,:std_maxvalue,:std_minvalue,:std_actualvalue,:std_value1,");
-            sql.Append(":std_value2,:std_value3,:std_testresult,sysdate,:std_rescode)");
-            ExecuteSql(sql.ToString(), "insert", iSN, omakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iResCode);
+            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;
         }
 
@@ -596,6 +598,16 @@ namespace BenQGuru.eMES.DLLService
                 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>
         public bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage)
         {
             if (iSN == "")
@@ -848,7 +860,7 @@ namespace BenQGuru.eMES.DLLService
                     addpar[i] = new StringBuilder();
                     for (int j = 0; j < c.Length; j++)
                     {
-                        if (c[j] != ' ' && c[j] != ','&&c[j]!=')')
+                        if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
                         {
                             addpar[i].Append(c[j]);
                         }

+ 1 - 1
UAS_MesInterface/UAS_MesDllService(3.5).csproj

@@ -38,7 +38,7 @@
     <SignAssembly>true</SignAssembly>
   </PropertyGroup>
   <PropertyGroup>
-    <AssemblyOriginatorKeyFile>Sec.pfx</AssemblyOriginatorKeyFile>
+    <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System" />