Browse Source

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

Hcsy 8 years ago
parent
commit
e23ba025f1
44 changed files with 5377 additions and 457 deletions
  1. 48 59
      UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs
  2. 14 3
      UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs
  3. 128 137
      UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs
  4. 17 55
      UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs
  5. 27 30
      UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs
  6. 7 0
      UAS-MES/Main.cs
  7. 1 1
      UAS-MES/PublicMethod/BaseUtil.cs
  8. 11 1
      UAS-MES/PublicMethod/Print.cs
  9. 2 42
      UAS-MES/PublicMethod/ftpOperater.cs
  10. 18 0
      UAS_KanBan/App.config
  11. 109 0
      UAS_KanBan/AutoSizeFormClass.cs
  12. 1120 0
      UAS_KanBan/DataHelper.cs
  13. 498 0
      UAS_KanBan/Process.Designer.cs
  14. 57 0
      UAS_KanBan/Process.cs
  15. 123 0
      UAS_KanBan/Process.resx
  16. 19 0
      UAS_KanBan/Program.cs
  17. 36 0
      UAS_KanBan/Properties/AssemblyInfo.cs
  18. 73 0
      UAS_KanBan/Properties/Resources.Designer.cs
  19. 124 0
      UAS_KanBan/Properties/Resources.resx
  20. 40 0
      UAS_KanBan/Properties/Settings.Designer.cs
  21. 9 0
      UAS_KanBan/Properties/Settings.settings
  22. BIN
      UAS_KanBan/Resources/malata_logo.png
  23. 321 0
      UAS_KanBan/Setting.Designer.cs
  24. 77 0
      UAS_KanBan/Setting.cs
  25. 120 0
      UAS_KanBan/Setting.resx
  26. 155 0
      UAS_KanBan/UAS_KanBan.csproj
  27. BIN
      UAS_KanBan/tool/CSkin.dll
  28. BIN
      UAS_KanBan/tool/Oracle.ManagedDataAccess.dll
  29. 13 1
      UAS_WinForm.sln
  30. 18 0
      UAS_XmlAnalysor/App.config
  31. 266 63
      UAS_XmlAnalysor/DataHelper.cs
  32. 83 46
      UAS_XmlAnalysor/Form1.Designer.cs
  33. 59 7
      UAS_XmlAnalysor/Form1.cs
  34. 1367 0
      UAS_XmlAnalysor/LogicHandler.cs
  35. 132 0
      UAS_XmlAnalysor/Login.Designer.cs
  36. 32 0
      UAS_XmlAnalysor/Login.cs
  37. 120 0
      UAS_XmlAnalysor/Login.resx
  38. 10 0
      UAS_XmlAnalysor/Properties/Resources.Designer.cs
  39. 12 5
      UAS_XmlAnalysor/Properties/Resources.resx
  40. 38 0
      UAS_XmlAnalysor/Properties/Settings.Designer.cs
  41. 14 6
      UAS_XmlAnalysor/Properties/Settings.settings
  42. BIN
      UAS_XmlAnalysor/Resources/xml_48px_1124003_easyicon.net.ico
  43. 59 1
      UAS_XmlAnalysor/UAS_XmlAnalysor.csproj
  44. BIN
      UAS_XmlAnalysor/tool/Oracle.ManagedDataAccess.dll

+ 48 - 59
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -54,20 +54,19 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1048, 111);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(786, 89);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(178, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(134, 20);
             this.PrintLabel.TabIndex = 181;
             // 
             // 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(945, 48);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(709, 38);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(72, 27);
+            this.label2.Size = new System.Drawing.Size(58, 21);
             this.label2.TabIndex = 180;
             this.label2.Text = "打印机";
             // 
@@ -75,10 +74,9 @@
             // 
             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(945, 111);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(709, 89);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(52, 27);
+            this.label1.Size = new System.Drawing.Size(42, 21);
             this.label1.TabIndex = 179;
             this.label1.Text = "标签";
             // 
@@ -86,10 +84,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(597, 50);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(448, 40);
             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 = 171;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -99,10 +96,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(13, 559);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Location = new System.Drawing.Point(10, 447);
             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 = 170;
             this.sncode_label.Text = "序列号";
             // 
@@ -110,10 +106,9 @@
             // 
             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(597, 111);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(448, 89);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 167;
             this.label4.Text = "打印张数";
             // 
@@ -121,10 +116,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, 111);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(229, 89);
             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 = 166;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -132,10 +126,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(13, 111);
-            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(10, 89);
             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 = 165;
             this.mcd_okqty_label.Text = "打印计数";
             // 
@@ -143,10 +136,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, 50);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(229, 40);
             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 = 164;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -154,29 +146,27 @@
             // 
             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(13, 50);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(10, 40);
             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 = 163;
             this.ms_makecode_label.Text = "归属工单";
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(1048, 48);
-            this.Printer.Margin = new System.Windows.Forms.Padding(5);
+            this.Printer.Location = new System.Drawing.Point(786, 38);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(178, 31);
+            this.Printer.Size = new System.Drawing.Size(134, 25);
             this.Printer.TabIndex = 178;
             // 
             // 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(423, 111);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(317, 89);
             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 = 177;
             this.mcd_remainqty.Text = "0";
             // 
@@ -184,32 +174,33 @@
             // 
             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(137, 111);
-            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty.Location = new System.Drawing.Point(103, 89);
             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 = 176;
             this.mcd_okqty.Text = "0";
             // 
             // pr_code
             // 
             this.pr_code.AutoSize = true;
+            this.pr_code.CutLength = null;
             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(423, 50);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.Location = new System.Drawing.Point(317, 40);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.Size = new System.Drawing.Size(0, 21);
             this.pr_code.TabIndex = 175;
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // pr_detail
             // 
             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(714, 52);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(536, 42);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 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 = 174;
             // 
             // PrintNum
@@ -217,16 +208,16 @@
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(714, 111);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintNum.Location = new System.Drawing.Point(536, 89);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(198, 25);
+            this.PrintNum.Size = new System.Drawing.Size(150, 21);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
             this.PrintNum.TabIndex = 172;
+            this.PrintNum.Text = "1";
             // 
             // sncode
             // 
@@ -235,11 +226,10 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(132, 560);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4);
+            this.sncode.Location = new System.Drawing.Point(99, 448);
             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;
@@ -250,10 +240,9 @@
             // 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(18, 161);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(14, 129);
             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 = 168;
             this.OperateResult.Text = "";
             // 
@@ -261,16 +250,17 @@
             // 
             this.ma_code.AutoSize = true;
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code.Location = new System.Drawing.Point(137, 52);
+            this.ma_code.Location = new System.Drawing.Point(103, 42);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.ma_code.Name = "ma_code";
-            this.ma_code.Size = new System.Drawing.Size(0, 27);
+            this.ma_code.Size = new System.Drawing.Size(0, 21);
             this.ma_code.TabIndex = 183;
             // 
             // Make_ColorBoxLabelPrint
             // 
-            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(1250, 600);
+            this.ClientSize = new System.Drawing.Size(938, 480);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
@@ -291,7 +281,6 @@
             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(4);
             this.Name = "Make_ColorBoxLabelPrint";
             this.Tag = "Make!ColorBoxLabelPrint";
             this.Text = "标签打印";

+ 14 - 3
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -16,6 +16,7 @@ namespace UAS_MES.Make
         DataTable dt;
         LogStringBuilder sql = new LogStringBuilder();
         AutoSizeFormClass asc = new AutoSizeFormClass();
+        System.DateTime[] indate;
         //保存StepProduct查询出来的数据
         DataTable ListA = new DataTable();
         //保存make left join makecraftdetail left join product的数据
@@ -32,11 +33,14 @@ namespace UAS_MES.Make
         string macode;
         //当前提示的索引
         int RemainIndex = 0;
+
         ApplicationClass lbl;
+
         public Make_ColorBoxLabelPrint()
         {
             InitializeComponent();
         }
+
         private void Make_ColorBoxLabelPrint_Load(object sender, EventArgs e)
         {
             dh = new DataHelper();
@@ -44,6 +48,7 @@ namespace UAS_MES.Make
             asc.controllInitializeSize(this);
             lbl = new ApplicationClass();
         }
+
         private void sn_code_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
@@ -63,7 +68,7 @@ namespace UAS_MES.Make
                     {
                         //获取工单的其他信息
                         sql.Clear();
-                        sql.Append("select ma_code,nvl(mcd_okqty,0),ma_prodcode as pr_code ,pr_detail,");
+                        sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,ma_prodcode as pr_code ,pr_detail,");
                         sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
                         sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -96,7 +101,7 @@ namespace UAS_MES.Make
                         {
                             if (PrintLabel.SelectedValue != null && PrintNum.Text.Trim() != "")
                             {
-                                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ma_code.Text, int.Parse(PrintNum.Text));
+                                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ma_code.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
                                 if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "彩盒打印", User.UserSourceCode, User.UserCode, "彩盒打印成功", out ErrorMessage))
                                 {
                                     ErrorMessage = "打印完成,执行更新";
@@ -135,27 +140,33 @@ namespace UAS_MES.Make
                 }
             }
         }
+
         //根据产品编号获取打印模板
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "' and PL_LABELTYPE='彩盒标' order by PL_ISDEFAULT DESC", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' and PL_LABELTYPE='彩盒标' order by PL_ISDEFAULT DESC", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             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());
             }
         }
+
         private void Make_ColorBoxLabelPrint_Activated(object sender, EventArgs e)
         {
             sncode.Focus();
         }
+
         private void Make_ColorBoxLabelPrint_FormClosing(object sender, FormClosingEventArgs e)
         {
             lbl.Quit();
         }
+
         private void Make_ColorBoxLabelPrint_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);

+ 128 - 137
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -34,11 +34,16 @@
             this.mcd_okqty_label = new System.Windows.Forms.Label();
             this.mcd_remainqty_label = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
-            this.sncode_label = new System.Windows.Forms.Label();
+            this.ms_sncode_label = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
             this.sncode = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.PrintLabel = new System.Windows.Forms.ComboBox();
+            this.ms_sncode = new System.Windows.Forms.Label();
+            this.load = new System.Windows.Forms.RadioButton();
+            this.unload = new System.Windows.Forms.RadioButton();
+            this.code_label = new System.Windows.Forms.Label();
+            this.code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
             this.mcd_okqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
@@ -47,21 +52,15 @@
             this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.PrintNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.label3 = new System.Windows.Forms.Label();
-            this.load = new System.Windows.Forms.RadioButton();
-            this.unload = new System.Windows.Forms.RadioButton();
-            this.code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.code_label = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // ms_makecode_label
             // 
             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(25, 20);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(19, 16);
             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 = 125;
             this.ms_makecode_label.Text = "归属工单";
             // 
@@ -69,10 +68,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(317, 20);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(238, 16);
             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 = 126;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -80,10 +78,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(317, 78);
-            this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(238, 62);
             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 = 127;
             this.mcd_okqty_label.Text = "打印计数";
             // 
@@ -91,10 +88,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(609, 78);
-            this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(457, 62);
             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 = 128;
             this.mcd_remainqty_label.Text = "剩余数";
             // 
@@ -102,34 +98,31 @@
             // 
             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(977, 140);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(733, 112);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(92, 27);
+            this.label4.Size = new System.Drawing.Size(74, 21);
             this.label4.TabIndex = 129;
             this.label4.Text = "打印张数";
             // 
-            // sncode_label
+            // ms_sncode_label
             // 
-            this.sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            this.ms_sncode_label.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
             | 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(25, 75);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.sncode_label.Name = "sncode_label";
-            this.sncode_label.Size = new System.Drawing.Size(72, 27);
-            this.sncode_label.TabIndex = 145;
-            this.sncode_label.Text = "序列号";
+            this.ms_sncode_label.AutoSize = true;
+            this.ms_sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_sncode_label.Location = new System.Drawing.Point(19, 60);
+            this.ms_sncode_label.Name = "ms_sncode_label";
+            this.ms_sncode_label.Size = new System.Drawing.Size(58, 21);
+            this.ms_sncode_label.TabIndex = 145;
+            this.ms_sncode_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(609, 20);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(457, 16);
             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 = 146;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -137,10 +130,9 @@
             // 
             this.sncode.AutoSize = true;
             this.sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode.Location = new System.Drawing.Point(974, 81);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode.Location = new System.Drawing.Point(730, 65);
             this.sncode.Name = "sncode";
-            this.sncode.Size = new System.Drawing.Size(52, 27);
+            this.sncode.Size = new System.Drawing.Size(42, 21);
             this.sncode.TabIndex = 160;
             this.sncode.Text = "标签";
             // 
@@ -148,10 +140,9 @@
             // 
             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(974, 18);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(730, 14);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(72, 27);
+            this.label2.Size = new System.Drawing.Size(58, 21);
             this.label2.TabIndex = 161;
             this.label2.Text = "打印机";
             // 
@@ -159,28 +150,92 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1077, 81);
-            this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.PrintLabel.Location = new System.Drawing.Point(808, 65);
+            this.PrintLabel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.PrintLabel.Name = "PrintLabel";
-            this.PrintLabel.Size = new System.Drawing.Size(201, 23);
+            this.PrintLabel.Size = new System.Drawing.Size(152, 20);
             this.PrintLabel.TabIndex = 162;
             // 
+            // ms_sncode
+            // 
+            this.ms_sncode.AutoSize = true;
+            this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ms_sncode.Location = new System.Drawing.Point(112, 60);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.Size = new System.Drawing.Size(0, 21);
+            this.ms_sncode.TabIndex = 163;
+            // 
+            // load
+            // 
+            this.load.AutoSize = true;
+            this.load.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.load.ForeColor = System.Drawing.Color.Blue;
+            this.load.Location = new System.Drawing.Point(22, 422);
+            this.load.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.load.Name = "load";
+            this.load.Size = new System.Drawing.Size(60, 25);
+            this.load.TabIndex = 164;
+            this.load.TabStop = true;
+            this.load.Text = "上料";
+            this.load.UseVisualStyleBackColor = true;
+            // 
+            // unload
+            // 
+            this.unload.AutoSize = true;
+            this.unload.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.unload.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
+            this.unload.Location = new System.Drawing.Point(126, 422);
+            this.unload.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.unload.Name = "unload";
+            this.unload.Size = new System.Drawing.Size(60, 25);
+            this.unload.TabIndex = 165;
+            this.unload.TabStop = true;
+            this.unload.Text = "下料";
+            this.unload.UseVisualStyleBackColor = true;
+            // 
+            // code_label
+            // 
+            this.code_label.AutoSize = true;
+            this.code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.code_label.Location = new System.Drawing.Point(254, 423);
+            this.code_label.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.code_label.Name = "code_label";
+            this.code_label.Size = new System.Drawing.Size(58, 21);
+            this.code_label.TabIndex = 167;
+            this.code_label.Text = "录入框";
+            // 
+            // code
+            // 
+            this.code.AllPower = null;
+            this.code.BackColor = System.Drawing.Color.White;
+            this.code.ID = null;
+            this.code.Location = new System.Drawing.Point(325, 425);
+            this.code.Margin = new System.Windows.Forms.Padding(2);
+            this.code.Name = "code";
+            this.code.Power = null;
+            this.code.Size = new System.Drawing.Size(132, 21);
+            this.code.Str = null;
+            this.code.Str1 = null;
+            this.code.Str2 = null;
+            this.code.TabIndex = 166;
+            this.code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sn_code_KeyDown);
+            // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(1077, 18);
-            this.Printer.Margin = new System.Windows.Forms.Padding(5);
+            this.Printer.Location = new System.Drawing.Point(808, 14);
+            this.Printer.Margin = new System.Windows.Forms.Padding(4);
             this.Printer.Name = "Printer";
-            this.Printer.Size = new System.Drawing.Size(203, 31);
+            this.Printer.Size = new System.Drawing.Size(152, 25);
             this.Printer.TabIndex = 159;
             // 
             // 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(734, 78);
-            this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_remainqty.Location = new System.Drawing.Point(550, 62);
             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 = 158;
             this.mcd_remainqty.Text = "0";
             // 
@@ -188,42 +243,44 @@
             // 
             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(441, 78);
-            this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.mcd_okqty.Location = new System.Drawing.Point(331, 62);
             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 = 157;
             this.mcd_okqty.Text = "0";
             // 
             // pr_code
             // 
             this.pr_code.AutoSize = true;
+            this.pr_code.CutLength = null;
             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(444, 20);
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code.Location = new System.Drawing.Point(333, 16);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.Size = new System.Drawing.Size(0, 21);
             this.pr_code.TabIndex = 156;
             this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
             // 
             // pr_detail
             // 
             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(738, 20);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(554, 16);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(150, 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 = 154;
             // 
             // ms_makecode
             // 
             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(150, 20);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode.Location = new System.Drawing.Point(112, 16);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(150, 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 = 152;
             // 
             // PrintNum
@@ -231,12 +288,11 @@
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(1077, 140);
-            this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
+            this.PrintNum.Location = new System.Drawing.Point(808, 112);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
             this.PrintNum.Power = null;
-            this.PrintNum.Size = new System.Drawing.Size(204, 25);
+            this.PrintNum.Size = new System.Drawing.Size(154, 21);
             this.PrintNum.Str = null;
             this.PrintNum.Str1 = null;
             this.PrintNum.Str2 = null;
@@ -245,85 +301,22 @@
             // 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(30, 131);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
+            this.OperateResult.Location = new System.Drawing.Point(22, 105);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(920, 380);
+            this.OperateResult.Size = new System.Drawing.Size(691, 305);
             this.OperateResult.TabIndex = 143;
             this.OperateResult.Text = "";
             // 
-            // label3
-            // 
-            this.label3.AutoSize = true;
-            this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label3.Location = new System.Drawing.Point(150, 75);
-            this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(0, 27);
-            this.label3.TabIndex = 163;
-            // 
-            // load
-            // 
-            this.load.AutoSize = true;
-            this.load.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.load.ForeColor = System.Drawing.Color.Blue;
-            this.load.Location = new System.Drawing.Point(30, 528);
-            this.load.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.load.Name = "load";
-            this.load.Size = new System.Drawing.Size(73, 31);
-            this.load.TabIndex = 164;
-            this.load.TabStop = true;
-            this.load.Text = "上料";
-            this.load.UseVisualStyleBackColor = true;
-            // 
-            // unload
-            // 
-            this.unload.AutoSize = true;
-            this.unload.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.unload.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))));
-            this.unload.Location = new System.Drawing.Point(168, 528);
-            this.unload.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.unload.Name = "unload";
-            this.unload.Size = new System.Drawing.Size(73, 31);
-            this.unload.TabIndex = 165;
-            this.unload.TabStop = true;
-            this.unload.Text = "下料";
-            this.unload.UseVisualStyleBackColor = true;
-            // 
-            // code
-            // 
-            this.code.AllPower = null;
-            this.code.BackColor = System.Drawing.Color.White;
-            this.code.ID = null;
-            this.code.Location = new System.Drawing.Point(433, 531);
-            this.code.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.code.Name = "code";
-            this.code.Power = null;
-            this.code.Size = new System.Drawing.Size(175, 25);
-            this.code.Str = null;
-            this.code.Str1 = null;
-            this.code.Str2 = null;
-            this.code.TabIndex = 166;
-            // 
-            // code_label
-            // 
-            this.code_label.AutoSize = true;
-            this.code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.code_label.Location = new System.Drawing.Point(338, 529);
-            this.code_label.Name = "code_label";
-            this.code_label.Size = new System.Drawing.Size(72, 27);
-            this.code_label.TabIndex = 167;
-            this.code_label.Text = "录入框";
-            // 
             // Make_ColorBoxLoadPrint
             // 
-            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(1292, 565);
+            this.ClientSize = new System.Drawing.Size(969, 452);
             this.Controls.Add(this.code_label);
             this.Controls.Add(this.code);
             this.Controls.Add(this.unload);
             this.Controls.Add(this.load);
-            this.Controls.Add(this.label3);
+            this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.sncode);
@@ -335,7 +328,7 @@
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.pr_detail_label);
-            this.Controls.Add(this.sncode_label);
+            this.Controls.Add(this.ms_sncode_label);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.label4);
             this.Controls.Add(this.mcd_remainqty_label);
@@ -343,11 +336,9 @@
             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(4);
             this.Name = "Make_ColorBoxLoadPrint";
             this.Tag = "Make!ColorBoxLoadPrint";
             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);
@@ -363,7 +354,7 @@
         private System.Windows.Forms.Label mcd_remainqty_label;
         private System.Windows.Forms.Label label4;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private System.Windows.Forms.Label sncode_label;
+        private System.Windows.Forms.Label ms_sncode_label;
         private System.Windows.Forms.Label pr_detail_label;
         private CustomControl.TextBoxWithIcon.NumOnlyTextBox PrintNum;
         private CustomControl.ValueLabel.ValueLabel ms_makecode;
@@ -375,7 +366,7 @@
         private System.Windows.Forms.Label sncode;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.ComboBox PrintLabel;
-        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.Label ms_sncode;
         private System.Windows.Forms.RadioButton load;
         private System.Windows.Forms.RadioButton unload;
         private CustomControl.TextBoxWithIcon.EnterTextBox code;

+ 17 - 55
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -18,16 +18,6 @@ namespace UAS_MES.Make
         AutoSizeFormClass asc = new AutoSizeFormClass();
         //保存StepProduct查询出来的数据
         DataTable ListA = new DataTable();
-        //保存make left join makecraftdetail left join product的数据
-        DataTable mapB;
-        //保存ProductLabel数据
-        DataTable ListC;
-        //工序编号
-        string stepcode;
-        //下一工序编号
-        string nextstepcode;
-        //工艺路线编号
-        string craftcode;
         //制造单号
         string ma_code;
         //当前工单的序列号
@@ -35,14 +25,13 @@ namespace UAS_MES.Make
         //当前提示的索引
         int RemainIndex = 0;
 
-        //string Step = "Loading";
+        string ErrorMessage = "";
 
         ApplicationClass lbl;
 
         public Make_ColorBoxLoadPrint()
         {
             InitializeComponent();
-            //默认选中上料
             load.Checked = true;
         }
 
@@ -68,16 +57,17 @@ namespace UAS_MES.Make
                 //string Oerrormessage;
                 //LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out Omakecode, out Omsid, out Oerrormessage)
                 //通过输入指定字符来设置当前执行的步骤
-                if (load.Checked=true)
-                {
+                if (load.Checked = true)
                     OperateResult.AppendText(">>开始执行上料工序\n", Color.Green);
-                }
-                else if (unload.Checked=true)
-                {
+                else if (unload.Checked = true)
                     OperateResult.AppendText(">>开始执行下料工序\n", Color.Green);
+                if (ms_makecode.Text == "")
+                {
+                    if (!LogicHandler.GetMakeInfo(code.Text, out ma_code, out ErrorMessage))
+                    {
+                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                    }
                 }
-                //判断如果该序列号的归属工单和之前查询的是一致的话,就不进行重复数据的查询
-                ma_code = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + code.Text + "'").ToString();
                 if (ms_makecode.Text != ma_code || ma_code == "")
                 {
                     //ma_code不为空的时候表示不是第一次加载,提示用户切换工单
@@ -100,19 +90,9 @@ namespace UAS_MES.Make
                         OperateResult.AppendText(">>序列号" + code.Text + "不存在\n", Color.Red);
                         return;
                     }
-
                     //判断当前的执行状态 ,Loading表示执行上料操作,UnLoading表示执行下料操作
-                    if (load.Checked=true)
+                    if (load.Checked = true)
                     {
-                        sql.Clear();
-                        sql.Append("select ma_code,ma_craftcode,ms_nextstepcode, ms_status,ms_stepcode from makeserial ");
-                        sql.Append("left join make on ma_code=ms_makecode where ms_sncode=:sncode or ms_psn=:sncode");
-                        dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", code.Text, code.Text);
-                        //记录一些变量
-                        stepcode = dt.Rows[0]["ms_stepcode"].ToString();
-                        nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                        craftcode = dt.Rows[0]["ma_craftcode"].ToString();
-                        string ErrorMessage;
                         string Omakecode;
                         string Omsid;
                         //string Oerrormessage;
@@ -133,7 +113,7 @@ namespace UAS_MES.Make
                                     sql.Clear();
                                     sql.Append("select sp_id,sp_description,sp_soncode,pr_detail,pr_spec,sp_repcode,pr_id,sp_type,");
                                     sql.Append("'未采集' sp_ifpick ,sp_prefix,sp_length,sp_regex,sp_regex,sp_ifforsn from stepproduct ");
-                                    sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cd_ifinput"].ToString() + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' ");
+                                    sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cr_code"].ToString() + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' ");
                                     sql.Append("And sp_mothercode='" + pr_code.Text + "' and ((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') ");
                                     sql.Append("order by SP_DETNO asc");
                                     ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -142,14 +122,8 @@ namespace UAS_MES.Make
                                     {
                                         OperateResult.AppendText(">>请采集" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
                                     }
-                                    //未查询到数据时标识是测试工序
-                                    else
-                                    {
-                                        DoTestProcedure();
-                                    }
                                 }
-                                //同上,如果,iftest不等于0也进入测试工序
-                                else if (dt.Rows[0]["cd_iftest"].ToString() != "0")
+                                if (dt.Rows[0]["cd_iftest"].ToString() != "0")
                                 {
                                     DoTestProcedure();
                                 }
@@ -162,17 +136,13 @@ namespace UAS_MES.Make
                         }
                     }
                     //如果执行的是下料操作
-                    else if (unload.Checked=true)
+                    else if (unload.Checked = true)
                     {
                         string ErrorMessage1 = "";
-                        if (LogicHandler.SetMaterialDown(sncode.Text, code.Text,User.UserSourceCode, User.CurrentStepCode, User.UserName, out ErrorMessage1))
-                        {
+                        if (LogicHandler.SetMaterialDown(sncode.Text, code.Text, User.UserSourceCode, User.CurrentStepCode, User.UserName, out ErrorMessage1))
                             OperateResult.AppendText(">>条码" + code.Text + "下料成功\n", Color.Green);
-                        }
                         else
-                        {
                             OperateResult.AppendText(">>" + ErrorMessage1 + "\n", Color.Red);
-                        }
                     }
                 }
                 else
@@ -188,8 +158,8 @@ namespace UAS_MES.Make
                         //如果当前的索引和长度相等则表示采集完成
                         if (RemainIndex == ListA.Rows.Count - 1)
                         {
-                            OperateResult.AppendText(">>序列号对应的工单已经采集完成\n", Color.Green);
-                            sncode.Text = "";
+                            OperateResult.AppendText(">>序列号"+ms_sncode.Text+"对应的工单已经采集完成\n", Color.Green);
+                            code.Text = "";
                             return;
                         }
                         string ErrorMessage;
@@ -202,10 +172,7 @@ namespace UAS_MES.Make
                             RemainIndex = RemainIndex + 1;
                             OperateResult.AppendText(">>请采集物料编号为" + ListA.Rows[RemainIndex]["sp_soncode"].ToString() + "的条码\n", Color.Green);
                         }
-                        else
-                        {
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                        }
+                        else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                     }
                 }
             }
@@ -250,11 +217,6 @@ namespace UAS_MES.Make
                 MessageBox.Show(ErrorMessage1);
         }
 
-        private void 标签打印_Activated(object sender, EventArgs e)
-        {
-            sncode.Focus();
-        }
-
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
             dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc", "select");

+ 27 - 30
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -22,22 +22,8 @@ namespace UAS_MES.Make
         //保存make left join makecraftdetail left join product的数据
         // DataTable ListB;
         DataTable mapB;
-        //保存ProductLabel数据
-        DataTable ListC;
-        //工序编号
-        //        string stepcode;
-        //下一工序编号
-        //        string nextstepcode;
-        //工艺路线编号
-        //        string craftcode;
-        //制造单号
-        //        string make_code;
-        //当前工单的序列号
-        //        tring sn_code;
-        //当前提示的索引
-        //        int RemainIndex = 0;
 
-        //        string Step = "Loading";
+        System.DateTime[] indate;
 
         ApplicationClass lbl;
 
@@ -99,21 +85,24 @@ namespace UAS_MES.Make
                             {
                                 OperateResult.AppendText(">>无序列号" + sncode.Text + "对应工单信息\n", Color.Red);
                             }
+                        }
 
-                            //所选标签不为空
-                            if (PrintLabel.SelectedValue != null)
+                        //所选标签不为空
+                        if (PrintLabel.SelectedValue != null)
+                        {
+                            //按照打印张数打印
+                            Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                            //提示用户打印成功
+                            OperateResult.AppendText(">>序列号:"+sncode.Text+"打印成功\n", Color.Green);
+                            //更新打印的数据
+                            if (LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "机身标打印", User.UserSourceCode, User.UserCode, "机身标打印成功", out oErrorMessage))
                             {
-                                //按照打印张数打印
-                                Print.CodeSoft(lbl, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text));
-                                //提示用户打印成功
-                                OperateResult.AppendText(">>打印成功\n", Color.Green);
-                                //更新打印的数据
-                                LogicHandler.UpdateMakeMessage(sncode.Text, ma_code.Text, "机身标打印", User.UserSourceCode, User.UserName, "机身标打印成功", out oErrorMessage);
                                 //清空输入框的值,聚焦
                                 sncode.Text = "";
                                 sncode.Focus();
                                 //刷新打印数量和剩余数量
-                                mcd_remainqty.Text = int.Parse(mcd_remainqty.Text) - 1 + "";
+                                dt = (DataTable)dh.ExecuteSql("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ma_code.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
+                                BaseUtil.SetFormValue(Controls, dt);
                                 mcd_okqty.Text = int.Parse(mcd_okqty.Text) + 1 + "";
 
                                 //IF 剩余数=0,则清空form中的数据, 提示用户“工单:xx已经打印完成,>>请输入SN”, 清空mapB,listC 中的数据
@@ -129,13 +118,19 @@ namespace UAS_MES.Make
                                     OperateResult.AppendText(">>请输入SN\n", Color.Green);
                                 }
                             }
-                            //标签为空
                             else
                             {
-                                OperateResult.AppendText(">>无可用标签\n", Color.Red);
                                 sncode.Text = "";
+                                sncode.Focus();
+                                OperateResult.AppendText(">>更新工序失败" + oErrorMessage + "\n", Color.Red);
                             }
                         }
+                        //标签为空
+                        else
+                        {
+                            OperateResult.AppendText(">>产品编号:" + ma_prodcode.Text + "未维护机身标签\n", Color.Red);
+                            sncode.Text = "";
+                        }
                     }
                     else
                     {
@@ -143,7 +138,8 @@ namespace UAS_MES.Make
                         sncode.Text = "";
                     }
                 }
-                else {
+                else
+                {
                     OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
                     sncode.Text = "";
                 }
@@ -151,19 +147,20 @@ namespace UAS_MES.Make
         }
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode,to_char(nvl(pl_indate,sysdate),'YYYY-MM-DD HH24:Mi:SS') pl_indate,pl_labelurl from productlabel where pl_prodcode='" + ma_prodcode.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode, pl_indate,pl_labelurl from productlabel where pl_prodcode='" + ma_prodcode.Text + "'and PL_LABELTYPE='机身标' order by pl_isdefault desc", "select");
             if (dt.Rows.Count == 0)
             {
-                OperateResult.AppendText(">>该序列号对应的产品未维护机身标标签模板\n", Color.Red);
+                OperateResult.AppendText(">>产品:" + ma_prodcode.Text + "未维护机身标标签模板\n", Color.Red);
             }
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";
             ftpOperater ftp = new ftpOperater();
+            indate = new System.DateTime[dt.Rows.Count];
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                //ftp.Download(dt.Rows[i]["pl_labelname"].ToString());
                 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());
             }
         }
 

+ 7 - 0
UAS-MES/Main.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Configuration;
+using System.Diagnostics;
 using System.Drawing;
 using System.IO;
 using System.Runtime.InteropServices;
@@ -78,6 +79,12 @@ namespace UAS_MES
         //窗体加载的时候将headBar的事件委托给指定的函数
         private void Main_Load(object sender, EventArgs e)
         {
+            //杀死全部未关闭的打印进程
+            Process[] processes = System.Diagnostics.Process.GetProcessesByName("lppa");
+            for (int i = 0; i < processes.Length; i++)
+            {
+                processes[i].Kill();
+            }
             thread = new Thread(DeleteLog);
             thread.Start();
             this.Tag = "ShowDialogWindow";

+ 1 - 1
UAS-MES/PublicMethod/BaseUtil.cs

@@ -234,7 +234,7 @@ namespace UAS_MES.PublicMethod
             if (URL.Contains("ftp:"))
             {
                 ftpOperater ftp = new ftpOperater();
-                return ftp.Download(LabelName, time);
+                return ftp.Download(LabelName);
             }
             else
             {

+ 11 - 1
UAS-MES/PublicMethod/Print.cs

@@ -1,6 +1,8 @@
 using UAS_MES.DataOperate;
 using LabelManager2;
 using System.Data;
+using System.Text;
+using System.IO;
 
 namespace UAS_MES.PublicMethod
 {
@@ -11,6 +13,7 @@ namespace UAS_MES.PublicMethod
         static Document doc;
         ////CodeSoft的打印机
         //string CodeSpft_Printer;
+        static FileInfo info;
 
         public Print() { }
 
@@ -19,13 +22,14 @@ namespace UAS_MES.PublicMethod
         /// </summary>
         /// <param name="Url"></param>
         /// <param name="LabelCode"></param>
-        public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode,int PrintNum)
+        public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode,int PrintNum,System.DateTime intime)
         {
             //打开模板路径
             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + LabelName);
             //查询模板对应的取值SQL和参数名称
             DataTable dt = (DataTable)dh.ExecuteSql("select lp_name,lp_sql from label left join LABELPARAMETER on la_id=lp_laid where la_code='" + LabelCode + "'", "select");
             //比对模板维护的参数和在系统中维护的参数,名称对应进行SQL取值赋给变量
+            StringBuilder sb = new StringBuilder();
             for (int i = 0; i < doc.Variables.FreeVariables.Count; i++)
             {
                 for (int j = 0; j < dt.Rows.Count; j++)
@@ -35,14 +39,20 @@ namespace UAS_MES.PublicMethod
                         string sql = dt.Rows[j]["lp_sql"].ToString();
                         sql = sql.Substring(0, sql.IndexOf("{")) + "'" + SnCode + "'";
                         doc.Variables.FreeVariables.Item(i + 1).Value = dh.GetLabelParam(sql).ToString();
+                        sb.AppendLine("打印参数【" + doc.Variables.FreeVariables.Item(i + 1).Name + "】赋值," + "取值SQL:" + sql  + ",取到值" + doc.Variables.FreeVariables.Item(i + 1).Value);
                     }
                 }
             }
+            LogManager.DoLog(sb.ToString());
             //保存本次赋值进行打印
             doc.Save();
             doc.Printer.SwitchTo(PrinterName);
             doc.PrintDocument(PrintNum);
             doc.Close();
+            //讲文件最后写入时间改成数据库中拿到的时间
+            info = new FileInfo(ftpOperater.DownLoadTo + LabelName);
+            info.LastWriteTime = intime;
+            
         }
 
         public static void CodeSoft(ApplicationClass lbl, string LabelName, string LabelCode, string PrinterName, string SnCode)

+ 2 - 42
UAS-MES/PublicMethod/ftpOperater.cs

@@ -181,7 +181,7 @@ namespace UAS_MES.PublicMethod
         /// 实现ftp下载操作
         /// </summary>
         /// <param name="fileName">远程文件名</param>
-        public string Download(string fileName,DateTime time)
+        public string Download(string fileName)
         {
             FtpWebRequest reqFTP;
             try
@@ -208,9 +208,6 @@ namespace UAS_MES.PublicMethod
                 ftpStream.Close();
                 outputStream.Close();
                 response.Close();
-                //设置最后修改文件时间为服务器时间
-                FileInfo f = new FileInfo(DownLoadTo + @"\" + fileName);
-                f.LastWriteTime = time;
                 return DownLoadTo + @"\" + fileName;
             }
             catch (Exception ex)
@@ -220,43 +217,6 @@ namespace UAS_MES.PublicMethod
             }
         }
 
-        /// <summary>
-        /// 实现ftp下载操作
-        /// </summary>
-        /// <param name="fileName">远程文件名</param>
-        public string Download(string fileName)
-        {
-            FtpWebRequest reqFTP;
-            try
-            {
-                FileStream outputStream = new FileStream(DownLoadTo + @"\" + fileName, FileMode.Create);
-                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpServerIP + "/" + fileName));
-                reqFTP.Method = WebRequestMethods.Ftp.DownloadFile;
-                reqFTP.UseBinary = true;
-                reqFTP.Credentials = new NetworkCredential(ftpUser, ftpPwd);
-                FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
-                Stream ftpStream = response.GetResponseStream();
-                long cl = response.ContentLength;
-                int bufferSize = 2048;
-                int readCount;
-                byte[] buffer = new byte[bufferSize];
-
-                readCount = ftpStream.Read(buffer, 0, bufferSize);
-                while (readCount > 0)
-                {
-                    outputStream.Write(buffer, 0, readCount);
-                    readCount = ftpStream.Read(buffer, 0, bufferSize);
-                }
-                ftpStream.Close();
-                outputStream.Close();
-                response.Close();
-                return DownLoadTo + @"\" + fileName;
-            }
-            catch (Exception ex)
-            {
-                MessageBox.Show(ex.Message);
-                return "";
-            }
-        }
+       
     }
 }

+ 18 - 0
UAS_KanBan/App.config

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="UAS_KanBan.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
+    <startup> 
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
+    </startup>
+    <userSettings>
+        <UAS_KanBan.Properties.Settings>
+            <setting name="MES" serializeAs="String">
+                <value>Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+            </setting>
+        </UAS_KanBan.Properties.Settings>
+    </userSettings>
+</configuration>

+ 109 - 0
UAS_KanBan/AutoSizeFormClass.cs

@@ -0,0 +1,109 @@
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+namespace UAS_KanBan
+{
+    class AutoSizeFormClass
+    {
+        //(1).声明结构,只记录窗体和其控件的初始位置和大小。
+        public struct controlRect
+        {
+            public int Left;
+            public int Top;
+            public int Width;
+            public int Height;
+        }
+        //(2).声明 1个对象
+        //注意这里不能使用控件列表记录 List nCtrl;,因为控件的关联性,记录的始终是当前的大小。
+        //      public List oldCtrl= new List();//这里将西文的大于小于号都过滤掉了,只能改为中文的,使用中要改回西文
+        public List<controlRect> oldCtrl = new List<controlRect>();
+        int ctrlNo = 0;//1;
+        //(3). 创建两个函数
+        //(3.1)记录窗体和其控件的初始位置和大小,
+        public void controllInitializeSize(Control mForm)
+        {
+            controlRect cR;
+            cR.Left = mForm.Left; cR.Top = mForm.Top; cR.Width = mForm.Width; cR.Height = mForm.Height;
+            oldCtrl.Add(cR);//第一个为"窗体本身",只加入一次即可
+            AddControl(mForm);//窗体内其余控件还可能嵌套控件(比如panel),要单独抽出,因为要递归调用
+                              //this.WindowState = (FormWindowState)(2);//记录完控件的初始位置和大小后,再最大化
+                              //0 - Normalize , 1 - Minimize,2- Maximize
+        }
+
+        private void AddControl(Control ctl)
+        {
+            foreach (Control c in ctl.Controls)
+            {  //**放在这里,是先记录控件的子控件,后记录控件本身
+               //if (c.Controls.Count > 0)
+               //    AddControl(c);//窗体内其余控件还可能嵌套控件(比如panel),要单独抽出,因为要递归调用
+                controlRect objCtrl;
+                objCtrl.Left = c.Left; objCtrl.Top = c.Top; objCtrl.Width = c.Width; objCtrl.Height = c.Height;
+                oldCtrl.Add(objCtrl);
+                //**放在这里,是先记录控件本身,后记录控件的子控件
+                if (c.Controls.Count > 0)
+                    AddControl(c);//窗体内其余控件还可能嵌套控件(比如panel),要单独抽出,因为要递归调用
+
+            }
+        }
+        //(3.2)控件自适应大小,
+        public void controlAutoSize(Control mForm)
+        {
+            if (ctrlNo == 0)
+            { //*如果在窗体的Form1_Load中,记录控件原始的大小和位置,正常没有问题,但要加入皮肤就会出现问题,因为有些控件如dataGridView的的子控件还没有完成,个数少
+              //*要在窗体的Form1_SizeChanged中,第一次改变大小时,记录控件原始的大小和位置,这里所有控件的子控件都已经形成
+                controlRect cR;
+                //  cR.Left = mForm.Left; cR.Top = mForm.Top; cR.Width = mForm.Width; cR.Height = mForm.Height;
+                cR.Left = 0; cR.Top = 0; cR.Width = mForm.PreferredSize.Width; cR.Height = mForm.PreferredSize.Height;
+                oldCtrl.Add(cR);//第一个为"窗体本身",只加入一次即可
+                AddControl(mForm);//窗体内其余控件可能嵌套其它控件(比如panel),故单独抽出以便递归调用
+            }
+
+            float wScale = (float)mForm.Width / (float)oldCtrl[0].Width;//新旧窗体之间的比例,与最早的旧窗体
+            float hScale = (float)mForm.Height / (float)oldCtrl[0].Height;//.Height;
+            ctrlNo = 1;//进入=1,第0个为窗体本身,窗体内的控件,从序号1开始
+            AutoScaleControl(mForm, wScale, hScale);//窗体内其余控件还可能嵌套控件(比如panel),要单独抽出,因为要递归调用
+        }
+
+        private void AutoScaleControl(Control ctl, float wScale, float hScale)
+        {
+            int ctrLeft0, ctrTop0, ctrWidth0, ctrHeight0;
+            //int ctrlNo = 1;//第1个是窗体自身的 Left,Top,Width,Height,所以窗体控件从ctrlNo=1开始
+            foreach (Control c in ctl.Controls)
+            { //**放在这里,是先缩放控件的子控件,后缩放控件本身
+              //if (c.Controls.Count > 0)
+              //   AutoScaleControl(c, wScale, hScale);//窗体内其余控件还可能嵌套控件(比如panel),要单独抽出,因为要递归调用
+                ctrLeft0 = oldCtrl[ctrlNo].Left;
+                ctrTop0 = oldCtrl[ctrlNo].Top;
+                ctrWidth0 = oldCtrl[ctrlNo].Width;
+                ctrHeight0 = oldCtrl[ctrlNo].Height;
+                //c.Left = (int)((ctrLeft0 - wLeft0) * wScale) + wLeft1;//新旧控件之间的线性比例
+                //c.Top = (int)((ctrTop0 - wTop0) * h) + wTop1;
+
+                c.Left = (int)((ctrLeft0) * wScale);//新旧控件之间的线性比例。控件位置只相对于窗体,所以不能加 + wLeft1
+                c.Top = (int)((ctrTop0) * hScale);//
+                                                  //设置指定的类型不进行宽高的变化
+                ctrlNo++;//累加序号
+                //**放在这里,是先缩放控件本身,后缩放控件的子控件
+                if (c.Controls.Count > 0)
+                    AutoScaleControl(c, wScale, hScale);//窗体内其余控件还可能嵌套控件(比如panel),要单独抽出,因为要递归调用
+
+                if (ctl is DataGridView)
+                {
+                    DataGridView dgv = ctl as DataGridView;
+                    Cursor.Current = Cursors.WaitCursor;
+                    int widths = 0;
+                    for (int i = 0; i < dgv.Columns.Count; i++)
+                    {
+                        dgv.AutoResizeColumn(i, DataGridViewAutoSizeColumnMode.AllCells);  // 自动调整列宽  
+                        widths += dgv.Columns[i].Width;   // 计算调整列后单元列的宽度和                       
+                    }
+                    if (widths >= ctl.Size.Width)  // 如果调整列的宽度大于设定列宽  
+                        dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;  // 调整列的模式 自动  
+                    else
+                        dgv.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;  // 如果小于 则填充  
+                    Cursor.Current = Cursors.Default;
+                }
+            }
+        }
+    }
+}

+ 1120 - 0
UAS_KanBan/DataHelper.cs

@@ -0,0 +1,1120 @@
+using Oracle.ManagedDataAccess.Client;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace UAS_KanBan
+{
+    class DataHelper
+    {
+        //系统默认的的连接字符串
+        private string ConnectionStrings = Properties.Settings.Default.Properties["MES"].DefaultValue.ToString();
+        //用户选择的数据库的连接字符串
+        public static string DBConnectionString;
+        public static OracleConnection connection = null;
+        OracleCommand command = null;
+        int ReconnectTime = 0;
+        /// <summary>
+        /// 执行构造函数的时候打开数据库的链接
+        /// </summary>
+        public DataHelper()
+        {
+            try
+            {
+                //如果选择的是默认数据则直接用配置文件的信息连接,否则选择数据库的账套信息
+                if (DBConnectionString == null || DBConnectionString == ConnectionStrings)
+                    connection = new OracleConnection(ConnectionStrings);
+                else
+                    connection = new OracleConnection(DBConnectionString);
+                connection.Open();
+            }
+            catch (Exception e) { }
+        }
+
+        /// <summary>
+        /// 根据表名获取该表字段数据类型
+        /// </summary>
+        public DataTable GetColumnDataType(string TableName)
+        {
+            DataTable dt = new DataTable();
+            command = new OracleCommand("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 获取第一行第一列的信息
+        /// </summary>
+        public object getFieldDataByCondition(string TableName, string Field, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select " + Field + " from " + TableName + " where " + Condition;
+
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter();
+            ad.SelectCommand = command;
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            if (dt.Rows.Count > 0)
+            {
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                return "";
+            }
+        }
+
+
+        /// <summary>
+        /// 执行打印的SQL
+        /// </summary>
+        /// <param name="SQL">SQL语句</param>
+        /// <param name="Parameters">动态添加的参数,主要根据条码枪扫描获取</param>
+        /// <returns></returns>
+        public object ExecutePrintSQL(string SQL, params string[] Parameters)
+        {
+            //按照?拆分数据,然后以:Param替换问号,同时添加参数
+            string[] Param = SQL.Split('?');
+            int ParamNum = Param.Length - 1;
+            //条码打印必然存在需要维护的参数
+            if (ParamNum > 0)
+            {
+                StringBuilder sb = new StringBuilder();
+                for (int i = 0; i < ParamNum; i++)
+                {
+                    sb.Append(Param[i] + ":Param" + i);
+                }
+                command = new OracleCommand(sb.ToString(), connection);
+
+                for (int i = 0; i < ParamNum; i++)
+                {
+                    command.Parameters.Add("Param" + i, OracleDbType.Varchar2, Parameters[i], ParameterDirection.Input);
+                }
+
+                OracleDataAdapter ad = new OracleDataAdapter(command);
+                DataTable dt = new DataTable();
+                ad.Fill(dt);
+                ad.Dispose();
+                command.Dispose();
+                return dt;
+            }
+            return "参数错误,请检查SQL语句";
+        }
+
+        /// <summary>
+        /// 获取指定表的记录的条数 ,带条件
+        /// </summary>
+        /// <returns></returns>
+        public int getRowCount(string TableName, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString());
+        }
+
+        /// <summary>
+        /// 获取指定表的记录的条数 ,不带条件
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <returns></returns>
+        public int getRowCount(string TableName)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select count(1) from " + TableName;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString());
+        }
+
+        /// <summary>
+        /// 通过表名和获取单行的记录
+        /// </summary>
+        public DataTable getFieldsDataByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition + " and rownum=1";
+
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 将DataTable导入到指定的表中
+        /// </summary>
+        /// <param name="DataTable"></param>
+        /// <param name="TableName"></param>
+        public void InsertDataTable(DataTable DataTable, string TableName)
+        {
+            for (int i = 0; i < DataTable.Rows.Count; i++)
+            {
+                for (int j = 0; j < DataTable.Columns.Count; j++)
+                {
+
+                }
+            }
+        }
+
+        /// <summary>
+        /// 按分页获取数据
+        /// </summary>
+        /// <param name="TableName">表名</param>
+        /// <param name="Fields">查询字段</param>
+        /// <param name="CurrentPage">当前页面</param>
+        /// <param name="PageSize">页面展示条数</param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        // SELECT * FROM (SELECT   A.*  FROM (SELECT* FROM datalist) A WHERE ROWNUM <= 50) WHERE ROWNUM >= 21
+        public DataTable getFieldsDatasByPageing(string TableName, string Fields, int CurrentPage, int PageSize, string Caller, params string[] condition)
+        {
+            DataTable dt = new DataTable();
+            StringBuilder sql = new StringBuilder();
+            //先查询出配置出去的列
+            //获取查询的列
+            string[] caption = GetCaptionFromField(Fields);
+            //获取对应列的描述
+            string[] field = GetField(Fields);
+            sql.Append(" select * from (select RowNum RN, A.* from (select ");
+            sql.Append(AddField(caption));
+            if (condition.Length > 0)
+            {
+                if (condition[0] != null && condition[0].Trim() != "")
+                    sql.Append(" from " + TableName + " where " + condition[0] + " ) A where ROWNUM <=" + CurrentPage * PageSize + ") where RN>" + (CurrentPage - 1) * PageSize);
+                else
+                    sql.Append(" from " + TableName + ") A where ROWNUM <= " + CurrentPage * PageSize + ") where RN> " + (CurrentPage - 1) * PageSize);
+            }
+            command = new OracleCommand(sql.ToString(), connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            dt.Columns.RemoveAt(0);
+            foreach (DataColumn dc in dt.Columns)
+            {
+                dc.ColumnName = field[dt.Columns.IndexOf(dc)];
+                dc.Caption = caption[dt.Columns.IndexOf(dc)];
+            }
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段和条件获取DataTable类型的数据
+        /// </summary>
+        public DataTable getFieldsDatasByCondition(string TableName, string[] Fields, string Condition)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += AddField(Fields);
+            sql += " from " + TableName + " where " + Condition;
+
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 通过表名,字段获取DataTable类型的数据
+        /// </summary>
+        public DataTable getFieldsDatas(string TableName, string Fields)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select ";
+            sql += Fields;
+            sql += " from " + TableName;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.SelectCommand = command;
+            ad.Fill(dt);
+            foreach (DataColumn dc in dt.Columns)
+            {
+                dc.Caption = "测试测试";
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt;
+        }
+
+        /// <summary>
+        /// 根据DataTable和指定的表名更新数据,如果需要保存新增的数据则需要传递一条Insert的SQL
+        /// </summary>
+        /// <param name="DataTable"></param>
+        /// <param name="TableName"></param>
+        /// <param name="Condition"></param>
+        public void UpDateTableByCondition(DataTable DataTable, string TableName, string PrimaryKey, params string[] sql)
+        {
+            if (DataTable == null)
+            {
+                return;
+            }
+            StringBuilder sb = new StringBuilder();
+            //预防插入的DataTable中存在不属于该表的列,在进行下一步操作之前全部剔除
+            DataTable data = (DataTable)ExecuteSql("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", "select");
+            //将所有的字段拼接起来
+            for (int i = 0; i < data.Rows.Count; i++)
+            {
+                sb.Append("#" + data.Rows[i]["Column_Name"].ToString());
+            }
+            //移除掉所有不属于该表的列
+            for (int i = DataTable.Columns.Count - 1; i >= 0; i--)
+            {
+                if (!sb.ToString().Contains(DataTable.Columns[i].ColumnName.ToUpper()))
+                {
+                    DataTable.Columns.RemoveAt(i);
+                }
+            }
+            sb.Clear();
+            //计算有多少个是新加的行,根据主键为空来进行判断
+            int NewRowCount = 0;
+            for (int i = 0; i < DataTable.Rows.Count; i++)
+            {
+                if (DataTable.Rows[i][PrimaryKey] == null || DataTable.Rows[i][PrimaryKey].ToString() == "")
+                {
+                    NewRowCount = NewRowCount + 1;
+                }
+            }
+            if (sql.Length > 0)
+            {
+                if (NewRowCount > 0)
+                {
+                    //获取参数的个数
+                    int paramsNum = sql[0].Split(':').Length - 1;
+                    //解析参数的数据
+                    string[] param = GetParamFromSQL(sql[0]);
+                    //新建一个二维数组去
+                    string[][] param_array = new string[paramsNum][];
+                    //实例化每个一维数组
+                    for (int i = 0; i < paramsNum; i++)
+                    {
+                        param_array[i] = new string[NewRowCount];
+                    }
+                    //设置每列参数的索引
+                    int num = 0;
+                    //变量所有的行,如果有主键为空的则移除,不为空的进行参数的拼接
+                    for (int i = DataTable.Rows.Count - 1; i >= 0; i--)
+                    {
+                        if (DataTable.Rows[i][PrimaryKey] == null || DataTable.Rows[i][PrimaryKey].ToString() == "")
+                        {
+                            //当为新添加行的时候才去设置参数,设置过后索引+1
+                            for (int j = 0; j < paramsNum; j++)
+                            {
+                                param_array[j][num] = DataTable.Rows[i][param[j]].ToString();
+                            }
+                            DataTable.Rows.RemoveAt(i);
+                            num++;
+                        }
+                    }
+                    BatchInsertDataTable(sql[0], param, param_array);
+                }
+            }
+            //不是新增行的启用更新的方法
+            sb.Append("update " + TableName + " set ");
+            //拼接语句,特殊处理日期
+
+            foreach (DataColumn dc in DataTable.Columns)
+            {
+                if (!dc.DataType.ToString().Equals("System.DateTime"))
+                {
+                    sb.Append(dc.Caption + "=:" + dc.Caption + ",");
+                }
+                else
+                {
+                    sb.Append(dc.Caption + "=:" + dc.Caption + ",");
+                }
+            }
+            sb.Remove(sb.Length - 1, 1);
+            sb.Append(" where " + PrimaryKey + "=:" + PrimaryKey);
+            command = new OracleCommand(sb.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            // 参数的长度是DataTable的行数决定的
+            command.ArrayBindCount = DataTable.Rows.Count;
+            //默认全部是Varchar2类型的
+            OracleDbType ob = OracleDbType.Varchar2;
+            for (int i = 0; i < DataTable.Columns.Count; i++)
+            {
+                object[] param = new object[DataTable.Rows.Count];
+                for (int j = 0; j < DataTable.Rows.Count; j++)
+                {
+                    DateTime dt = DateTime.Now;
+                    if (DateTime.TryParse(DataTable.Rows[j][i].ToString(), out dt))
+                    {
+                        param[j] = dt;
+                        ob = OracleDbType.Date;
+                    }
+                    else
+                    {
+                        ob = OracleDbType.Varchar2;
+                        param[j] = DataTable.Rows[j][i];
+                    }
+                }
+                //添加批量更新的参数
+                command.Parameters.Add(new OracleParameter(DataTable.Columns[i].Caption, ob, param, ParameterDirection.Input));
+            }
+            ad.UpdateCommand = command;
+            ad.Update(DataTable);
+            ad.Dispose();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 获取DbFind的数据的DataTable的结构
+        /// </summary>
+        /// <param name="field"></param>
+        /// <param name="caller"></param>
+        /// <returns></returns>
+        public DataTable GetDbFindDataTable(string field, string caller)
+        {
+            string sql = "select * from dbfindsetui where ds_caller='" + caller + "' and ds_whichui='" + field + "'";
+            DataTable dt = (DataTable)ExecuteSql(sql, "select");
+            if (dt.Rows.Count != 0)
+            {
+                //通过#号分割字段
+                string[] dbfield = dt.Rows[0]["ds_findtoui"].ToString().Split('#');
+                string[] cnfield = dt.Rows[0]["ds_dbcaption"].ToString().Split('#');
+                //获取查询要查询的Table
+                string dbtable = dt.Rows[0]["ds_tables"].ToString();
+                //拼接查询的字段
+                for (int i = 0; i < dbfield.Length; i++)
+                {
+                    dbfield[i] = dbfield[i].Split(',')[0];
+                }
+                //新建一个空的DataTable
+                DataTable dt1 = new DataTable();
+                //往空的DataTable添加结构,ColumnName是中文,Caption是实际的字段名称
+                for (int i = 0; i < cnfield.Length; i++)
+                {
+                    dt1.Columns.Add(cnfield[i]);
+                    dt1.Columns[i].Caption = dbfield[i];
+                }
+                //返回一个带有结构的空的DataTable
+                //DbFind.BindTable1 = dbtable;
+                return dt1;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        ///  获取配置列表中的数据,支持DaatList,Form,DetailGrid
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <param name="Type"></param>
+        /// <param name="condition"></param>
+        /// <returns></returns>
+        public DataTable GetConfigureData(string Caller, string Type, string condition)
+        {
+            DataTable dt = new DataTable();
+            //用于拼接SQL语句
+            StringBuilder Sql = new StringBuilder();
+            //用于设置不同Type时设置对应表的字段
+            string getField = "";
+            string getCaption = "";
+            string getTable = "";
+            switch (Type.ToUpper())
+            {
+                case "DATALIST":
+                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
+                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
+                    break;
+                case "FORM":
+                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
+                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
+                    break;
+                case "DETAILGRID":
+                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
+                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
+                    break;
+            }
+            command = new OracleCommand(Sql.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            //清除掉之前的内容重新拼接
+            Sql.Clear();
+            Sql.Append("select ");
+            string[] field = new string[dt.Rows.Count];
+            string[] caption = new string[dt.Rows.Count];
+            DataTable dt1 = new DataTable();
+            //记录描述和字段名称
+            foreach (DataRow dr in dt.Rows)
+            {
+                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
+                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
+                Sql.Append(dr[getField] + ",");
+            }
+            //调用substring是为了去除之前拼接多出来的一个逗号
+            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable] + " where " + condition;
+            //调用一个新的构造DataTable用来存放返回的数据
+            dt1 = (DataTable)ExecuteSql(sql, "select");
+            //给DataTable加上列名和描述,列名是中文字段,描述是数据库实际的字段名称
+            for (int i = 0; i < field.Length; i++)
+            {
+                dt1.Columns[i].ColumnName = field[i];
+                dt1.Columns[i].Caption = caption[i];
+            }
+            //返回的第一条数据是SQL,后面的是实际的列名
+            ad.Dispose();
+            command.Dispose();
+            return dt1;
+        }
+
+        /// <summary>
+        /// 查询配置的字段,Type是查询DataList,Form还是DetailGrid
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        public DataTable GetConfigureData(string Caller, string Type)
+        {
+            DataTable dt = new DataTable();
+            //用于拼接SQL语句
+            StringBuilder Sql = new StringBuilder();
+            //用于设置不同Type时设置对应表的字段
+            string getField = "";
+            string getCaption = "";
+            string getTable = "";
+            switch (Type.ToUpper())
+            {
+                case "DATALIST":
+                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
+                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
+                    break;
+                case "FORM":
+                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
+                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
+                    break;
+                case "DETAILGRID":
+                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
+                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
+                    break;
+            }
+            command = new OracleCommand(Sql.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            //清除掉之前的内容重新拼接
+            Sql.Clear();
+            Sql.Append("select ");
+            //用于记录实际的列名,+1的目的是为了存放SQL
+            string[] field = new string[dt.Rows.Count];
+            string[] caption = new string[dt.Rows.Count];
+            DataTable dt1 = new DataTable();
+            foreach (DataRow dr in dt.Rows)
+            {
+                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
+                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
+                Sql.Append(dr[getField] + ",");
+            }
+            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable];
+            dt1 = (DataTable)ExecuteSql(sql, "select");
+            //设置DataTable的列名和描述
+            for (int i = 0; i < field.Length; i++)
+            {
+                dt1.Columns[i].ColumnName = field[i];
+                dt1.Columns[i].Caption = caption[i];
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt1;
+        }
+
+        /// <summary>
+        /// 检测内容是否存在
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="Condition"></param>
+        /// <returns></returns>
+        public bool CheckExist(string TableName, string Condition)
+        {
+            string sql = "select count(1) from " + TableName + " where " + Condition;
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            DataTable dt = new DataTable();
+
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString()) > 0;
+        }
+
+        /// <summary>
+        /// 直接执行SQL,同时传入SQL的类型
+        /// </summary>
+        /// <param name="SQL"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        public object ExecuteSql(string SQL, string Type, params object[] names)
+        {
+            object result = null;
+            command = new OracleCommand(SQL, connection);
+            Reconnect(command);
+            //用来拼接参数的
+            if (names.Length > 0)
+            {
+                string[] par = SQL.Split(':');
+                //用来存参数的数组
+                StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+                for (int i = 0; i < par.Length - 1; i++)
+                {
+                    //新建一个char类型的数组用来存储每个字节的变量
+                    char[] c = par[i + 1].ToCharArray();
+                    addpar[i] = new StringBuilder();
+                    for (int j = 0; j < c.Length; j++)
+                    {
+                        if (c[j] != ' ' && c[j] != ',')
+                        {
+                            addpar[i].Append(c[j]);
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                }
+                for (int i = 0; i < addpar.Length; i++)
+                    command.Parameters.Add(new OracleParameter(addpar[i].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
+            }
+            Console.WriteLine(SQL);
+            switch (Type.ToUpper())
+            {
+                case "SELECT":
+                    result = new DataTable();
+                    try
+                    {
+                        OracleDataAdapter ad = new OracleDataAdapter(command);
+                        ad.Fill((DataTable)result);
+                        ad.Dispose();
+                        //成功执行后将重复连接数置为0
+                        ReconnectTime = 0;
+                    }
+                    catch (Exception)
+                    {
+                        if (ReconnectTime == 0)
+                        {
+                            //重置的数据库链接后只执行一次
+                            ReconnectTime = ReconnectTime + 1;
+                            connection = new OracleConnection(DBConnectionString);
+                            result = ExecuteSql(SQL, Type, names);
+                        }
+                    }
+                    break;
+                case "DELETE":
+                    result = command.ExecuteNonQuery();
+                    break;
+                case "UPDATE":
+                    result = command.ExecuteNonQuery();
+                    break;
+                case "INSERT":
+                    result = command.ExecuteNonQuery();
+                    break;
+            }
+            command.Dispose();
+            return result;
+        }
+
+        /// <summary>
+        /// 为了同步BS端的条码维护,检测时允许问号的存在,在检测时默认将问号换成:Param参数
+        /// </summary>
+        /// <param name="SQL"></param>
+        public void CheckSQL(string SQL)
+        {
+            SQL = SQL.Replace("?", ":Param");
+            command = new OracleCommand(SQL, connection);
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        public int GetDistinctRowCount(string TableName, string Field)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select distinct count('" + Field + "') from " + TableName;
+
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return int.Parse(dt.Rows[0][0].ToString());
+        }
+
+        /// <summary>
+        /// 根据Caller获取流水号
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public string GetSerialNumberByCaller(string Caller)
+        {
+            string SerialNumber = getFieldDataByCondition("MaxNumbers", "mn_number", "mn_tablename='" + Caller + "'").ToString();
+            UpdateByCondition("MaxNumbers", "mn_number=mn_number+1", "mn_tablename='" + Caller + "'");
+            return SerialNumber;
+        }
+
+        /// <summary>
+        /// 根据主键ID删除表的数据
+        /// </summary>
+        /// <param name="TableName">表名</param>
+        /// <param name="ID">主键</param>
+        /// <param name="DeleteID">需要删除主键ID的数组</param>
+        public void DeleteDataByID(string TableName, string ID, string[] DeleteID)
+        {
+            string sql = "delete from " + TableName + " where " + ID + " =:DeleteID";
+
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            command.ArrayBindCount = DeleteID.Length;
+            command.Parameters.Add(new OracleParameter("DeleteID", OracleDbType.Long, DeleteID, ParameterDirection.Input));
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 通过序列的名称获取序列
+        /// </summary>
+        /// <param name="SeqName"></param>
+        /// <returns></returns>
+        public string GetSEQ(string SeqName)
+        {
+            DataTable dt = new DataTable();
+            dt = (DataTable)ExecuteSql("SELECT " + SeqName + ".NEXTVAL FROM DUAL", "select");
+            return dt.Rows[0][0].ToString();
+        }
+
+        /// <summary>
+        /// 通过序列的名称获取序列
+        /// </summary>
+        /// <param name="SeqName"></param>
+        /// <returns></returns>
+        public string[] GetSEQ(string SeqName, int Num)
+        {
+            DataTable dt = new DataTable();
+            dt = (DataTable)ExecuteSql("select " + SeqName + ".nextval from (select 1 from OQCITEMSAMPLES where rownum<" + (Num + 1) + ")", "select");
+            string[] SerialNum = new string[dt.Rows.Count];
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                SerialNum[i] = dt.Rows[i][0].ToString();
+            }
+            return SerialNum;
+        }
+
+        public void SaveDataTable(DataTable dt, string TableName, string ID, params string[] sql)
+        {
+            if (dt == null)
+            {
+                return;
+            }
+            StringBuilder sb = new StringBuilder();
+            //预防插入的DataTable中存在不属于该表的列,在进行下一步操作之前全部剔除
+            DataTable data = (DataTable)ExecuteSql("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", "select");
+            //将所有的字段拼接起来
+            for (int i = 0; i < data.Rows.Count; i++)
+            {
+                sb.Append("#" + data.Rows[i]["Column_Name"].ToString());
+            }
+            //移除掉所有不属于该表的列
+            for (int i = dt.Columns.Count - 1; i >= 0; i--)
+            {
+                if (!sb.ToString().Contains(dt.Columns[i].ColumnName.ToUpper()))
+                {
+                    dt.Columns.RemoveAt(i);
+                }
+            }
+            sb.Clear();
+            //计算有多少个是新加的行,根据主键为空来进行判断
+            int NewRowCount = 0;
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (dt.Rows[i][ID] == null || dt.Rows[i][ID].ToString() == "")
+                {
+                    NewRowCount = NewRowCount + 1;
+                }
+            }
+            if (sql.Length > 0)
+            {
+                if (NewRowCount > 0)
+                {
+                    //获取参数的个数
+                    int paramsNum = sql[0].Split(':').Length - 1;
+                    //解析参数的数据
+                    string[] param = GetParamFromSQL(sql[0]);
+                    //新建一个二维数组去
+                    string[][] param_array = new string[paramsNum][];
+                    //实例化每个一维数组
+                    for (int i = 0; i < paramsNum; i++)
+                    {
+                        param_array[i] = new string[NewRowCount];
+                    }
+                    //设置每列参数的索引
+                    int num = 0;
+                    //变量所有的行,如果有主键为空的则移除,不为空的进行参数的拼接
+                    for (int i = dt.Rows.Count - 1; i >= 0; i--)
+                    {
+                        if (dt.Rows[i][ID] == null || dt.Rows[i][ID].ToString() == "")
+                        {
+                            //当为新添加行的时候才去设置参数,设置过后索引+1
+                            for (int j = 0; j < paramsNum; j++)
+                            {
+                                param_array[j][num] = dt.Rows[i][param[j]].ToString();
+                            }
+                            dt.Rows.RemoveAt(i);
+                            num++;
+                        }
+                    }
+                    BatchInsertDataTable(sql[0], param, param_array);
+                }
+            }
+            sb.Clear();
+            sb.Append("update " + TableName + " set ");
+            int ColumnCount = dt.Columns.Count;
+            int RowCount = dt.Rows.Count;
+            //存数据的参数
+            List<string[]> Parameter = new List<string[]>();
+            //存参数名的参数
+            string[] ParName = new string[ColumnCount];
+            for (int i = 0; i < ColumnCount; i++)
+            {
+                ParName[i] = dt.Columns[i].ColumnName;
+                if (i == dt.Columns.Count - 1)
+                    sb.Append(dt.Columns[i].ColumnName + "=:" + dt.Columns[i].ColumnName);
+                else
+                    sb.Append(dt.Columns[i].ColumnName + "=:" + dt.Columns[i].ColumnName + ",");
+            }
+            sb.Append(" where " + ID + " =:" + ID);
+            //先添加参数
+            Parameter.Add(ParName);
+            //添加参数的具体内容
+            for (int i = 0; i < ColumnCount; i++)
+            {
+                string[] par = new string[RowCount];
+                for (int j = 0; j < RowCount; j++)
+                {
+                    par[j] = dt.Rows[j][i].ToString();
+                }
+                Parameter.Add(par);
+            }
+            BatchInsert(sb.ToString(), Parameter.ToArray());
+        }
+
+        /// <summary>
+        /// 批量通过SQL来执行插入操作 ,参数的第一个数一个string[]数组,用来传递需要添加的参数的名称
+        /// 之后的是名称参数数组对应的 ,所有的插入参数数据长度必须是一致的
+        /// </summary>
+        /// <param name="sql"></param>
+        /// <param name="names"></param>
+        public void BatchInsert(string sql, params object[][] names)
+        {
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            command.ArrayBindCount = names[1].Length;
+            //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
+            //将第一个数组的下标固定为0作为循环添加的参数的名称
+            for (int i = 1; i <= names[0].Length; i++)
+            {
+                command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
+            }
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+        public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
+        {
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            command.ArrayBindCount = param1[0].Length;
+            //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
+            //将第一个数组的下标固定为0作为循环添加的参数的名称
+            for (int i = 0; i < param.Length; i++)
+            {
+                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, param1[i], ParameterDirection.Input));
+            }
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
+
+        /// <summary>
+        /// 查询DataList配置的字段
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public string GetDataList(string TableName, string Caller)
+        {
+            DataTable dt = new DataTable();
+            string SQL = " select listagg(dld_field,',') within group (order by dld_id)  from datalistdetail where dld_caller='" + Caller + "'";
+            command = new OracleCommand(SQL, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            ad.Dispose();
+            command.Dispose();
+            return dt.Rows[0][0].ToString();
+        }
+
+        /// <summary>
+        /// 取Configs表中的配置,进行该客户是否执行某个操作
+        /// </summary>
+        /// <param name="Code"></param>
+        /// <param name="Caller"></param>
+        /// <returns></returns>
+        public object GetConfig(string Code, string Caller)
+        {
+            DataTable dt = new DataTable();
+            string sql = "select Data from configs where code='" + Code + "' and caller='" + Caller + "'";
+            dt = (DataTable)ExecuteSql(sql, "select");
+            if (dt.Rows.Count == 0)
+            {
+                return "";
+            }
+            else
+            {
+                return dt.Rows[0]["Data"];
+            }
+        }
+
+
+        //将数据类型的列类型转换为DataTable
+        public DataTable DataTypeColumnToDataTable(DataTable dt)
+        {
+            DataTable dt1 = new DataTable();
+            dt1.Rows.Add();
+            foreach (DataRow dr in dt.Rows)
+            {
+                dt1.Columns.Add(dr[0].ToString());
+                int index = dt.Rows.IndexOf(dr);
+                if (dr[1].ToString() == "NUMBER")
+                {
+                    dt1.Rows[0][index] = 0;
+                }
+                if (dr[1].ToString() == "VARCHAR2")
+                {
+                    dt1.Rows[0][index] = "这是一段文字";
+                }
+                if (dr[1].ToString() == "DATE")
+                {
+                    dt1.Rows[0][index] = DateTime.Now.ToString("yyyy-MM-dd");
+                }
+                if (dr[1].ToString() == "FLOAT")
+                {
+                    dt1.Rows[0][index] = 1.0;
+                }
+                if (dr[1].ToString() == "CLOB")
+                {
+                    dt1.Rows[0][index] = "一段长文字";
+                }
+            }
+            return dt1;
+        }
+
+
+        /// <summary>
+        /// 通过条件更新
+        /// </summary>
+        /// <param name="TableName"></param>
+        /// <param name="update"></param>
+        /// <param name="condition"></param>
+        public string UpdateByCondition(string TableName, string update, string condition)
+        {
+            string sql = "update " + TableName + " set " + update + " where " + condition;
+
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            command.ExecuteNonQuery();
+            command.Dispose();
+            return sql;
+        }
+
+        /// <summary>
+        /// 调用存储过程
+        /// </summary>
+        /// <param name="ProcedureName"></param>    
+        /// <param name="param"></param>
+        public void CallProcedure(string ProcedureName, ref string[] param)
+        {
+            command = new OracleCommand(ProcedureName);
+            command.Connection = connection;
+            Reconnect(command);
+            command.CommandText = ProcedureName;
+            command.CommandType = CommandType.StoredProcedure;
+            for (int i = 0; i < param.Length; i++)
+                command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
+            command.ExecuteNonQuery();
+            for (int i = 0; i < command.Parameters.Count; i++)
+                param[i] = command.Parameters[i].Value.ToString();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 出现异常进行回滚的执行方法
+        /// </summary>
+        /// <param name="SQL"></param>
+        public void ExecuteSQLTran(params string[] SQL)
+        {
+            OracleTransaction tx = connection.BeginTransaction();
+            command = new OracleCommand();
+            command.Connection = connection;
+            command.Transaction = tx;
+            try
+            {
+                foreach (string sql in SQL)
+                {
+                    if (!String.IsNullOrEmpty(sql))
+                    {
+
+                        command.CommandText = sql;
+                        command.ExecuteNonQuery();
+                    }
+                }
+                tx.Commit();
+            }
+            catch (Exception)
+            {
+                tx.Rollback();
+            }
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 用于将string 的数组转换成SQL的查询内容
+        /// </summary>
+        /// <param name="Fields"></param>
+        /// <returns></returns>
+        private string AddField(string[] Fields)
+        {
+            string sql = " ";
+            foreach (string field in Fields)
+            {
+                sql += field + ",";
+            }
+            return sql.Substring(0, sql.Length - 1);
+        }
+        /// <summary>
+        /// 通过查询的内容获取到字段的描述
+        /// </summary>
+        /// <param name="field"></param>
+        /// <returns></returns>
+        private static string[] GetCaptionFromField(string field)
+        {
+            string[] caption = field.Split(',');
+            for (int i = 0; i < caption.Length; i++)
+            {
+                caption[i] = caption[i].Substring(0, caption[i].LastIndexOf("as")).Trim();
+            }
+            return caption;
+        }
+
+        /// <summary>
+        /// 通过查询的语句获取查询的字段
+        /// </summary>
+        /// <param name="field"></param>
+        /// <returns></returns>
+        private static string[] GetField(string field)
+        {
+            string[] fields = field.Split(',');
+            for (int i = 0; i < fields.Length; i++)
+            {
+                fields[i] = fields[i].Substring(fields[i].LastIndexOf("as") + 2, fields[i].Length - fields[i].LastIndexOf("as") - 2).Trim();
+            }
+            return fields;
+        }
+
+        public object GetLabelParam(string sql)
+        {
+            DataTable dt = new DataTable();
+            command = new OracleCommand(sql, connection);
+            Reconnect(command);
+            OracleDataAdapter ad = new OracleDataAdapter();
+            ad.SelectCommand = command;
+            ad.Fill(dt);
+            if (dt.Rows.Count > 0)
+            {
+                ad.Dispose();
+                command.Dispose();
+                return dt.Rows[0][0];
+            }
+            else
+            {
+                command.Dispose();
+                return "";
+            }
+        }
+
+        public static string[] GetParamFromSQL(string SQL)
+        {
+            string[] par = SQL.Split(':');
+            //用来存参数的数组
+            StringBuilder[] addpar = new StringBuilder[par.Length - 1];
+            string[] param = new string[par.Length - 1];
+            for (int i = 0; i < par.Length - 1; i++)
+            {
+                //新建一个char类型的数组用来存储每个字节的变量
+                char[] c = par[i + 1].ToCharArray();
+                addpar[i] = new StringBuilder();
+
+                for (int j = 0; j < c.Length; j++)
+                {
+                    if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
+                    {
+                        addpar[i].Append(c[j]);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                }
+            }
+            for (int i = 0; i < par.Length - 1; i++)
+            {
+                param[i] = addpar[i].ToString();
+            }
+            return param;
+        }
+
+        public void Dispose()
+        {
+
+        }
+
+        private void Reconnect(OracleCommand cmd)
+        {
+            if (cmd.Connection.State == ConnectionState.Closed)
+            {
+                cmd.Connection.Open();
+            }
+        }
+    }
+}

+ 498 - 0
UAS_KanBan/Process.Designer.cs

@@ -0,0 +1,498 @@
+namespace UAS_KanBan
+{
+    partial class Process
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            this.TopLine = new CCWin.SkinControl.SkinPanel();
+            this.BottomLine = new CCWin.SkinControl.SkinPanel();
+            this.Line1 = new CCWin.SkinControl.SkinPanel();
+            this.Line2 = new CCWin.SkinControl.SkinPanel();
+            this.skinPanel7 = new CCWin.SkinControl.SkinPanel();
+            this.skinLabel1 = new CCWin.SkinControl.SkinLabel();
+            this.Line3 = new CCWin.SkinControl.SkinPanel();
+            this.skinLabel3 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel6 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel7 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel4 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel5 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel8 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel9 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel10 = new CCWin.SkinControl.SkinLabel();
+            this.skinPictureBox1 = new CCWin.SkinControl.SkinPictureBox();
+            this.skinLabel2 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel11 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel12 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel13 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel14 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel15 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel16 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel17 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel18 = new CCWin.SkinControl.SkinLabel();
+            this.Refresh = new System.Windows.Forms.Timer(this.components);
+            ((System.ComponentModel.ISupportInitialize)(this.skinPictureBox1)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // TopLine
+            // 
+            this.TopLine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.TopLine.BackColor = System.Drawing.Color.White;
+            this.TopLine.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.TopLine.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.TopLine.DownBack = null;
+            this.TopLine.Location = new System.Drawing.Point(3, 33);
+            this.TopLine.MouseBack = null;
+            this.TopLine.Name = "TopLine";
+            this.TopLine.NormlBack = null;
+            this.TopLine.Size = new System.Drawing.Size(1180, 2);
+            this.TopLine.TabIndex = 0;
+            // 
+            // BottomLine
+            // 
+            this.BottomLine.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.BottomLine.BackColor = System.Drawing.Color.White;
+            this.BottomLine.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.BottomLine.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.BottomLine.DownBack = null;
+            this.BottomLine.Location = new System.Drawing.Point(3, 146);
+            this.BottomLine.MouseBack = null;
+            this.BottomLine.Name = "BottomLine";
+            this.BottomLine.NormlBack = null;
+            this.BottomLine.Size = new System.Drawing.Size(1180, 2);
+            this.BottomLine.TabIndex = 1;
+            // 
+            // Line1
+            // 
+            this.Line1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.Line1.BackColor = System.Drawing.Color.White;
+            this.Line1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.Line1.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.Line1.DownBack = null;
+            this.Line1.Location = new System.Drawing.Point(301, 34);
+            this.Line1.MouseBack = null;
+            this.Line1.Name = "Line1";
+            this.Line1.NormlBack = null;
+            this.Line1.Size = new System.Drawing.Size(2, 110);
+            this.Line1.TabIndex = 1;
+            // 
+            // Line2
+            // 
+            this.Line2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.Line2.BackColor = System.Drawing.Color.White;
+            this.Line2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.Line2.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.Line2.DownBack = null;
+            this.Line2.Location = new System.Drawing.Point(839, 34);
+            this.Line2.MouseBack = null;
+            this.Line2.Name = "Line2";
+            this.Line2.NormlBack = null;
+            this.Line2.Size = new System.Drawing.Size(2, 110);
+            this.Line2.TabIndex = 3;
+            // 
+            // skinPanel7
+            // 
+            this.skinPanel7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.skinPanel7.BackColor = System.Drawing.Color.White;
+            this.skinPanel7.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.skinPanel7.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.skinPanel7.DownBack = null;
+            this.skinPanel7.Location = new System.Drawing.Point(841, 92);
+            this.skinPanel7.MouseBack = null;
+            this.skinPanel7.Name = "skinPanel7";
+            this.skinPanel7.NormlBack = null;
+            this.skinPanel7.Size = new System.Drawing.Size(341, 2);
+            this.skinPanel7.TabIndex = 2;
+            // 
+            // skinLabel1
+            // 
+            this.skinLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.skinLabel1.AutoSize = true;
+            this.skinLabel1.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel1.BorderColor = System.Drawing.Color.White;
+            this.skinLabel1.Font = new System.Drawing.Font("宋体", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel1.Location = new System.Drawing.Point(448, 74);
+            this.skinLabel1.Name = "skinLabel1";
+            this.skinLabel1.Size = new System.Drawing.Size(271, 33);
+            this.skinLabel1.TabIndex = 4;
+            this.skinLabel1.Text = "产线执行进度看板";
+            // 
+            // Line3
+            // 
+            this.Line3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.Line3.BackColor = System.Drawing.Color.White;
+            this.Line3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.Line3.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.Line3.DownBack = null;
+            this.Line3.Location = new System.Drawing.Point(949, 34);
+            this.Line3.MouseBack = null;
+            this.Line3.Name = "Line3";
+            this.Line3.NormlBack = null;
+            this.Line3.Size = new System.Drawing.Size(2, 110);
+            this.Line3.TabIndex = 4;
+            // 
+            // skinLabel3
+            // 
+            this.skinLabel3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel3.AutoSize = true;
+            this.skinLabel3.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel3.BorderColor = System.Drawing.Color.White;
+            this.skinLabel3.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel3.Location = new System.Drawing.Point(45, 265);
+            this.skinLabel3.Name = "skinLabel3";
+            this.skinLabel3.Size = new System.Drawing.Size(159, 35);
+            this.skinLabel3.TabIndex = 6;
+            this.skinLabel3.Text = "生产机型";
+            // 
+            // skinLabel6
+            // 
+            this.skinLabel6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel6.AutoSize = true;
+            this.skinLabel6.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel6.BorderColor = System.Drawing.Color.White;
+            this.skinLabel6.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel6.Location = new System.Drawing.Point(45, 488);
+            this.skinLabel6.Name = "skinLabel6";
+            this.skinLabel6.Size = new System.Drawing.Size(123, 35);
+            this.skinLabel6.TabIndex = 9;
+            this.skinLabel6.Text = "总产出";
+            // 
+            // skinLabel7
+            // 
+            this.skinLabel7.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel7.AutoSize = true;
+            this.skinLabel7.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel7.BorderColor = System.Drawing.Color.White;
+            this.skinLabel7.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel7.Location = new System.Drawing.Point(45, 376);
+            this.skinLabel7.Name = "skinLabel7";
+            this.skinLabel7.Size = new System.Drawing.Size(123, 35);
+            this.skinLabel7.TabIndex = 10;
+            this.skinLabel7.Text = "总投入";
+            // 
+            // skinLabel4
+            // 
+            this.skinLabel4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel4.AutoSize = true;
+            this.skinLabel4.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel4.BorderColor = System.Drawing.Color.White;
+            this.skinLabel4.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel4.Location = new System.Drawing.Point(684, 376);
+            this.skinLabel4.Name = "skinLabel4";
+            this.skinLabel4.Size = new System.Drawing.Size(123, 35);
+            this.skinLabel4.TabIndex = 13;
+            this.skinLabel4.Text = "收益率";
+            // 
+            // skinLabel5
+            // 
+            this.skinLabel5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel5.AutoSize = true;
+            this.skinLabel5.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel5.BorderColor = System.Drawing.Color.White;
+            this.skinLabel5.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel5.Location = new System.Drawing.Point(684, 488);
+            this.skinLabel5.Name = "skinLabel5";
+            this.skinLabel5.Size = new System.Drawing.Size(123, 35);
+            this.skinLabel5.TabIndex = 12;
+            this.skinLabel5.Text = "故障数";
+            // 
+            // skinLabel8
+            // 
+            this.skinLabel8.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel8.AutoSize = true;
+            this.skinLabel8.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel8.BorderColor = System.Drawing.Color.White;
+            this.skinLabel8.Font = new System.Drawing.Font("宋体", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel8.Location = new System.Drawing.Point(684, 265);
+            this.skinLabel8.Name = "skinLabel8";
+            this.skinLabel8.Size = new System.Drawing.Size(123, 35);
+            this.skinLabel8.TabIndex = 11;
+            this.skinLabel8.Text = "直通率";
+            // 
+            // skinLabel9
+            // 
+            this.skinLabel9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.skinLabel9.AutoSize = true;
+            this.skinLabel9.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel9.BorderColor = System.Drawing.Color.White;
+            this.skinLabel9.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel9.Location = new System.Drawing.Point(860, 50);
+            this.skinLabel9.Name = "skinLabel9";
+            this.skinLabel9.Size = new System.Drawing.Size(71, 29);
+            this.skinLabel9.TabIndex = 14;
+            this.skinLabel9.Text = "线体";
+            // 
+            // skinLabel10
+            // 
+            this.skinLabel10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.skinLabel10.AutoSize = true;
+            this.skinLabel10.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel10.BorderColor = System.Drawing.Color.White;
+            this.skinLabel10.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel10.Location = new System.Drawing.Point(860, 106);
+            this.skinLabel10.Name = "skinLabel10";
+            this.skinLabel10.Size = new System.Drawing.Size(71, 29);
+            this.skinLabel10.TabIndex = 15;
+            this.skinLabel10.Text = "班次";
+            // 
+            // skinPictureBox1
+            // 
+            this.skinPictureBox1.BackColor = System.Drawing.Color.Transparent;
+            this.skinPictureBox1.Image = global::UAS_KanBan.Properties.Resources.malata_logo;
+            this.skinPictureBox1.Location = new System.Drawing.Point(6, 55);
+            this.skinPictureBox1.Name = "skinPictureBox1";
+            this.skinPictureBox1.Size = new System.Drawing.Size(289, 71);
+            this.skinPictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
+            this.skinPictureBox1.TabIndex = 16;
+            this.skinPictureBox1.TabStop = false;
+            // 
+            // skinLabel2
+            // 
+            this.skinLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel2.AutoSize = true;
+            this.skinLabel2.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel2.BorderColor = System.Drawing.Color.White;
+            this.skinLabel2.BorderSize = 0;
+            this.skinLabel2.Font = new System.Drawing.Font("微软雅黑", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel2.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel2.Location = new System.Drawing.Point(241, 370);
+            this.skinLabel2.Name = "skinLabel2";
+            this.skinLabel2.Size = new System.Drawing.Size(86, 46);
+            this.skinLabel2.TabIndex = 19;
+            this.skinLabel2.Text = "100";
+            // 
+            // skinLabel11
+            // 
+            this.skinLabel11.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel11.AutoSize = true;
+            this.skinLabel11.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel11.BorderColor = System.Drawing.Color.White;
+            this.skinLabel11.BorderSize = 0;
+            this.skinLabel11.Font = new System.Drawing.Font("微软雅黑", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel11.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel11.Location = new System.Drawing.Point(241, 482);
+            this.skinLabel11.Name = "skinLabel11";
+            this.skinLabel11.Size = new System.Drawing.Size(86, 46);
+            this.skinLabel11.TabIndex = 18;
+            this.skinLabel11.Text = "100";
+            // 
+            // skinLabel12
+            // 
+            this.skinLabel12.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel12.AutoSize = true;
+            this.skinLabel12.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel12.BorderColor = System.Drawing.Color.White;
+            this.skinLabel12.BorderSize = 0;
+            this.skinLabel12.Font = new System.Drawing.Font("微软雅黑", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel12.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel12.Location = new System.Drawing.Point(241, 259);
+            this.skinLabel12.Name = "skinLabel12";
+            this.skinLabel12.Size = new System.Drawing.Size(162, 46);
+            this.skinLabel12.TabIndex = 17;
+            this.skinLabel12.Text = "ABCDEF";
+            // 
+            // skinLabel13
+            // 
+            this.skinLabel13.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel13.AutoSize = true;
+            this.skinLabel13.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel13.BorderColor = System.Drawing.Color.White;
+            this.skinLabel13.BorderSize = 0;
+            this.skinLabel13.Font = new System.Drawing.Font("微软雅黑", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel13.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel13.Location = new System.Drawing.Point(848, 370);
+            this.skinLabel13.Name = "skinLabel13";
+            this.skinLabel13.Size = new System.Drawing.Size(119, 46);
+            this.skinLabel13.TabIndex = 22;
+            this.skinLabel13.Text = "100%";
+            // 
+            // skinLabel14
+            // 
+            this.skinLabel14.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel14.AutoSize = true;
+            this.skinLabel14.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel14.BorderColor = System.Drawing.Color.White;
+            this.skinLabel14.BorderSize = 0;
+            this.skinLabel14.Font = new System.Drawing.Font("微软雅黑", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel14.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel14.Location = new System.Drawing.Point(848, 482);
+            this.skinLabel14.Name = "skinLabel14";
+            this.skinLabel14.Size = new System.Drawing.Size(42, 46);
+            this.skinLabel14.TabIndex = 21;
+            this.skinLabel14.Text = "0";
+            // 
+            // skinLabel15
+            // 
+            this.skinLabel15.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.skinLabel15.AutoSize = true;
+            this.skinLabel15.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel15.BorderColor = System.Drawing.Color.White;
+            this.skinLabel15.BorderSize = 0;
+            this.skinLabel15.Font = new System.Drawing.Font("微软雅黑", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel15.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel15.Location = new System.Drawing.Point(848, 259);
+            this.skinLabel15.Name = "skinLabel15";
+            this.skinLabel15.Size = new System.Drawing.Size(119, 46);
+            this.skinLabel15.TabIndex = 20;
+            this.skinLabel15.Text = "100%";
+            // 
+            // skinLabel16
+            // 
+            this.skinLabel16.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.skinLabel16.AutoSize = true;
+            this.skinLabel16.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel16.BorderColor = System.Drawing.Color.White;
+            this.skinLabel16.BorderSize = 0;
+            this.skinLabel16.Font = new System.Drawing.Font("微软雅黑", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel16.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel16.Location = new System.Drawing.Point(973, 101);
+            this.skinLabel16.Name = "skinLabel16";
+            this.skinLabel16.Size = new System.Drawing.Size(70, 39);
+            this.skinLabel16.TabIndex = 24;
+            this.skinLabel16.Text = "S02";
+            // 
+            // skinLabel17
+            // 
+            this.skinLabel17.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.skinLabel17.AutoSize = true;
+            this.skinLabel17.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel17.BorderColor = System.Drawing.Color.White;
+            this.skinLabel17.BorderSize = 0;
+            this.skinLabel17.Font = new System.Drawing.Font("微软雅黑", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel17.ForeColor = System.Drawing.Color.Red;
+            this.skinLabel17.Location = new System.Drawing.Point(973, 45);
+            this.skinLabel17.Name = "skinLabel17";
+            this.skinLabel17.Size = new System.Drawing.Size(118, 39);
+            this.skinLabel17.TabIndex = 23;
+            this.skinLabel17.Text = "SMT01";
+            // 
+            // skinLabel18
+            // 
+            this.skinLabel18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.skinLabel18.AutoSize = true;
+            this.skinLabel18.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel18.BorderColor = System.Drawing.Color.White;
+            this.skinLabel18.Font = new System.Drawing.Font("宋体", 36F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel18.Location = new System.Drawing.Point(385, 168);
+            this.skinLabel18.Name = "skinLabel18";
+            this.skinLabel18.Size = new System.Drawing.Size(428, 48);
+            this.skinLabel18.TabIndex = 25;
+            this.skinLabel18.Text = "投入\\产出实时统计";
+            // 
+            // Process
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.Color.Black;
+            this.ClientSize = new System.Drawing.Size(1184, 687);
+            this.Controls.Add(this.skinLabel18);
+            this.Controls.Add(this.skinLabel16);
+            this.Controls.Add(this.skinLabel17);
+            this.Controls.Add(this.skinLabel13);
+            this.Controls.Add(this.skinLabel14);
+            this.Controls.Add(this.skinLabel15);
+            this.Controls.Add(this.skinLabel2);
+            this.Controls.Add(this.skinLabel11);
+            this.Controls.Add(this.skinLabel12);
+            this.Controls.Add(this.skinPictureBox1);
+            this.Controls.Add(this.skinLabel10);
+            this.Controls.Add(this.skinLabel9);
+            this.Controls.Add(this.skinLabel4);
+            this.Controls.Add(this.skinLabel5);
+            this.Controls.Add(this.skinLabel8);
+            this.Controls.Add(this.skinLabel7);
+            this.Controls.Add(this.skinLabel6);
+            this.Controls.Add(this.skinLabel3);
+            this.Controls.Add(this.Line3);
+            this.Controls.Add(this.skinLabel1);
+            this.Controls.Add(this.skinPanel7);
+            this.Controls.Add(this.Line2);
+            this.Controls.Add(this.Line1);
+            this.Controls.Add(this.BottomLine);
+            this.Controls.Add(this.TopLine);
+            this.ForeColor = System.Drawing.Color.White;
+            this.Name = "Process";
+            this.Text = "产线执行进度";
+            this.TitleColor = System.Drawing.Color.WhiteSmoke;
+            this.TitleSuitColor = true;
+            this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Process_FormClosing);
+            this.Load += new System.EventHandler(this.Process_Load);
+            this.SizeChanged += new System.EventHandler(this.Process_SizeChanged);
+            ((System.ComponentModel.ISupportInitialize)(this.skinPictureBox1)).EndInit();
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CCWin.SkinControl.SkinPanel TopLine;
+        private CCWin.SkinControl.SkinPanel BottomLine;
+        private CCWin.SkinControl.SkinPanel Line1;
+        private CCWin.SkinControl.SkinPanel Line2;
+        private CCWin.SkinControl.SkinPanel skinPanel7;
+        private CCWin.SkinControl.SkinLabel skinLabel1;
+        private CCWin.SkinControl.SkinPanel Line3;
+        private CCWin.SkinControl.SkinLabel skinLabel3;
+        private CCWin.SkinControl.SkinLabel skinLabel6;
+        private CCWin.SkinControl.SkinLabel skinLabel7;
+        private CCWin.SkinControl.SkinLabel skinLabel4;
+        private CCWin.SkinControl.SkinLabel skinLabel5;
+        private CCWin.SkinControl.SkinLabel skinLabel8;
+        private CCWin.SkinControl.SkinLabel skinLabel9;
+        private CCWin.SkinControl.SkinLabel skinLabel10;
+        private CCWin.SkinControl.SkinPictureBox skinPictureBox1;
+        private CCWin.SkinControl.SkinLabel skinLabel2;
+        private CCWin.SkinControl.SkinLabel skinLabel11;
+        private CCWin.SkinControl.SkinLabel skinLabel12;
+        private CCWin.SkinControl.SkinLabel skinLabel13;
+        private CCWin.SkinControl.SkinLabel skinLabel14;
+        private CCWin.SkinControl.SkinLabel skinLabel15;
+        private CCWin.SkinControl.SkinLabel skinLabel16;
+        private CCWin.SkinControl.SkinLabel skinLabel17;
+        private CCWin.SkinControl.SkinLabel skinLabel18;
+        private System.Windows.Forms.Timer Refresh;
+    }
+}

+ 57 - 0
UAS_KanBan/Process.cs

@@ -0,0 +1,57 @@
+using CCWin;
+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;
+
+namespace UAS_KanBan
+{
+    public partial class Process : CCSkinMain
+    {
+
+        AutoSizeFormClass asc = new AutoSizeFormClass();
+
+        DataHelper dh = new DataHelper();
+
+        string Linecode;
+
+        string Wccode;
+
+        public Process(string LineCode,string WcCode)
+        {
+            InitializeComponent();
+            Linecode = LineCode;
+            Wccode = WcCode;
+        }
+
+        private void Process_Load(object sender, EventArgs e)
+        {
+            asc.controllInitializeSize(this);
+            Refresh.Tick += Refresh_Tick;
+            Refresh.Interval = Setting.RefreshRate * 1000;
+            Refresh.Start();
+        }
+
+        private void Refresh_Tick(object sender, EventArgs e)
+        {
+            dh.ExecuteSql("select KBI_LINE_ZTL('"+Linecode+"','"+Wccode+"') from dual", "select");
+        }
+
+        private void Process_SizeChanged(object sender, EventArgs e)
+        {
+            asc.controlAutoSize(this);
+            Line1.Size = new Size(2, BottomLine.Location.Y - TopLine.Location.Y);
+            Line2.Size = new Size(2, BottomLine.Location.Y - TopLine.Location.Y);
+            Line3.Size = new Size(2, BottomLine.Location.Y - TopLine.Location.Y);
+        }
+
+        private void Process_FormClosing(object sender, FormClosingEventArgs e) 
+        {
+            Refresh.Stop();
+        }
+    }
+}

+ 123 - 0
UAS_KanBan/Process.resx

@@ -0,0 +1,123 @@
+<?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>
+  <metadata name="Refresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
+</root>

+ 19 - 0
UAS_KanBan/Program.cs

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

+ 36 - 0
UAS_KanBan/Properties/AssemblyInfo.cs

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

+ 73 - 0
UAS_KanBan/Properties/Resources.Designer.cs

@@ -0,0 +1,73 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace UAS_KanBan.Properties {
+    using System;
+    
+    
+    /// <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 (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("UAS_KanBan.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;
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap malata_logo {
+            get {
+                object obj = ResourceManager.GetObject("malata_logo", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+    }
+}

+ 124 - 0
UAS_KanBan/Properties/Resources.resx

@@ -0,0 +1,124 @@
+<?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.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="malata_logo" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\malata_logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+</root>

+ 40 - 0
UAS_KanBan/Properties/Settings.Designer.cs

@@ -0,0 +1,40 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace UAS_KanBan.Properties {
+    
+    
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.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;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_" +
+            "LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SER" +
+            "VER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+            set {
+                this["MES"] = value;
+            }
+        }
+    }
+}

+ 9 - 0
UAS_KanBan/Properties/Settings.settings

@@ -0,0 +1,9 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UAS_KanBan.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="MES" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+    </Setting>
+  </Settings>
+</SettingsFile>

BIN
UAS_KanBan/Resources/malata_logo.png


+ 321 - 0
UAS_KanBan/Setting.Designer.cs

@@ -0,0 +1,321 @@
+namespace UAS_KanBan
+{
+    partial class Setting
+    {
+        /// <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.components = new System.ComponentModel.Container();
+            this.WorkCenter_Label = new CCWin.SkinControl.SkinLabel();
+            this.Line_Label = new CCWin.SkinControl.SkinLabel();
+            this.Span_Label = new CCWin.SkinControl.SkinLabel();
+            this.WorkCenter = new CCWin.SkinControl.SkinComboBox();
+            this.Line = new CCWin.SkinControl.SkinComboBox();
+            this.Span = new CCWin.SkinControl.SkinComboBox();
+            this.skinLabel4 = new CCWin.SkinControl.SkinLabel();
+            this.skinLabel5 = new CCWin.SkinControl.SkinLabel();
+            this.skinRadioButton1 = new CCWin.SkinControl.SkinRadioButton();
+            this.skinRadioButton2 = new CCWin.SkinControl.SkinRadioButton();
+            this.skinLabel6 = new CCWin.SkinControl.SkinLabel();
+            this.TimeSpan = new CCWin.SkinControl.SkinTextBox();
+            this.MasterCombo_Label = new CCWin.SkinControl.SkinLabel();
+            this.MasterCombo = new CCWin.SkinControl.SkinComboBox();
+            this.Start = new CCWin.SkinControl.SkinButton();
+            this.SuspendLayout();
+            // 
+            // WorkCenter_Label
+            // 
+            this.WorkCenter_Label.AutoSize = true;
+            this.WorkCenter_Label.BackColor = System.Drawing.Color.Transparent;
+            this.WorkCenter_Label.BorderColor = System.Drawing.Color.White;
+            this.WorkCenter_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.WorkCenter_Label.Location = new System.Drawing.Point(35, 108);
+            this.WorkCenter_Label.Name = "WorkCenter_Label";
+            this.WorkCenter_Label.Size = new System.Drawing.Size(37, 19);
+            this.WorkCenter_Label.TabIndex = 1;
+            this.WorkCenter_Label.Text = "车间";
+            // 
+            // Line_Label
+            // 
+            this.Line_Label.AutoSize = true;
+            this.Line_Label.BackColor = System.Drawing.Color.Transparent;
+            this.Line_Label.BorderColor = System.Drawing.Color.White;
+            this.Line_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Line_Label.Location = new System.Drawing.Point(255, 108);
+            this.Line_Label.Name = "Line_Label";
+            this.Line_Label.Size = new System.Drawing.Size(37, 19);
+            this.Line_Label.TabIndex = 2;
+            this.Line_Label.Text = "产线";
+            // 
+            // Span_Label
+            // 
+            this.Span_Label.AutoSize = true;
+            this.Span_Label.BackColor = System.Drawing.Color.Transparent;
+            this.Span_Label.BorderColor = System.Drawing.Color.White;
+            this.Span_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Span_Label.Location = new System.Drawing.Point(447, 108);
+            this.Span_Label.Name = "Span_Label";
+            this.Span_Label.Size = new System.Drawing.Size(37, 19);
+            this.Span_Label.TabIndex = 3;
+            this.Span_Label.Text = "期间";
+            // 
+            // WorkCenter
+            // 
+            this.WorkCenter.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.WorkCenter.FormattingEnabled = true;
+            this.WorkCenter.Location = new System.Drawing.Point(103, 107);
+            this.WorkCenter.Name = "WorkCenter";
+            this.WorkCenter.Size = new System.Drawing.Size(125, 22);
+            this.WorkCenter.TabIndex = 4;
+            this.WorkCenter.WaterText = "";
+            this.WorkCenter.SelectedIndexChanged += new System.EventHandler(this.WorkCenter_SelectedIndexChanged);
+            // 
+            // Line
+            // 
+            this.Line.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.Line.FormattingEnabled = true;
+            this.Line.Location = new System.Drawing.Point(298, 107);
+            this.Line.Name = "Line";
+            this.Line.Size = new System.Drawing.Size(125, 22);
+            this.Line.TabIndex = 5;
+            this.Line.WaterText = "";
+            // 
+            // Span
+            // 
+            this.Span.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.Span.FormattingEnabled = true;
+            this.Span.Location = new System.Drawing.Point(490, 107);
+            this.Span.Name = "Span";
+            this.Span.Size = new System.Drawing.Size(125, 22);
+            this.Span.TabIndex = 6;
+            this.Span.WaterText = "";
+            // 
+            // skinLabel4
+            // 
+            this.skinLabel4.AutoSize = true;
+            this.skinLabel4.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel4.BorderColor = System.Drawing.Color.White;
+            this.skinLabel4.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel4.Location = new System.Drawing.Point(35, 168);
+            this.skinLabel4.Name = "skinLabel4";
+            this.skinLabel4.Size = new System.Drawing.Size(65, 19);
+            this.skinLabel4.TabIndex = 7;
+            this.skinLabel4.Text = "刷新频率";
+            // 
+            // skinLabel5
+            // 
+            this.skinLabel5.AutoSize = true;
+            this.skinLabel5.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel5.BorderColor = System.Drawing.Color.White;
+            this.skinLabel5.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel5.Location = new System.Drawing.Point(35, 226);
+            this.skinLabel5.Name = "skinLabel5";
+            this.skinLabel5.Size = new System.Drawing.Size(65, 19);
+            this.skinLabel5.TabIndex = 9;
+            this.skinLabel5.Text = "刷新频率";
+            // 
+            // skinRadioButton1
+            // 
+            this.skinRadioButton1.AutoSize = true;
+            this.skinRadioButton1.BackColor = System.Drawing.Color.Transparent;
+            this.skinRadioButton1.Checked = true;
+            this.skinRadioButton1.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.skinRadioButton1.DownBack = null;
+            this.skinRadioButton1.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinRadioButton1.Location = new System.Drawing.Point(79, 265);
+            this.skinRadioButton1.MouseBack = null;
+            this.skinRadioButton1.Name = "skinRadioButton1";
+            this.skinRadioButton1.NormlBack = null;
+            this.skinRadioButton1.SelectedDownBack = null;
+            this.skinRadioButton1.SelectedMouseBack = null;
+            this.skinRadioButton1.SelectedNormlBack = null;
+            this.skinRadioButton1.Size = new System.Drawing.Size(111, 23);
+            this.skinRadioButton1.TabIndex = 10;
+            this.skinRadioButton1.TabStop = true;
+            this.skinRadioButton1.Text = "产线执行进度";
+            this.skinRadioButton1.UseVisualStyleBackColor = false;
+            // 
+            // skinRadioButton2
+            // 
+            this.skinRadioButton2.AutoSize = true;
+            this.skinRadioButton2.BackColor = System.Drawing.Color.Transparent;
+            this.skinRadioButton2.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.skinRadioButton2.DownBack = null;
+            this.skinRadioButton2.Enabled = false;
+            this.skinRadioButton2.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinRadioButton2.Location = new System.Drawing.Point(238, 265);
+            this.skinRadioButton2.MouseBack = null;
+            this.skinRadioButton2.Name = "skinRadioButton2";
+            this.skinRadioButton2.NormlBack = null;
+            this.skinRadioButton2.SelectedDownBack = null;
+            this.skinRadioButton2.SelectedMouseBack = null;
+            this.skinRadioButton2.SelectedNormlBack = null;
+            this.skinRadioButton2.Size = new System.Drawing.Size(111, 23);
+            this.skinRadioButton2.TabIndex = 11;
+            this.skinRadioButton2.Text = "车间综合管理";
+            this.skinRadioButton2.UseVisualStyleBackColor = false;
+            // 
+            // skinLabel6
+            // 
+            this.skinLabel6.AutoSize = true;
+            this.skinLabel6.BackColor = System.Drawing.Color.Transparent;
+            this.skinLabel6.BorderColor = System.Drawing.Color.White;
+            this.skinLabel6.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.skinLabel6.Location = new System.Drawing.Point(234, 168);
+            this.skinLabel6.Name = "skinLabel6";
+            this.skinLabel6.Size = new System.Drawing.Size(23, 19);
+            this.skinLabel6.TabIndex = 12;
+            this.skinLabel6.Text = "秒";
+            // 
+            // TimeSpan
+            // 
+            this.TimeSpan.BackColor = System.Drawing.Color.Transparent;
+            this.TimeSpan.DownBack = null;
+            this.TimeSpan.Icon = null;
+            this.TimeSpan.IconIsButton = false;
+            this.TimeSpan.IconMouseState = CCWin.SkinClass.ControlState.Normal;
+            this.TimeSpan.IsPasswordChat = '\0';
+            this.TimeSpan.IsSystemPasswordChar = false;
+            this.TimeSpan.Lines = new string[0];
+            this.TimeSpan.Location = new System.Drawing.Point(103, 164);
+            this.TimeSpan.Margin = new System.Windows.Forms.Padding(0);
+            this.TimeSpan.MaxLength = 32767;
+            this.TimeSpan.MinimumSize = new System.Drawing.Size(28, 28);
+            this.TimeSpan.MouseBack = null;
+            this.TimeSpan.MouseState = CCWin.SkinClass.ControlState.Normal;
+            this.TimeSpan.Multiline = false;
+            this.TimeSpan.Name = "TimeSpan";
+            this.TimeSpan.NormlBack = null;
+            this.TimeSpan.Padding = new System.Windows.Forms.Padding(5);
+            this.TimeSpan.ReadOnly = false;
+            this.TimeSpan.ScrollBars = System.Windows.Forms.ScrollBars.None;
+            this.TimeSpan.Size = new System.Drawing.Size(125, 28);
+            // 
+            // 
+            // 
+            this.TimeSpan.SkinTxt.BorderStyle = System.Windows.Forms.BorderStyle.None;
+            this.TimeSpan.SkinTxt.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.TimeSpan.SkinTxt.Font = new System.Drawing.Font("微软雅黑", 9.75F);
+            this.TimeSpan.SkinTxt.Location = new System.Drawing.Point(5, 5);
+            this.TimeSpan.SkinTxt.Name = "BaseText";
+            this.TimeSpan.SkinTxt.Size = new System.Drawing.Size(115, 18);
+            this.TimeSpan.SkinTxt.TabIndex = 0;
+            this.TimeSpan.SkinTxt.WaterColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(127)))), ((int)(((byte)(127)))));
+            this.TimeSpan.SkinTxt.WaterText = "";
+            this.TimeSpan.TabIndex = 13;
+            this.TimeSpan.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
+            this.TimeSpan.WaterColor = System.Drawing.Color.FromArgb(((int)(((byte)(127)))), ((int)(((byte)(127)))), ((int)(((byte)(127)))));
+            this.TimeSpan.WaterText = "";
+            this.TimeSpan.WordWrap = true;
+            // 
+            // MasterCombo_Label
+            // 
+            this.MasterCombo_Label.AutoSize = true;
+            this.MasterCombo_Label.BackColor = System.Drawing.Color.Transparent;
+            this.MasterCombo_Label.BorderColor = System.Drawing.Color.White;
+            this.MasterCombo_Label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.MasterCombo_Label.Location = new System.Drawing.Point(32, 54);
+            this.MasterCombo_Label.Name = "MasterCombo_Label";
+            this.MasterCombo_Label.Size = new System.Drawing.Size(37, 19);
+            this.MasterCombo_Label.TabIndex = 14;
+            this.MasterCombo_Label.Text = "账套";
+            // 
+            // MasterCombo
+            // 
+            this.MasterCombo.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
+            this.MasterCombo.FormattingEnabled = true;
+            this.MasterCombo.Location = new System.Drawing.Point(100, 51);
+            this.MasterCombo.Name = "MasterCombo";
+            this.MasterCombo.Size = new System.Drawing.Size(128, 22);
+            this.MasterCombo.TabIndex = 15;
+            this.MasterCombo.WaterText = "";
+            this.MasterCombo.SelectedIndexChanged += new System.EventHandler(this.MasterCombo_SelectedIndexChanged);
+            // 
+            // Start
+            // 
+            this.Start.BackColor = System.Drawing.Color.Transparent;
+            this.Start.ControlState = CCWin.SkinClass.ControlState.Normal;
+            this.Start.DownBack = null;
+            this.Start.Location = new System.Drawing.Point(298, 338);
+            this.Start.MouseBack = null;
+            this.Start.Name = "Start";
+            this.Start.NormlBack = null;
+            this.Start.Size = new System.Drawing.Size(75, 23);
+            this.Start.TabIndex = 16;
+            this.Start.Text = "运行";
+            this.Start.UseVisualStyleBackColor = false;
+            this.Start.Click += new System.EventHandler(this.Start_Click);
+            // 
+            // Setting
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.BackColor = System.Drawing.SystemColors.Menu;
+            this.ClientSize = new System.Drawing.Size(677, 401);
+            this.Controls.Add(this.Start);
+            this.Controls.Add(this.MasterCombo);
+            this.Controls.Add(this.MasterCombo_Label);
+            this.Controls.Add(this.TimeSpan);
+            this.Controls.Add(this.skinLabel6);
+            this.Controls.Add(this.skinRadioButton2);
+            this.Controls.Add(this.skinRadioButton1);
+            this.Controls.Add(this.skinLabel5);
+            this.Controls.Add(this.skinLabel4);
+            this.Controls.Add(this.Span);
+            this.Controls.Add(this.Line);
+            this.Controls.Add(this.WorkCenter);
+            this.Controls.Add(this.Span_Label);
+            this.Controls.Add(this.Line_Label);
+            this.Controls.Add(this.WorkCenter_Label);
+            this.MaximizeBox = false;
+            this.Name = "Setting";
+            this.Text = "看板设置";
+            this.Load += new System.EventHandler(this.Setting_Load);
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private CCWin.SkinControl.SkinLabel WorkCenter_Label;
+        private CCWin.SkinControl.SkinLabel Line_Label;
+        private CCWin.SkinControl.SkinLabel Span_Label;
+        private CCWin.SkinControl.SkinComboBox WorkCenter;
+        private CCWin.SkinControl.SkinComboBox Line;
+        private CCWin.SkinControl.SkinComboBox Span;
+        private CCWin.SkinControl.SkinLabel skinLabel4;
+        private CCWin.SkinControl.SkinLabel skinLabel5;
+        private CCWin.SkinControl.SkinRadioButton skinRadioButton1;
+        private CCWin.SkinControl.SkinRadioButton skinRadioButton2;
+        private CCWin.SkinControl.SkinLabel skinLabel6;
+        private CCWin.SkinControl.SkinTextBox TimeSpan;
+        private CCWin.SkinControl.SkinLabel MasterCombo_Label;
+        private CCWin.SkinControl.SkinComboBox MasterCombo;
+        private CCWin.SkinControl.SkinButton Start;
+    }
+}
+

+ 77 - 0
UAS_KanBan/Setting.cs

@@ -0,0 +1,77 @@
+using CCWin;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using CCWin.SkinControl;
+
+namespace UAS_KanBan
+{
+    public partial class Setting : CCSkinMain
+    {
+
+        DataHelper dh = new DataHelper();
+
+        DataTable dt;
+
+        public static int RefreshRate = 0;
+
+        public Setting()
+        {
+            InitializeComponent();
+        }
+
+        private void Setting_Load(object sender, EventArgs e)
+        {
+            MasterCombo.DisplayMember = "ma_user";
+            MasterCombo.ValueMember = "ma_user";
+            dt =(DataTable) dh.ExecuteSql("select ms_pwd,ma_user,ma_address from master", "select");
+            MasterCombo.DataSource = dt;
+        }
+
+        private void Start_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                RefreshRate = int.Parse(TimeSpan.Text);
+            }
+            catch (Exception)
+            {
+                MessageBox.Show("刷新时间必须是正整数");
+                return;
+            }
+            Hide();
+            Process pr = new Process(Line.SelectedValue.ToString(),WorkCenter.SelectedValue.ToString());
+            pr.ShowDialog();
+            Close();
+        }
+
+        private void WorkCenter_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            Line.DisplayMember = "li_name";
+            Line.ValueMember = "li_code";
+            Line.DataSource = dh.ExecuteSql("select li_code,li_name from line where li_wccode='"+WorkCenter.SelectedValue.ToString()+"'", "select");
+        }
+
+        private void MasterCombo_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (MasterCombo.SelectedValue.ToString() == dt.Rows[i]["ma_user"].ToString())
+                {
+                    DataHelper.DBConnectionString = "Data Source=" + dt.Rows[i]["ma_address"] + ";User ID=" + dt.Rows[i]["ma_user"] + ";PassWord=" + dt.Rows[i]["ms_pwd"];
+                    //重新执行一遍构造函数使得重置之后的链接字符串生效
+                    dh = new DataHelper();
+                }
+            }
+            WorkCenter.DisplayMember = "wc_name";
+            WorkCenter.ValueMember = "wc_code";
+            WorkCenter.DataSource = dh.ExecuteSql("select wc_code,wc_name from workcenter", "select");
+        }
+    }
+}

+ 120 - 0
UAS_KanBan/Setting.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>

+ 155 - 0
UAS_KanBan/UAS_KanBan.csproj

@@ -0,0 +1,155 @@
+<?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>{13FB3DAF-E684-4B04-9F35-710F925A64C3}</ProjectGuid>
+    <OutputType>WinExe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>UAS_KanBan</RootNamespace>
+    <AssemblyName>UAS_KanBan</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
+    <TargetFrameworkProfile />
+    <IsWebBootstrapper>true</IsWebBootstrapper>
+    <PublishUrl>ftp://192.168.253.9/MESSetting/Xml/</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Web</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <InstallUrl>http://218.17.158.219:8888/Xml/</InstallUrl>
+    <ProductName>XML解析器</ProductName>
+    <PublisherName>深圳市优软科技有限公司</PublisherName>
+    <SuiteName>XML解析器</SuiteName>
+    <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
+    <WebPage>publish.htm</WebPage>
+    <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
+    <ApplicationRevision>4</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <PublishWizardCompleted>true</PublishWizardCompleted>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+  </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>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>911D66F74235D00A4F790AB74409F1B112717490</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>UAS_KanBan_TemporaryKey.pfx</ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <GenerateManifests>true</GenerateManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignManifests>true</SignManifests>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="CSkin">
+      <HintPath>tool\CSkin.dll</HintPath>
+    </Reference>
+    <Reference Include="Oracle.ManagedDataAccess">
+      <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
+    </Reference>
+    <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="AutoSizeFormClass.cs" />
+    <Compile Include="DataHelper.cs" />
+    <Compile Include="Process.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Process.Designer.cs">
+      <DependentUpon>Process.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Setting.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Setting.Designer.cs">
+      <DependentUpon>Setting.cs</DependentUpon>
+    </Compile>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <EmbeddedResource Include="Process.resx">
+      <DependentUpon>Process.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="Setting.resx">
+      <DependentUpon>Setting.cs</DependentUpon>
+    </EmbeddedResource>
+    <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>
+      <DesignTime>True</DesignTime>
+    </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>
+    <None Include="UAS_KanBan_TemporaryKey.pfx" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="App.config" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\malata_logo.png" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

BIN
UAS_KanBan/tool/CSkin.dll


BIN
UAS_KanBan/tool/Oracle.ManagedDataAccess.dll


+ 13 - 1
UAS_WinForm.sln

@@ -1,7 +1,7 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.24720.0
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-MES接口", "MES接口\UAS-MES接口.csproj", "{A52EFE9C-838E-4E8C-BAAA-B1C226E57A81}"
 EndProject
@@ -13,6 +13,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "TestProject\
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-特殊解析规则", "UAS-特殊解析规则\UAS-特殊解析规则.csproj", "{7D199649-095F-4280-BD82-9481BCAB85B4}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_XmlAnalysor", "UAS_XmlAnalysor\UAS_XmlAnalysor.csproj", "{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS_KanBan", "UAS_KanBan\UAS_KanBan.csproj", "{13FB3DAF-E684-4B04-9F35-710F925A64C3}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -39,6 +43,14 @@ Global
 		{7D199649-095F-4280-BD82-9481BCAB85B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{7D199649-095F-4280-BD82-9481BCAB85B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{7D199649-095F-4280-BD82-9481BCAB85B4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{7767BBB5-6E7E-4687-A9D6-6C6E9B6F4EA3}.Release|Any CPU.Build.0 = Release|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{13FB3DAF-E684-4B04-9F35-710F925A64C3}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 18 - 0
UAS_XmlAnalysor/App.config

@@ -1,6 +1,24 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
+    <configSections>
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+            <section name="UAS_XmlAnalysor.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
+        </sectionGroup>
+    </configSections>
     <startup> 
         <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
     </startup>
+    <userSettings>
+        <UAS_XmlAnalysor.Properties.Settings>
+            <setting name="MES" serializeAs="String">
+                <value>Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+            </setting>
+            <setting name="FolderPath" serializeAs="String">
+                <value />
+            </setting>
+            <setting name="BackUpFolderPath" serializeAs="String">
+                <value />
+            </setting>
+        </UAS_XmlAnalysor.Properties.Settings>
+    </userSettings>
 </configuration>

+ 266 - 63
UAS_XmlAnalysor/DataHelper.cs

@@ -26,18 +26,12 @@ namespace UAS_XmlAnalysor
             {
                 //如果选择的是默认数据则直接用配置文件的信息连接,否则选择数据库的账套信息
                 if (DBConnectionString == null || DBConnectionString == ConnectionStrings)
-                {
                     connection = new OracleConnection(ConnectionStrings);
-                }
                 else
-                {
                     connection = new OracleConnection(DBConnectionString);
-                }
                 connection.Open();
-                command = new OracleCommand();
-                command.Connection = connection;
             }
-            catch (Exception ) {  }
+            catch (Exception e) { }
         }
 
         /// <summary>
@@ -46,12 +40,12 @@ namespace UAS_XmlAnalysor
         public DataTable GetColumnDataType(string TableName)
         {
             DataTable dt = new DataTable();
-            command.CommandText = "select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')";
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand("select Column_Name,Data_Type from cols where TABLE_name=upper('" + TableName + "')", connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return dt;
         }
 
@@ -62,13 +56,14 @@ namespace UAS_XmlAnalysor
         {
             DataTable dt = new DataTable();
             string sql = "select " + Field + " from " + TableName + " where " + Condition;
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             if (dt.Rows.Count > 0)
             {
                 return dt.Rows[0][0];
@@ -79,6 +74,7 @@ namespace UAS_XmlAnalysor
             }
         }
 
+
         /// <summary>
         /// 执行打印的SQL
         /// </summary>
@@ -98,17 +94,18 @@ namespace UAS_XmlAnalysor
                 {
                     sb.Append(Param[i] + ":Param" + i);
                 }
-                command.CommandText = sb.ToString();
-                command.CommandType = CommandType.Text;
+                command = new OracleCommand(sb.ToString(), connection);
+
                 for (int i = 0; i < ParamNum; i++)
                 {
                     command.Parameters.Add("Param" + i, OracleDbType.Varchar2, Parameters[i], ParameterDirection.Input);
                 }
+
                 OracleDataAdapter ad = new OracleDataAdapter(command);
                 DataTable dt = new DataTable();
                 ad.Fill(dt);
                 ad.Dispose();
-                command.Parameters.Clear();
+                command.Dispose();
                 return dt;
             }
             return "参数错误,请检查SQL语句";
@@ -122,12 +119,13 @@ namespace UAS_XmlAnalysor
         {
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName + " where " + Condition;
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString());
         }
 
@@ -140,12 +138,13 @@ namespace UAS_XmlAnalysor
         {
             DataTable dt = new DataTable();
             string sql = "select count(1) from " + TableName;
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
+
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString());
         }
 
@@ -158,15 +157,32 @@ namespace UAS_XmlAnalysor
             string sql = "select ";
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition + " and rownum=1";
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return dt;
         }
 
+        /// <summary>
+        /// 将DataTable导入到指定的表中
+        /// </summary>
+        /// <param name="DataTable"></param>
+        /// <param name="TableName"></param>
+        public void InsertDataTable(DataTable DataTable, string TableName)
+        {
+            for (int i = 0; i < DataTable.Rows.Count; i++)
+            {
+                for (int j = 0; j < DataTable.Columns.Count; j++)
+                {
+
+                }
+            }
+        }
+
         /// <summary>
         /// 按分页获取数据
         /// </summary>
@@ -195,12 +211,12 @@ namespace UAS_XmlAnalysor
                 else
                     sql.Append(" from " + TableName + ") A where ROWNUM <= " + CurrentPage * PageSize + ") where RN> " + (CurrentPage - 1) * PageSize);
             }
-            command.CommandText = sql.ToString();
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql.ToString(), connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             dt.Columns.RemoveAt(0);
             foreach (DataColumn dc in dt.Columns)
             {
@@ -219,12 +235,13 @@ namespace UAS_XmlAnalysor
             string sql = "select ";
             sql += AddField(Fields);
             sql += " from " + TableName + " where " + Condition;
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return dt;
         }
 
@@ -237,8 +254,7 @@ namespace UAS_XmlAnalysor
             string sql = "select ";
             sql += Fields;
             sql += " from " + TableName;
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.SelectCommand = command;
@@ -248,6 +264,7 @@ namespace UAS_XmlAnalysor
                 dc.Caption = "测试测试";
             }
             ad.Dispose();
+            command.Dispose();
             return dt;
         }
 
@@ -326,6 +343,7 @@ namespace UAS_XmlAnalysor
             //不是新增行的启用更新的方法
             sb.Append("update " + TableName + " set ");
             //拼接语句,特殊处理日期
+
             foreach (DataColumn dc in DataTable.Columns)
             {
                 if (!dc.DataType.ToString().Equals("System.DateTime"))
@@ -339,8 +357,7 @@ namespace UAS_XmlAnalysor
             }
             sb.Remove(sb.Length - 1, 1);
             sb.Append(" where " + PrimaryKey + "=:" + PrimaryKey);
-            command.CommandText = sb.ToString();
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sb.ToString(), connection);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             // 参数的长度是DataTable的行数决定的
             command.ArrayBindCount = DataTable.Rows.Count;
@@ -369,7 +386,169 @@ namespace UAS_XmlAnalysor
             ad.UpdateCommand = command;
             ad.Update(DataTable);
             ad.Dispose();
-            command.Parameters.Clear();
+            command.Dispose();
+        }
+
+        /// <summary>
+        /// 获取DbFind的数据的DataTable的结构
+        /// </summary>
+        /// <param name="field"></param>
+        /// <param name="caller"></param>
+        /// <returns></returns>
+        public DataTable GetDbFindDataTable(string field, string caller)
+        {
+            string sql = "select * from dbfindsetui where ds_caller='" + caller + "' and ds_whichui='" + field + "'";
+            DataTable dt = (DataTable)ExecuteSql(sql, "select");
+            if (dt.Rows.Count != 0)
+            {
+                //通过#号分割字段
+                string[] dbfield = dt.Rows[0]["ds_findtoui"].ToString().Split('#');
+                string[] cnfield = dt.Rows[0]["ds_dbcaption"].ToString().Split('#');
+                //获取查询要查询的Table
+                string dbtable = dt.Rows[0]["ds_tables"].ToString();
+                //拼接查询的字段
+                for (int i = 0; i < dbfield.Length; i++)
+                {
+                    dbfield[i] = dbfield[i].Split(',')[0];
+                }
+                //新建一个空的DataTable
+                DataTable dt1 = new DataTable();
+                //往空的DataTable添加结构,ColumnName是中文,Caption是实际的字段名称
+                for (int i = 0; i < cnfield.Length; i++)
+                {
+                    dt1.Columns.Add(cnfield[i]);
+                    dt1.Columns[i].Caption = dbfield[i];
+                }
+                //返回一个带有结构的空的DataTable
+                //DbFind.BindTable1 = dbtable;
+                return dt1;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        ///  获取配置列表中的数据,支持DaatList,Form,DetailGrid
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <param name="Type"></param>
+        /// <param name="condition"></param>
+        /// <returns></returns>
+        public DataTable GetConfigureData(string Caller, string Type, string condition)
+        {
+            DataTable dt = new DataTable();
+            //用于拼接SQL语句
+            StringBuilder Sql = new StringBuilder();
+            //用于设置不同Type时设置对应表的字段
+            string getField = "";
+            string getCaption = "";
+            string getTable = "";
+            switch (Type.ToUpper())
+            {
+                case "DATALIST":
+                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
+                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
+                    break;
+                case "FORM":
+                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
+                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
+                    break;
+                case "DETAILGRID":
+                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
+                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
+                    break;
+            }
+            command = new OracleCommand(Sql.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            //清除掉之前的内容重新拼接
+            Sql.Clear();
+            Sql.Append("select ");
+            string[] field = new string[dt.Rows.Count];
+            string[] caption = new string[dt.Rows.Count];
+            DataTable dt1 = new DataTable();
+            //记录描述和字段名称
+            foreach (DataRow dr in dt.Rows)
+            {
+                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
+                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
+                Sql.Append(dr[getField] + ",");
+            }
+            //调用substring是为了去除之前拼接多出来的一个逗号
+            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable] + " where " + condition;
+            //调用一个新的构造DataTable用来存放返回的数据
+            dt1 = (DataTable)ExecuteSql(sql, "select");
+            //给DataTable加上列名和描述,列名是中文字段,描述是数据库实际的字段名称
+            for (int i = 0; i < field.Length; i++)
+            {
+                dt1.Columns[i].ColumnName = field[i];
+                dt1.Columns[i].Caption = caption[i];
+            }
+            //返回的第一条数据是SQL,后面的是实际的列名
+            ad.Dispose();
+            command.Dispose();
+            return dt1;
+        }
+
+        /// <summary>
+        /// 查询配置的字段,Type是查询DataList,Form还是DetailGrid
+        /// </summary>
+        /// <param name="Caller"></param>
+        /// <param name="Type"></param>
+        /// <returns></returns>
+        public DataTable GetConfigureData(string Caller, string Type)
+        {
+            DataTable dt = new DataTable();
+            //用于拼接SQL语句
+            StringBuilder Sql = new StringBuilder();
+            //用于设置不同Type时设置对应表的字段
+            string getField = "";
+            string getCaption = "";
+            string getTable = "";
+            switch (Type.ToUpper())
+            {
+                case "DATALIST":
+                    getField = "dld_field"; getCaption = "dld_caption"; getTable = "dld_table";
+                    Sql.Append("select * from datalistdetail where dld_caller='" + Caller + "'");
+                    break;
+                case "FORM":
+                    getField = "fd_field"; getCaption = "fd_caption"; getTable = "fd_table";
+                    Sql.Append("select * from formdetail where fd_foid=( select fo_id from form where fo_caller='" + Caller + "')");
+                    break;
+                case "DETAILGRID":
+                    getField = "dg_field"; getCaption = "dg_caption"; getTable = "dg_table";
+                    Sql.Append("select * from detailgrid  where dg_caller='" + Caller + "'");
+                    break;
+            }
+            command = new OracleCommand(Sql.ToString(), connection);
+            OracleDataAdapter ad = new OracleDataAdapter(command);
+            ad.Fill(dt);
+            //清除掉之前的内容重新拼接
+            Sql.Clear();
+            Sql.Append("select ");
+            //用于记录实际的列名,+1的目的是为了存放SQL
+            string[] field = new string[dt.Rows.Count];
+            string[] caption = new string[dt.Rows.Count];
+            DataTable dt1 = new DataTable();
+            foreach (DataRow dr in dt.Rows)
+            {
+                field[dt.Rows.IndexOf(dr)] = dr[getCaption].ToString();
+                caption[dt.Rows.IndexOf(dr)] = dr[getField].ToString();
+                Sql.Append(dr[getField] + ",");
+            }
+            string sql = Sql.Remove(Sql.Length - 1, 1).ToString() + " from " + dt.Rows[0][getTable];
+            dt1 = (DataTable)ExecuteSql(sql, "select");
+            //设置DataTable的列名和描述
+            for (int i = 0; i < field.Length; i++)
+            {
+                dt1.Columns[i].ColumnName = field[i];
+                dt1.Columns[i].Caption = caption[i];
+            }
+            ad.Dispose();
+            command.Dispose();
+            return dt1;
         }
 
         /// <summary>
@@ -381,14 +560,14 @@ namespace UAS_XmlAnalysor
         public bool CheckExist(string TableName, string Condition)
         {
             string sql = "select count(1) from " + TableName + " where " + Condition;
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             DataTable dt = new DataTable();
 
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString()) > 0;
         }
 
@@ -401,8 +580,7 @@ namespace UAS_XmlAnalysor
         public object ExecuteSql(string SQL, string Type, params object[] names)
         {
             object result = null;
-            command.CommandText = SQL;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(SQL, connection);
             Reconnect(command);
             //用来拼接参数的
             if (names.Length > 0)
@@ -435,9 +613,24 @@ namespace UAS_XmlAnalysor
             {
                 case "SELECT":
                     result = new DataTable();
-                    OracleDataAdapter ad = new OracleDataAdapter(command);
-                    ad.Fill((DataTable)result);
-                    ad.Dispose();
+                    try
+                    {
+                        OracleDataAdapter ad = new OracleDataAdapter(command);
+                        ad.Fill((DataTable)result);
+                        ad.Dispose();
+                        //成功执行后将重复连接数置为0
+                        ReconnectTime = 0;
+                    }
+                    catch (Exception)
+                    {
+                        if (ReconnectTime == 0)
+                        {
+                            //重置的数据库链接后只执行一次
+                            ReconnectTime = ReconnectTime + 1;
+                            connection = new OracleConnection(DBConnectionString);
+                            result = ExecuteSql(SQL, Type, names);
+                        }
+                    }
                     break;
                 case "DELETE":
                     result = command.ExecuteNonQuery();
@@ -449,21 +642,33 @@ namespace UAS_XmlAnalysor
                     result = command.ExecuteNonQuery();
                     break;
             }
-            command.Parameters.Clear();
+            command.Dispose();
             return result;
         }
 
+        /// <summary>
+        /// 为了同步BS端的条码维护,检测时允许问号的存在,在检测时默认将问号换成:Param参数
+        /// </summary>
+        /// <param name="SQL"></param>
+        public void CheckSQL(string SQL)
+        {
+            SQL = SQL.Replace("?", ":Param");
+            command = new OracleCommand(SQL, connection);
+            command.ExecuteNonQuery();
+            command.Dispose();
+        }
+
         public int GetDistinctRowCount(string TableName, string Field)
         {
             DataTable dt = new DataTable();
             string sql = "select distinct count('" + Field + "') from " + TableName;
 
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return int.Parse(dt.Rows[0][0].ToString());
         }
 
@@ -489,13 +694,12 @@ namespace UAS_XmlAnalysor
         {
             string sql = "delete from " + TableName + " where " + ID + " =:DeleteID";
 
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             command.ArrayBindCount = DeleteID.Length;
             command.Parameters.Add(new OracleParameter("DeleteID", OracleDbType.Long, DeleteID, ParameterDirection.Input));
             command.ExecuteNonQuery();
-            command.Parameters.Clear();
+            command.Dispose();
         }
 
         /// <summary>
@@ -633,11 +837,9 @@ namespace UAS_XmlAnalysor
         /// <param name="names"></param>
         public void BatchInsert(string sql, params object[][] names)
         {
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             command.ArrayBindCount = names[1].Length;
-
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
             //将第一个数组的下标固定为0作为循环添加的参数的名称
             for (int i = 1; i <= names[0].Length; i++)
@@ -645,13 +847,12 @@ namespace UAS_XmlAnalysor
                 command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
             command.ExecuteNonQuery();
-            command.Parameters.Clear();
+            command.Dispose();
         }
 
         public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
         {
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             command.ArrayBindCount = param1[0].Length;
             //因为第一个数组保存的是参数的名称,所以循环从1而不是0开始
@@ -661,7 +862,7 @@ namespace UAS_XmlAnalysor
                 command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, param1[i], ParameterDirection.Input));
             }
             command.ExecuteNonQuery();
-            command.Parameters.Clear();
+            command.Dispose();
         }
 
 
@@ -675,12 +876,12 @@ namespace UAS_XmlAnalysor
         {
             DataTable dt = new DataTable();
             string SQL = " select listagg(dld_field,',') within group (order by dld_id)  from datalistdetail where dld_caller='" + Caller + "'";
-            command.CommandText = SQL;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(SQL, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter(command);
             ad.Fill(dt);
             ad.Dispose();
+            command.Dispose();
             return dt.Rows[0][0].ToString();
         }
 
@@ -750,10 +951,10 @@ namespace UAS_XmlAnalysor
         {
             string sql = "update " + TableName + " set " + update + " where " + condition;
 
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             command.ExecuteNonQuery();
+            command.Dispose();
             return sql;
         }
 
@@ -764,15 +965,17 @@ namespace UAS_XmlAnalysor
         /// <param name="param"></param>
         public void CallProcedure(string ProcedureName, ref string[] param)
         {
-            command.CommandText = ProcedureName;
+            command = new OracleCommand(ProcedureName);
+            command.Connection = connection;
             Reconnect(command);
+            command.CommandText = ProcedureName;
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
                 command.Parameters.Add(new OracleParameter(param[i].ToString(), OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
             command.ExecuteNonQuery();
             for (int i = 0; i < command.Parameters.Count; i++)
                 param[i] = command.Parameters[i].Value.ToString();
-            command.Parameters.Clear();
+            command.Dispose();
         }
 
         /// <summary>
@@ -782,8 +985,9 @@ namespace UAS_XmlAnalysor
         public void ExecuteSQLTran(params string[] SQL)
         {
             OracleTransaction tx = connection.BeginTransaction();
+            command = new OracleCommand();
+            command.Connection = connection;
             command.Transaction = tx;
-            command.CommandType = CommandType.Text;
             try
             {
                 foreach (string sql in SQL)
@@ -801,6 +1005,7 @@ namespace UAS_XmlAnalysor
             {
                 tx.Rollback();
             }
+            command.Dispose();
         }
 
         /// <summary>
@@ -850,8 +1055,7 @@ namespace UAS_XmlAnalysor
         public object GetLabelParam(string sql)
         {
             DataTable dt = new DataTable();
-            command.CommandText = sql;
-            command.CommandType = CommandType.Text;
+            command = new OracleCommand(sql, connection);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
@@ -859,10 +1063,12 @@ namespace UAS_XmlAnalysor
             if (dt.Rows.Count > 0)
             {
                 ad.Dispose();
+                command.Dispose();
                 return dt.Rows[0][0];
             }
             else
             {
+                command.Dispose();
                 return "";
             }
         }
@@ -878,6 +1084,7 @@ namespace UAS_XmlAnalysor
                 //新建一个char类型的数组用来存储每个字节的变量
                 char[] c = par[i + 1].ToCharArray();
                 addpar[i] = new StringBuilder();
+
                 for (int j = 0; j < c.Length; j++)
                 {
                     if (c[j] != ' ' && c[j] != ',' && c[j] != ')')
@@ -897,13 +1104,9 @@ namespace UAS_XmlAnalysor
             return param;
         }
 
-        /// <summary>
-        /// 释放资源
-        /// </summary>
         public void Dispose()
         {
-            command.Dispose();
-            connection.Dispose();
+
         }
 
         private void Reconnect(OracleCommand cmd)

+ 83 - 46
UAS_XmlAnalysor/Form1.Designer.cs

@@ -34,14 +34,15 @@
             this.StopWatch = new System.Windows.Forms.Button();
             this.label1 = new System.Windows.Forms.Label();
             this.FolderPath = new System.Windows.Forms.TextBox();
-            this.TimeSpan = new System.Windows.Forms.NumericUpDown();
-            this.label2 = new System.Windows.Forms.Label();
             this.ChooseFolder = new System.Windows.Forms.Button();
             this.OperateResult = new System.Windows.Forms.RichTextBox();
             this.Clean = new System.Windows.Forms.Button();
+            this.ChooseBackUpFolder = new System.Windows.Forms.Button();
+            this.BackUpFolderPath = new System.Windows.Forms.TextBox();
+            this.label2 = new System.Windows.Forms.Label();
             this.label3 = new System.Windows.Forms.Label();
+            this.Source = new System.Windows.Forms.TextBox();
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.TimeSpan)).BeginInit();
             this.SuspendLayout();
             // 
             // XmlWatcher
@@ -53,9 +54,10 @@
             // StartWatch
             // 
             this.StartWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StartWatch.Location = new System.Drawing.Point(193, 249);
+            this.StartWatch.Location = new System.Drawing.Point(145, 199);
+            this.StartWatch.Margin = new System.Windows.Forms.Padding(2);
             this.StartWatch.Name = "StartWatch";
-            this.StartWatch.Size = new System.Drawing.Size(85, 35);
+            this.StartWatch.Size = new System.Drawing.Size(64, 28);
             this.StartWatch.TabIndex = 0;
             this.StartWatch.Text = "开始监控";
             this.StartWatch.UseVisualStyleBackColor = true;
@@ -64,9 +66,10 @@
             // StopWatch
             // 
             this.StopWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StopWatch.Location = new System.Drawing.Point(332, 249);
+            this.StopWatch.Location = new System.Drawing.Point(249, 199);
+            this.StopWatch.Margin = new System.Windows.Forms.Padding(2);
             this.StopWatch.Name = "StopWatch";
-            this.StopWatch.Size = new System.Drawing.Size(85, 35);
+            this.StopWatch.Size = new System.Drawing.Size(64, 28);
             this.StopWatch.TabIndex = 1;
             this.StopWatch.Text = "停止监控";
             this.StopWatch.UseVisualStyleBackColor = true;
@@ -76,42 +79,29 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(36, 94);
+            this.label1.Location = new System.Drawing.Point(27, 82);
+            this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(107, 25);
+            this.label1.Size = new System.Drawing.Size(84, 20);
             this.label1.TabIndex = 2;
-            this.label1.Text = "检测文件夹";
+            this.label1.Text = "监控文件夹";
             // 
             // FolderPath
             // 
-            this.FolderPath.Location = new System.Drawing.Point(149, 94);
+            this.FolderPath.Enabled = false;
+            this.FolderPath.Location = new System.Drawing.Point(112, 82);
+            this.FolderPath.Margin = new System.Windows.Forms.Padding(2);
             this.FolderPath.Name = "FolderPath";
-            this.FolderPath.Size = new System.Drawing.Size(292, 25);
+            this.FolderPath.Size = new System.Drawing.Size(220, 21);
             this.FolderPath.TabIndex = 3;
             // 
-            // TimeSpan
-            // 
-            this.TimeSpan.Location = new System.Drawing.Point(149, 168);
-            this.TimeSpan.Name = "TimeSpan";
-            this.TimeSpan.Size = new System.Drawing.Size(292, 25);
-            this.TimeSpan.TabIndex = 4;
-            // 
-            // label2
-            // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(36, 168);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(88, 25);
-            this.label2.TabIndex = 5;
-            this.label2.Text = "时间间隔";
-            // 
             // ChooseFolder
             // 
             this.ChooseFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChooseFolder.Location = new System.Drawing.Point(462, 94);
+            this.ChooseFolder.Location = new System.Drawing.Point(346, 82);
+            this.ChooseFolder.Margin = new System.Windows.Forms.Padding(2);
             this.ChooseFolder.Name = "ChooseFolder";
-            this.ChooseFolder.Size = new System.Drawing.Size(104, 30);
+            this.ChooseFolder.Size = new System.Drawing.Size(78, 24);
             this.ChooseFolder.TabIndex = 6;
             this.ChooseFolder.Text = "选择文件夹";
             this.ChooseFolder.UseVisualStyleBackColor = true;
@@ -119,53 +109,98 @@
             // 
             // OperateResult
             // 
-            this.OperateResult.Location = new System.Drawing.Point(628, 12);
+            this.OperateResult.Location = new System.Drawing.Point(446, 10);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(2);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(228, 267);
+            this.OperateResult.Size = new System.Drawing.Size(197, 214);
             this.OperateResult.TabIndex = 7;
             this.OperateResult.Text = "";
             // 
             // Clean
             // 
             this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Clean.Location = new System.Drawing.Point(705, 288);
+            this.Clean.Location = new System.Drawing.Point(516, 230);
+            this.Clean.Margin = new System.Windows.Forms.Padding(2);
             this.Clean.Name = "Clean";
-            this.Clean.Size = new System.Drawing.Size(74, 30);
+            this.Clean.Size = new System.Drawing.Size(56, 24);
             this.Clean.TabIndex = 8;
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
             this.Clean.Click += new System.EventHandler(this.Clean_Click);
             // 
+            // ChooseBackUpFolder
+            // 
+            this.ChooseBackUpFolder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ChooseBackUpFolder.Location = new System.Drawing.Point(346, 144);
+            this.ChooseBackUpFolder.Margin = new System.Windows.Forms.Padding(2);
+            this.ChooseBackUpFolder.Name = "ChooseBackUpFolder";
+            this.ChooseBackUpFolder.Size = new System.Drawing.Size(78, 24);
+            this.ChooseBackUpFolder.TabIndex = 11;
+            this.ChooseBackUpFolder.Text = "选择文件夹";
+            this.ChooseBackUpFolder.UseVisualStyleBackColor = true;
+            this.ChooseBackUpFolder.Click += new System.EventHandler(this.ChooseBackUpFolder_Click);
+            // 
+            // BackUpFolderPath
+            // 
+            this.BackUpFolderPath.Enabled = false;
+            this.BackUpFolderPath.Location = new System.Drawing.Point(112, 144);
+            this.BackUpFolderPath.Margin = new System.Windows.Forms.Padding(2);
+            this.BackUpFolderPath.Name = "BackUpFolderPath";
+            this.BackUpFolderPath.Size = new System.Drawing.Size(220, 21);
+            this.BackUpFolderPath.TabIndex = 10;
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(27, 144);
+            this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(84, 20);
+            this.label2.TabIndex = 9;
+            this.label2.Text = "备份文件夹";
+            // 
             // label3
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(457, 168);
+            this.label3.Location = new System.Drawing.Point(27, 23);
+            this.label3.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(50, 25);
-            this.label3.TabIndex = 9;
-            this.label3.Text = "分钟";
+            this.label3.Size = new System.Drawing.Size(69, 20);
+            this.label3.TabIndex = 12;
+            this.label3.Text = "岗位资源";
+            // 
+            // Source
+            // 
+            this.Source.Location = new System.Drawing.Point(112, 22);
+            this.Source.Margin = new System.Windows.Forms.Padding(2);
+            this.Source.Name = "Source";
+            this.Source.Size = new System.Drawing.Size(220, 21);
+            this.Source.TabIndex = 13;
             // 
             // Form1
             // 
-            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(887, 324);
+            this.ClientSize = new System.Drawing.Size(665, 259);
+            this.Controls.Add(this.Source);
             this.Controls.Add(this.label3);
+            this.Controls.Add(this.ChooseBackUpFolder);
+            this.Controls.Add(this.BackUpFolderPath);
+            this.Controls.Add(this.label2);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.ChooseFolder);
-            this.Controls.Add(this.label2);
-            this.Controls.Add(this.TimeSpan);
             this.Controls.Add(this.FolderPath);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.StopWatch);
             this.Controls.Add(this.StartWatch);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Form1";
             this.Text = "测试数据监测";
             this.Load += new System.EventHandler(this.Form1_Load);
             ((System.ComponentModel.ISupportInitialize)(this.XmlWatcher)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.TimeSpan)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -179,11 +214,13 @@
         private System.Windows.Forms.Button StartWatch;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.TextBox FolderPath;
-        private System.Windows.Forms.NumericUpDown TimeSpan;
-        private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Button ChooseFolder;
         private System.Windows.Forms.RichTextBox OperateResult;
         private System.Windows.Forms.Button Clean;
+        private System.Windows.Forms.Button ChooseBackUpFolder;
+        private System.Windows.Forms.TextBox BackUpFolderPath;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox Source;
         private System.Windows.Forms.Label label3;
     }
 }

+ 59 - 7
UAS_XmlAnalysor/Form1.cs

@@ -1,4 +1,5 @@
 using System;
+using System.Collections.Generic;
 using System.IO;
 using System.Windows.Forms;
 using System.Xml;
@@ -7,17 +8,36 @@ namespace UAS_XmlAnalysor
 {
     public partial class Form1 : Form
     {
+
+        DataHelper dh = new DataHelper();
+
         public Form1()
         {
             InitializeComponent();
         }
 
+        private void Form1_Load(object sender, EventArgs e)
+        {
+            FolderPath.Text = Properties.Settings.Default.FolderPath;
+            BackUpFolderPath.Text = Properties.Settings.Default.BackUpFolderPath;
+        }
+
         private void StartWatch_Click(object sender, EventArgs e)
         {
+            if (!dh.CheckExist("source", "sc_code='" + Source.Text + "' and sc_statuscode='AUDITED'"))
+            {
+                OperateResult.AppendText("岗位资源错误或者未审核\n");
+                return;
+            }
             XmlWatcher.Path = FolderPath.Text;
             XmlWatcher.Filter = "*.xml";
             XmlWatcher.Created += new FileSystemEventHandler(XmlWatcher_Created);
             XmlWatcher.EnableRaisingEvents = true;
+            Properties.Settings.Default.FolderPath = FolderPath.Text;
+            Properties.Settings.Default.BackUpFolderPath = BackUpFolderPath.Text;
+            Properties.Settings.Default.Save();
+            Source.Enabled = false;
+            OperateResult.AppendText("开始执行监控\n");
         }
 
         private void XmlWatcher_Created(object sender, FileSystemEventArgs e)
@@ -33,28 +53,54 @@ namespace UAS_XmlAnalysor
                     }
                     System.Threading.Thread.Sleep(500);
                 }
-                catch (Exception ex)
+                catch (Exception)
                 {
-                    Console.WriteLine(string.Format("Output file {0} not yet ready ({1})", e.Name, ex.Message));
                 }
             }
             XmlReader myReader = XmlReader.Create(FolderPath.Text + @"\" + e.Name);
+            string sncode = e.Name.Split('.')[0];
+            OperateResult.AppendText("读取文件" + e.Name + "\n");
+            List<string> name = new List<string>();
+            List<string> result = new List<string>();
+            int name_or_result = 0;
             while (myReader.Read())
             {
-                if (myReader.NodeType == XmlNodeType.Element && myReader.Name == "test")
+                if (myReader.NodeType == XmlNodeType.Text)
                 {
-                    for (int i = 0; i < myReader.AttributeCount; i++)
+                    if (name_or_result % 2 == 0)
+                    {
+                        name.Add(myReader.Value);
+                        name_or_result++;
+                    }
+                    else
                     {
-                        Console.WriteLine(myReader.GetAttribute(i));
+                        result.Add(myReader.Value);
+                        name_or_result++;
                     }
                 }
             }
+            string sql = "insert into STEPTESTDETAIL(std_id,std_sn,std_subclass1,std_testresult,std_date,std_rescode) values (STEPTESTDETAIL_seq.nextval,'" + sncode + "',:std_subclass1,:std_testresult,sysdate,'" + Source.Text + "')";
+            dh.BatchInsert(sql, new string[] { "std_subclass1", "std_testresult" }, name.ToArray(), result.ToArray());
             myReader.Close();
+            FileInfo file = new FileInfo(FolderPath.Text + @"\" + e.Name);
+            if (file.Exists)
+            {
+                try
+                {
+                    file.MoveTo(BackUpFolderPath.Text + @"\" + e.Name);
+                }
+                catch (Exception ex)
+                {
+                    Console.WriteLine(ex.Message);
+                }
+            }
         }
 
         private void StopWatch_Click(object sender, EventArgs e)
         {
             XmlWatcher.EnableRaisingEvents = false;
+            Source.Enabled = true;
+            OperateResult.AppendText("停止执行监控\n");
         }
 
         private void Clean_Click(object sender, EventArgs e)
@@ -78,9 +124,15 @@ namespace UAS_XmlAnalysor
 
         }
 
-        private void Form1_Load(object sender, EventArgs e)
+        private void ChooseBackUpFolder_Click(object sender, EventArgs e)
         {
-
+            FolderBrowserDialog folder = new FolderBrowserDialog();
+            folder.Description = "选择备份文件夹";
+            DialogResult result = folder.ShowDialog();
+            if (result == DialogResult.OK)
+            {
+                BackUpFolderPath.Text = folder.SelectedPath;
+            }
         }
     }
 }

+ 1367 - 0
UAS_XmlAnalysor/LogicHandler.cs

@@ -0,0 +1,1367 @@
+using System.Collections.Generic;
+using System.Data;
+using System.Text;
+
+
+namespace UAS_XmlAnalysor
+{
+    class LogicHandler
+    {
+        public LogicHandler() { }
+
+        static DataHelper dh = new DataHelper();
+        //用于拼接SQL
+        static StringBuilder sql = new StringBuilder();
+        //用于存放批量执行的SQL
+        static List<string> sqls = new List<string>();
+
+        /// <summary>
+        /// 检测当前工序是否正确,如果是第一道工序则进行插入MakeSerial表
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool CheckCurrentStepAndIfFirst(string iSnCode, string iMakeCode, string iSourceCode, string iCaller, out bool oIfFirst, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            oIfFirst = false;
+            if (iSnCode == "")
+            {
+                oErrorMessage = "序列号不能为空值";
+                return false;
+            }
+            string StepCode = "";
+            string StepName = "";
+            string LineCode = "";
+            //如果传入的工单为空的话
+            if (iMakeCode == "")
+                if (!GetMakeInfo(iSnCode, out iMakeCode, out oErrorMessage))
+                    return false;
+
+            string cd_ifinput = "";
+            string cr_code = "";
+            //获取岗位资源对应的工序编号和名称
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
+            string fo_class = dh.getFieldDataByCondition("cs_form", "fo_class", "fo_caller='" + iCaller + "'").ToString();
+            if (fo_class != "")
+            {
+                DataTable dt1 = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_makecode", "ms_status" }, "ms_sncode='" + iSnCode + "'");
+                if (dt1.Rows.Count > 0)
+                {
+                    string macode = dt1.Rows[0]["ms_makecode"].ToString();
+                    if (macode == "")
+                    {
+                        oErrorMessage = "序列号" + iSnCode + "未绑定工单";
+                        return false;
+                    }
+                    if (dt1.Rows[0]["ms_status"].ToString() == "2")
+                    {
+                        oErrorMessage = "序列号" + iSnCode + "对应工单已完工";
+                        return false;
+                    }
+                    if (macode != iMakeCode)
+                    {
+                        oErrorMessage = "该序列号已绑定到工单" + macode;
+                        return false;
+                    }
+                }
+                sql.Clear();
+                sql.Append("select " + fo_class + ",cd_ifinput ifinput,cr_code from  make left join craft on cr_code=ma_craftcode left join craftdetail on cd_crid=cr_id ");
+                sql.Append("where ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'");
+                //获取的行号不等于0,存在记录检测通过
+                dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                if (dt1.Rows.Count > 0)
+                {
+                    cd_ifinput = dt1.Rows[0]["ifinput"].ToString();
+                    cr_code = dt1.Rows[0]["cr_code"].ToString();
+                    if (dt1.Rows[0][fo_class].ToString() != "-1")
+                    {
+                        //返回具体的工单信息
+                        string serial = "";
+                        switch (fo_class)
+                        {
+                            case "cd_ifinput":
+                                serial = "上料采集";
+                                break;
+                            case "cd_ifoqc":
+                                serial = "OQC";
+                                break;
+                            case "cd_ifpack":
+                                serial = "包装采集";
+                                break;
+                            case "cd_ifsnchange":
+                                serial = "序列转换";
+                                break;
+                            case "cd_iftest":
+                                serial = "测试采集";
+                                break;
+                            default:
+                                break;
+                        }
+                        oErrorMessage = "当前岗位对应的工序不是" + serial + "工序";
+                        return false;
+                    }
+                }
+                else
+                {
+                    oErrorMessage = "当前岗位资源对应的工序不属于工单号" + iMakeCode;
+                    return false;
+                }
+            }
+            if (!CheckMakeStatus(iMakeCode, out oErrorMessage))
+            {
+                return false;
+            }
+            //验证当前执行的工序是否正确
+            DataTable dt = (DataTable)dh.ExecuteSql("select ms_nextstepcode,ms_stepcode from makeserial where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string CurrentStep = dt.Rows[0]["ms_nextstepcode"].ToString();
+                string LastStepCode = dt.Rows[0]["ms_stepcode"].ToString();
+                if (CurrentStep != "")
+                {
+                    //工序不等于上一工序和本工序
+                    if (CurrentStep != StepCode && LastStepCode != StepCode)
+                    {
+                        oErrorMessage = "序列号" + iSnCode + "的当前工序是" + CurrentStep + ",当前岗位的工序是" + StepName;
+                        return false;
+                    }
+                }
+                else
+                {
+                    oErrorMessage = "序列号" + iSnCode + "无可继续执行工序(已完工或者序列号不存在)";
+                    return false;
+                }
+            }
+            //判断是否是第一道工序
+            dt = (DataTable)dh.ExecuteSql("select  min(mcd_detno) detno from makecraftdetail where mcd_macode='" + iMakeCode + "'", "select");
+            string detno = dt.Rows[0]["detno"].ToString();
+            //判断当前最小的执行顺序是否有记录
+            if (dh.getRowCount("makecraftdetail", "mcd_stepcode='" + StepCode + "' and mcd_macode='" + iMakeCode + "' and mcd_detno ='" + detno + "'") > 0)
+            {
+                if (!dh.CheckExist("MakeSerial", "ms_sncode='" + iSnCode + "'"))
+                {
+                    //判断当前工单的数量是否已经超出了完工数量
+                    int ma_qty = int.Parse(dh.getFieldDataByCondition("make", "ma_qty", "ma_code='" + iMakeCode + "'").ToString());
+                    //查询除了报废的之外的记录数量
+                    int ms_sncodecount = int.Parse(dh.getFieldDataByCondition("makeserial", "count(ms_sncode)", "ms_makecode='" + iMakeCode + "' and ms_status<>3").ToString());
+                    //如果MakeSerial表的记录数已经达到了工单数量
+                    if (ma_qty > ms_sncodecount)
+                    {
+                        sql.Clear();
+                        sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,");
+                        sql.Append("ms_wccode,ms_craftcode,ms_craftname,ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,");
+                        sql.Append("'" + iSnCode + "','" + iSnCode + "',ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + StepCode + "',1,ma_code ");
+                        sql.Append("from make left join makecraftdetail on ma_code =mcd_macode where ma_code='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
+                        dh.ExecuteSql(sql.ToString(), "insert");
+                        oErrorMessage = "获取序列号" + iSnCode + "成功,";
+                        oIfFirst = true;
+                    }
+                    else
+                    {
+                        oErrorMessage = "当前生产数量已达到完工数量";
+                        return false;
+                    }
+                }
+            }
+            //判断岗位备料是否足够
+            string Yes_No = dh.GetConfig("BatchNumber", "MESSetting").ToString();
+            if (cd_ifinput != "0")
+            {
+                sql.Clear();
+                sql.Append("select wm_concat(mss_prodcode) code,count(1) cn from (select sum(nvl(mss_remain,0))remain,mss_prodcode,max(mss_baseqty) mss_baseqty ");
+                sql.Append("from makesourcestock where mss_makecode='" + iMakeCode + "' and mss_stepcode='" + StepCode + "' ");
+                sql.Append("and mss_linecode='" + LineCode + "' group by mss_prodcode)T where T.remain<mss_baseqty and rownum<20");
+                dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                //如果配置的是Yes
+                if (Yes_No != "0")
+                {
+                    //如果批次料不足
+                    if (dt.Rows.Count > 0 && int.Parse(dt.Rows[0]["cn"].ToString()) > 0)
+                    {
+                        oErrorMessage += "批次物料:" + iSnCode + "," + dt.Rows[0]["code"] + "岗位备料不足";
+                        return false;
+                    }
+                }
+            }
+            return true;
+        }
+
+        /// <summary>
+        /// 检测当前的岗位资源对应的工序
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="oErrMessage"></param>
+        /// <returns></returns>
+        public static bool CheckCurrentStep(string iSnCode, string iMakeCode, string iSourceCode, string iUserCode, out string oMSID, out string oMacode, out string oErrMessage)
+        {
+            oErrMessage = "";
+            oMSID = "";
+            oMacode = "";
+            string[] param = new string[] { iMakeCode, iSourceCode, iSnCode, iUserCode, oMSID, oMacode, oErrMessage };
+            dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
+            oMSID = param[4];
+            oMacode = param[5];
+            oErrMessage = param[6];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 判断工单是否已经下放
+        /// </summary>
+        /// <param name="iMaCode"></param>
+        /// <returns></returns>
+        public static bool CheckMakeStatus(string iMaCode, out string ErrorMessage)
+        {
+            string ma_statuscode = dh.getFieldDataByCondition(" make ", "ma_statuscode", "Lower(ma_code)='" + iMaCode.ToLower() + "' ").ToString();
+            ErrorMessage = "";
+            if (ma_statuscode == "")
+            {
+                ErrorMessage = "工单号" + iMaCode + "不存在";
+                return false;
+            }
+            if (ma_statuscode == "STARTED")
+                return true;
+            else
+            {
+                ErrorMessage = "工单必须是已下放状态";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 判断当前工序是否是第一道工序
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakecode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <returns></returns>
+        public static bool CheckIfFirstMakeSerial(string iSnCode, string iMakecode, string iSourceCode)
+        {
+            //选取当前的最小的执行顺序
+            string CurrentStep = GetStepCodeBySource(iSourceCode);
+            DataTable dt = (DataTable)dh.ExecuteSql("select  min(mcd_detno) detno from makecraftdetail where mcd_macode='" + iMakecode + "'", "select");
+            string detno = dt.Rows[0]["detno"].ToString();
+            //判断当前最小的执行顺序是否有记录
+            if (dh.getRowCount("makecraftdetail", "mcd_stepcode='" + CurrentStep + "' and mcd_macode='" + iMakecode + "' and mcd_detno ='" + detno + "'") > 0)
+            {
+                if (!dh.CheckExist("MakeSerial", "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakecode + "'"))
+                {
+                    sql.Clear();
+                    sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,");
+                    sql.Append("ms_wccode,ms_craftcode,ms_craftname,ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,");
+                    sql.Append("'" + iSnCode + "','" + iSnCode + "',ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + CurrentStep + "',0,ma_code ");
+                    sql.Append("from make left join makecraftdetail on ma_code =mcd_macode where ma_code='" + iMakecode + "' and mcd_stepcode='" + CurrentStep + "'");
+                    dh.ExecuteSql(sql.ToString(), "insert");
+                }
+                return true;
+            }
+            else
+                return false;
+        }
+
+        public static void GetSerialNumByCaller(string iCaller, out string SerialNum)
+        {
+            SerialNum = "";
+            string[] param = new string[] { iCaller, "2", SerialNum };
+            dh.CallProcedure("SP_GETMAXNUMBER", ref param);
+            SerialNum = param[2];
+        }
+
+        /// <summary>
+        /// 判断下一工序是否是送检工序
+        /// </summary>
+        /// <returns></returns>
+        public static bool CheckNextStepIfQC(string iSnCode, string iMakeCode, string iStepCode, string iCraftCode, string iUserName, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string IfQC = dh.getFieldDataByCondition("craft left join  craftdetail on cd_crid=cr_id", "cd_ifoqc", "cr_code='" + iCraftCode + "' and cd_stepcode='" + iStepCode + "'").ToString();
+            if (IfQC != "0" && IfQC != "")
+            {
+                DataTable dt = dh.getFieldsDataByCondition("make left join product on ma_prodcode=pr_code", new string[] { "ma_nowcheckqty", "pr_qcbatchqty", "ma_checkno", "ma_prodcode", "pr_qualmethod" }, "ma_code='" + iMakeCode + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    string ma_nowcheckqty = dt.Rows[0]["ma_nowcheckqty"].ToString();
+                    string pr_qcbatchqty = dt.Rows[0]["pr_qcbatchqty"].ToString();
+                    string ma_checkno = dt.Rows[0]["ma_checkno"].ToString();
+                    string ma_prodcode = dt.Rows[0]["ma_prodcode"].ToString();
+                    string pr_qualmethod = dt.Rows[0]["pr_qualmethod"].ToString();
+                    if (pr_qcbatchqty != "" && pr_qcbatchqty != "0")
+                    {
+                        //当前批次的送检批数量大于物料资料中的抽检批数或者当前批次编号为空
+                        string checkno = "";
+                        if (int.Parse(ma_nowcheckqty == "" ? "0" : ma_nowcheckqty) >= int.Parse(pr_qcbatchqty) || ma_checkno == "")
+                        {
+                            //原有的抽检批次插入OQCBatch
+                            string ob_id = dh.GetSEQ("OQCBatch_SEQ");
+                            checkno = dh.GetSerialNumberByCaller("Make!CheckQC");
+                            sql.Clear();
+                            sql.Append("insert into OQCBatch  (ob_id, ob_checkno,ob_makecode,ob_source,ob_indate,ob_checkman,ob_batchqty,ob_status,ob_prodcode,ob_projectcode)");
+                            sql.Append(" values('" + ob_id + "','" + checkno + "','" + iMakeCode + "', '工序',sysdate, '" + iUserName + "','" + ma_nowcheckqty + "','UNCHECK','" + ma_prodcode + "','" + pr_qualmethod + "')");
+                            sqls.Add(sql.ToString());
+                            sqls.Add("update makeserial set ms_checkno='" + checkno + "' where ms_makecode='" + iMakeCode + "' and ms_sncode='" + iSnCode + "'");
+                            sqls.Add("update make set ma_checkno='" + checkno + "',ma_nowcheckqty=1 where ma_code='" + iMakeCode + "'");
+                        }
+                        else
+                        {
+                            sqls.Add("update makeserial set ms_checkno='" + ma_checkno + "' where ms_makecode='" + iMakeCode + "' and ms_sncode='" + iSnCode + "'");
+                            sqls.Add("update make set ma_nowcheckqty= ma_nowcheckqty+1  where ma_code='" + iMakeCode + "'");
+                        }
+                        dh.ExecuteSQLTran(sqls.ToArray());
+                        sqls.Clear();
+                        //如果制造单的ma_checkno没有值则新加入一个值
+                        string checkno1 = checkno == "" ? ma_checkno : checkno;
+                        string obd_obid = dh.getFieldDataByCondition("oqcbatch", "ob_id", "ob_checkno='" + checkno1 + "'").ToString();
+                        //插入抽检批次明细表
+                        sql.Clear();
+                        sql.Append("insert into OQCBatchDetail (obd_id,obd_obid,obd_sncode,obd_outboxcode,obd_makecode,obd_checkno,obd_builddate) ");
+                        sql.Append("select OQCBatchDetail_SEQ.nextval,'" + obd_obid + "',ms_sncode,ms_outboxcode,ms_makecode,ms_checkno,");
+                        sql.Append("sysdate from makeserial where  ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
+                        dh.ExecuteSql(sql.ToString(), "insert");
+                        return true;
+                    }
+                    else
+                    {
+                        oErrorMessage = "请维护物料资料的抽检批数";
+                        return false;
+                    }
+                }
+                else
+                {
+                    oErrorMessage = "制造单号不存在";
+                    return false;
+                }
+            }
+            else
+            {
+                oErrorMessage = "当前工序的下一工序不是OQC检测";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 验证用户身份信息
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool CheckUserLogin(string iUserCode, string iPassWord, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "select em_code from employee where em_code=:UserName and em_password =:PassWord";
+            DataTable dt;
+            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode, iPassWord);
+            if (dt.Rows.Count > 0)
+                return true;
+            else
+            {
+                oErrorMessage = "用户名或者密码不正确!";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 记录登陆信息
+        /// </summary>
+        public static void RecordLogInfo(string iUserCode, string iUserName, string iVersion, string iType, string iIP)
+        {
+            dh.ExecuteSql("insert into LogInfo(id,sip,usname,indate,uscode,versioncode,terminaltype) values (LogInfo_seq.nextval,'" + iIP + "','" + iUserName + "',sysdate,'" + iUserCode + "','" + iVersion + "','" + iType + "')", "insert");
+        }
+
+        /// <summary>
+        /// 验证用户身份信息和岗位资源
+        /// </summary>
+        /// <param name="iUserCode"></param>
+        /// <param name="iPassWord"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool CheckUserAndResourcePassed(string iUserCode, string iSourceCode, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "select em_code,em_type,em_name from employee where em_code=:UserName ";
+            DataTable dt;
+            dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode);
+            if (dt.Rows.Count > 0)
+            {
+                string em_name = dt.Rows[0]["em_name"].ToString();
+                string em_type = dt.Rows[0]["em_type"].ToString();
+                if (iSourceCode == "")
+                {
+                    oErrorMessage = "岗位资源不允许为空";
+                    return false;
+                }
+                if (em_type == "admin")
+                {
+                    if (dh.CheckExist("Source", "upper(sc_code)='" + iSourceCode.ToUpper() + "' and sc_statuscode='AUDITED'"))
+                    {
+                        return true;
+                    }
+                    else
+                    {
+                        oErrorMessage = "岗位资源编号错误或者未审核!";
+                        return false;
+                    }
+                }
+                else
+                {
+                    dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "eg_emcode = '" + iUserCode + "' and sc_statuscode='AUDITED'");
+                    //如果存在该编号
+                    if (dt.Rows.Count > 0)
+                    {
+                        //判断如果多个岗位资源存在,用户输入的只要在其中就行
+                        for (int i = 0; i < dt.Rows.Count; i++)
+                        {
+                            if (dt.Rows[i]["ur_resourcecode"].ToString() == iSourceCode)
+                                return true;
+                        }
+                        oErrorMessage = "用户不处于当前资源所属分组!";
+                    }
+                    else
+                        oErrorMessage = "岗位资源编号错误或者未审核!";
+                }
+            }
+            else
+                oErrorMessage = "用户不存在!";
+            return false;
+        }
+
+        public static bool CheckStepAttribute(string iCaller, string iSourceCode, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string[] param = new string[] { iCaller, iSourceCode, oErrorMessage };
+            dh.CallProcedure("CS_CHECKSTEPATTRIBUTE", ref param);
+            oErrorMessage = param[2];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        public static bool CheckStepSNAndMacode(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oMakeCode, out string oMsID, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            oMakeCode = "";
+            oMsID = "";
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, oMakeCode, oMsID, oErrorMessage };
+            dh.CallProcedure("CS_CHECKSTEPSNANDMACODE", ref param);
+            oMakeCode = param[4];
+            oMsID = param[5];
+            oErrorMessage = param[6];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        public static void DoCommandLog(string iUserCode, string iMakeCode, string iLineCode, string iSourceCode, string iOperate, string iResult, string iSncode, string iCheckno)
+        {
+            sql.Clear();
+            sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
+            sql.Append("cl_result,cl_sncode,cl_code) select commandlog_seq.nextval,:iUserCode,sysdate,:iLineCode ,");
+            sql.Append(":iSourceCode ,ms_makecode,:iOperate,:iResult,:iSncode,ms_checkno from makeserial where ms_sncode=:iSncode");
+            dh.ExecuteSql(sql.ToString(), "insert", iUserCode, iLineCode, iSourceCode, iOperate, iResult, iSncode, iSncode);
+        }
+
+        /// <summary>
+        /// 分配Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="oMac"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCdoe3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetAddressRangeByMakeCode(string iSnCode, string iMakeCode, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCdoe3, out string oErrorMessage)
+        {
+            oMac = "";
+            oBT = "";
+            oCode1 = "";
+            oCode2 = "";
+            oCdoe3 = "";
+            oErrorMessage = "";
+            string[] param = new string[] { iSnCode, iMakeCode, oMac, oBT, oCode1, oCode2, oCdoe3, oErrorMessage };
+            dh.CallProcedure("CS_GETADDRESSBYMAKECODE", ref param);
+            oMac = param[2];
+            oBT = param[3];
+            oCode1 = param[4];
+            oCode2 = param[5];
+            oCdoe3 = param[6];
+            oErrorMessage = param[7];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 输入的 SN 号查找在制品是否有 IMEI 信息存在,如果存在则将 IMEI 信息传出,如果没有则在该工单下未使用的 IMEI 中随机分配一组
+        /// 如果iIMEI1、iNetCode不为空,则分别作为获取的附件加条件。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMO"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oMac"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oID1"></param>
+        /// <param name="oID2"></param>
+        /// <param name="oID3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetIMEIOrNetCodeRange(string iSnCode, string iMakeCode, string iIMEI1, string iNetCode, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oID1, out string oID2, out string oID3, out string oErrorMessage)
+        {
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oIMEI3 = "";
+            oMEID = "";
+            oNetCode = "";
+            oPSN = "";
+            oID1 = "";
+            oID2 = "";
+            oID3 = "";
+            oErrorMessage = "";
+            string[] param = new string[] { iSnCode, iMakeCode, iIMEI1, iNetCode, oIMEI1, oIMEI2, oIMEI3, oMEID, oNetCode, oPSN, oID1, oID2, oID3, oErrorMessage };
+            dh.CallProcedure("CS_GETIMEIORNETCODERANGE", ref param);
+            oIMEI1 = param[4];
+            oIMEI2 = param[5];
+            oIMEI3 = param[6];
+            oMEID = param[7];
+            oNetCode = param[8];
+            oPSN = param[9];
+            oID1 = param[10];
+            oID2 = param[11];
+            oID3 = param[12];
+            oErrorMessage = param[13];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 获取工单的最近一条执行记录
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="oMakeCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetMakeInfo(string iSnCode, out string oMakeCode, out string oErrorMessage)
+        {
+            //取MakeProcess表中的执行记录ID最大的一个工单的号码
+            oMakeCode = "";
+            oErrorMessage = "";
+            string ms_id = dh.getFieldDataByCondition("MakeSerial", "max(ms_id) ms_id", "upper(ms_sncode)='" + iSnCode.ToUpper() + "' or ms_firstsn in (select firstsn from makesnrelation where upper(sn)='" + iSnCode.ToUpper() + "')").ToString();
+            oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id='" + ms_id + "'").ToString();
+            if (oMakeCode != "")
+                return true;
+            else
+            {
+                oErrorMessage = "序列号:" + iSnCode + " 未归属工单";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 获取送检批次,根据不同的iOQCStep执行不同的操作,查询到有具体的信息时返回Form和Detail的两个DataTable
+        ///  iOQCStep 有四个固定参数
+        ///  OQCSENDCHECK 生成送检批
+        ///  OQCPLANMAINTAIN 抽样计划维护
+        ///  OQCDATACOLLECTION 抽样数据采集
+        ///  OQCRESULTDETERMINE 批结果判定
+        /// </summary>
+        /// <returns></returns>
+        public static DataTable[] GetOQCBatch(string iSnCode, string iOutBoxCode, string iCheckNo, string iOQCStep, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string SQL = "";
+            string ms_checkno = "";
+            DataTable dt = new DataTable();
+            if (iCheckNo != "")
+                return GetBatch(iCheckNo, iOQCStep, out oErrorMessage);
+            else if (iSnCode != "")
+            {
+                SQL = "select ms_checkno from makeserial where ms_sncode='" + iSnCode + "' or ms_psn='" + iSnCode + "'";
+                dt = (DataTable)dh.ExecuteSql(SQL, "select");
+                if (dt.Rows.Count == 0)
+                {
+                    oErrorMessage = "序列号" + iSnCode + "不存在";
+                    return null;
+                }
+                else
+                {
+                    if (dt.Rows[0]["ms_checkno"].ToString() == "")
+                    {
+                        oErrorMessage = "该序列号没有送检批次号";
+                        return null;
+                    }
+                    else
+                        ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+                }
+            }
+            else if (iOutBoxCode != "")
+            {
+                SQL = "select ms_checkno from MES_PACKAGE_VIEW left join makeserial on v_barcode=ms_sncode where  v_outboxcode='" + iOutBoxCode + "' ";
+                dt = (DataTable)dh.ExecuteSql(SQL, "select");
+                if (dt.Rows.Count == 0)
+                {
+                    oErrorMessage = "该箱号不存在";
+                    return null;
+                }
+                else
+                {
+                    if (dt.Rows[0]["ms_checkno"].ToString() == "")
+                    {
+                        oErrorMessage = "该箱号没有送检批次号";
+                        return null;
+                    }
+                    else
+                        ms_checkno = dt.Rows[0]["ms_checkno"].ToString();
+                }
+            }
+            if (ms_checkno != "")
+            {
+                return GetBatch(ms_checkno, iOQCStep, out oErrorMessage);
+            }
+            else
+            {
+                oErrorMessage = "送检批次不存在";
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// 获取序列号的所有串号信息
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="oIMEI1"></param>
+        /// <param name="oIMEI2"></param>
+        /// <param name="oIMEI3"></param>
+        /// <param name="oMEID"></param>
+        /// <param name="oNetCode"></param>
+        /// <param name="oPSN"></param>
+        /// <param name="oMac"></param>
+        /// <param name="oBT"></param>
+        /// <param name="oCode1"></param>
+        /// <param name="oCode2"></param>
+        /// <param name="oCode3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool GetSNAllInfo(string iSnCode, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oMEID, out string oNetCode, out string oPSN, out string oMac, out string oBT, out string oCode1, out string oCode2, out string oCode3, out string oID1, out string oID2, out string oID3, out string oErrorMessage)
+        {
+            oBT = "";
+            oMEID = "";
+            oMac = "";
+            oPSN = "";
+            oNetCode = "";
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oIMEI3 = "";
+            oCode1 = "";
+            oCode2 = "";
+            oCode3 = "";
+            oID1 = "";
+            oID2 = "";
+            oID3 = "";
+            //通过序列号获取最近操作的工单号
+            string ms_id = dh.getFieldDataByCondition("makeserial", "ms_id", "ms_sncode='" + iSnCode + "'").ToString();
+            if (ms_id != "")
+            {
+                DataTable dt = dh.getFieldsDataByCondition("MakeSerial", new string[] { "ms_id", "ms_mac", "ms_bt", "ms_meid", "ms_netcode", "ms_psn", "ms_imei1", "ms_imei2", "ms_imei3", "ms_othcode1", "ms_othcode2", "ms_othcode3", "ms_othid1", "ms_othid2", "ms_othid3" }, "ms_id='" + ms_id + "'");
+                if (dt.Rows.Count > 0)
+                {
+                    oMac = dt.Rows[0]["ms_mac"].ToString();
+                    oBT = dt.Rows[0]["ms_bt"].ToString();
+                    oPSN = dt.Rows[0]["ms_psn"].ToString();
+                    oNetCode = dt.Rows[0]["ms_netcode"].ToString();
+                    oMEID = dt.Rows[0]["ms_meid"].ToString();
+                    oIMEI1 = dt.Rows[0]["ms_imei1"].ToString();
+                    oIMEI2 = dt.Rows[0]["ms_imei2"].ToString();
+                    oIMEI3 = dt.Rows[0]["ms_imei3"].ToString();
+                    oCode1 = dt.Rows[0]["ms_othcode1"].ToString();
+                    oCode2 = dt.Rows[0]["ms_othcode2"].ToString();
+                    oCode3 = dt.Rows[0]["ms_othcode3"].ToString();
+                    oID1 = dt.Rows[0]["ms_othid3"].ToString();
+                    oID2 = dt.Rows[0]["ms_othid3"].ToString();
+                    oID3 = dt.Rows[0]["ms_othid3"].ToString();
+                    oErrorMessage = "";
+                    return true;
+                }
+                else
+                {
+                    oErrorMessage = "序列号" + iSnCode + "不存在";
+                    return false;
+                }
+            }
+            else
+            {
+                oErrorMessage = "序列号" + iSnCode + "不存在";
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 第一个是Form的主表信息,第二个是Grid的信息
+        /// </summary>
+        /// <param name="iCheckNo"></param>
+        /// <returns></returns>
+        private static DataTable[] GetBatch(string iCheckNo, string iOQCStep, out string oErrorMessage)
+        {
+            DataTable Form = new DataTable();
+            DataTable Grid = new DataTable();
+            oErrorMessage = "";
+            switch (iOQCStep.ToUpper())
+            {
+                case "OQCSENDCHECK":
+                    sql.Clear();
+                    sql.Append("select count(1) ob_batchqty,obd_outboxcode,obd_id,obd_makecode from OQCBatchdetail ");
+                    sql.Append("where obd_checkno = '" + iCheckNo + "' group by obd_outboxcode,obd_makecode,obd_id");
+                    Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    Form = (DataTable)dh.ExecuteSql("select ob_id,ob_status,ob_prodcode,ob_batchqty,ob_source,ob_checkno from OQCBatch where ob_checkno='" + iCheckNo + "'", "select");
+                    if (Form.Rows.Count > 0)
+                    {
+                        if (Form.Rows[0]["ob_source"].ToString() == "新增" && Form.Rows[0]["ob_status"].ToString() == "ENTERING")
+                        {
+                            sql.Clear();
+                            sql.Append("select ob_id,ob_status,ob_prodcode ma_prodcode,ob_batchqty,ob_source,ob_checkno,obd_id,obd_outboxcode,obd_makecode ma_code,count(1) cn from OQCBatch left join OQCBatchdetail ");
+                            sql.Append("on obd_obid = ob_id  where ob_checkno ='" + iCheckNo + "' group by ob_id,ob_status,ob_prodcode,ob_batchqty,ob_source,ob_checkno,obd_outboxcode,obd_makecode,obd_id");
+                            Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                        }
+                        else oErrorMessage = "自动生成的抽检批次号不允许在该页面操作,或者该抽检批次号不是在录入状态";
+                    }
+                    else oErrorMessage = "抽检批次" + iCheckNo + "不存在";
+                    break;
+                case "OQCPLANMAINTAIN":
+                    sql.Clear();
+                    sql.Append("select ob_prodcode,ob_maxngacceptqty,ob_id,ob_checkno,ob_projectcode,ob_nowcheckqty,ob_source,ob_remark,");
+                    sql.Append("ob_status,pr_id,pr_detail,pr_kind,pr_manutype,pr_qualmethod,nvl(ob_aqlcode,pr_aql)ob_aqlcode from OQCBatch left join product on ");
+                    sql.Append("pr_code=ob_prodcode where ob_checkno='" + iCheckNo + "'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    sql.Clear();
+                    if (Form.Rows.Count > 0)
+                    {
+                        string pr_id;
+                        //判断状态是否是待检验
+                        if (Form.Rows[0]["ob_status"].ToString() == "UNCHECK")
+                        {
+                            //判断送检方案是否为空
+                            string qualmethod = "";
+                            //第一原则送检方案为空
+                            if (Form.Rows[0]["pr_qualmethod"].ToString() == "")
+                            {
+                                //判读第二原则送检方案为空
+                                qualmethod = dh.getFieldDataByCondition("product left join productkind on pr_kind=pk_name", "pk_qualmethod", "pr_code='" + Form.Rows[0]["ob_prodcode"] + "'").ToString();
+                            }
+                            //第一原则送检方案不为空
+                            else
+                            {
+                                qualmethod = Form.Rows[0]["pr_qualmethod"].ToString();
+                            }
+                            Form.Rows[0]["ob_projectcode"] = qualmethod;
+                            pr_id = dh.getFieldDataByCondition("QUA_Project", "pr_id", "pr_code = '" + qualmethod + "'").ToString();
+                            sql.Clear();
+                            sql.Append("select  1 choose,nvl(max(oi_id),0)oi_id, ci_kind,nvl(max(oi_sampleqty),0) oi_sampleqty from QUA_PROJECT left join ");
+                            sql.Append(" QUA_ProjectDetail on pd_prid=pr_id  left join QUA_CheckItem on pd_ciid=ci_id ");
+                            sql.Append("left join OQCITEMS on oi_checkno ='" + iCheckNo + "' and oi_projectcode='" + qualmethod + "' ");
+                            sql.Append("and oi_projectcode = pr_code and oi_checkkind = ci_kind where  pr_code='" + qualmethod + "'  group by ci_kind");
+                            Grid = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                        }
+                        else
+                            oErrorMessage = "只有待检验的批次才允许维护抽样计划";
+                    }
+                    else
+                        oErrorMessage = "抽检批次" + iCheckNo + "不存在";
+                    break;
+                case "OQCDATACOLLECTION":
+                    sql.Clear();
+                    sql.Append("select ob_checkno,ob_makecode,ob_prodcode,ob_nowcheckqty,pr_detail,ob_ngqty,ob_okqty,");
+                    sql.Append("ob_remark,ob_makecode,ob_status,ob_projectcode,ob_aqlcode,ob_maxngacceptqty from OQCBatch left join product on ");
+                    sql.Append("pr_code=ob_prodcode left join oqcitems on oi_checkno =ob_checkno and oi_projectcode =ob_projectcode where ob_checkno='" + iCheckNo + "'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    //状态为UNCHECK或者CHECKING并且有抽样计划的才能操作
+                    if (Form.Rows.Count > 0)
+                    {
+                        if (Form.Rows[0]["ob_projectcode"].ToString() == "" || !(Form.Rows[0]["ob_status"].ToString() != "UNCHECK" || Form.Rows[0]["ob_status"].ToString() != "CHECKING"))
+                            oErrorMessage = "状态为未检验或者送检中并且有抽样计划的才能操作";
+                    }
+                    else
+                    {
+                        oErrorMessage = "抽检批次" + iCheckNo + "不存在";
+                    }
+                    break;
+                case "OQCRESULTDETERMINE":
+                    sql.Clear();
+                    sql.Append("select ob_id,ob_aqlcode,ob_makecode,ob_status,ob_prodcode,(select max(oi_checkqty)from OQCItems where oi_checkno='" + iCheckNo + "') oi_checkqty,");
+                    sql.Append("ob_nowcheckqty,nvl(ob_okqty,0) ob_okqty,nvl(ob_ngqty,0) ob_ngqty,ob_maxngacceptqty,ob_source,ob_checkno,ob_result from OQCBatch where ob_checkno='" + iCheckNo + "'");
+                    Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    if (Form.Rows.Count == 0)
+                    {
+                        oErrorMessage = "抽检批次" + iCheckNo + "不存在";
+                    }
+                    break;
+                default:
+                    break;
+            }
+            return new DataTable[] { Form, Grid };
+        }
+
+        /// <summary>
+        /// 记录操作日志
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iMPKind"></param>
+        /// <param name="result"></param>
+        /// <param name="iUserCode"></param>
+        public static void InsertMakeProcess(string iSnCode, string iMakeCode, string iSourceCode, string iMPKind, string result, string iUserCode)
+        {
+            string CurrentStep = "";
+            string LineCode = "";
+            string CurrentStepName = "";
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref CurrentStep, ref CurrentStepName, ref LineCode);
+            sql.Clear();
+            sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
+            sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
+            sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,'" + CurrentStep + "','" + CurrentStepName + "',");
+            sql.Append("ms_craftcode,cr_name,'" + iMPKind + "','" + result + "',sysdate,'" + iUserCode + "',ma_wccode,'" + LineCode + "','" + iSourceCode + "',");
+            sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makeserial on ms_makecode=ma_code left join step on st_code=ms_stepcode left join craft on ms_craftcode=cr_code and cr_prodcode=ma_prodcode ");
+            sql.Append("where ms_sncode='" + iSnCode + "' and ma_code='" + iMakeCode + "' and st_code='" + CurrentStep + "'");
+            dh.ExecuteSql(sql.ToString(), "insert");
+        }
+
+        /// <summary>
+        /// 记录一般操作日志
+        /// </summary>
+        /// <param name="inMan"></param>
+        /// <param name="Content"></param>
+        /// <param name="Result"></param>
+        /// <param name="Search"></param>
+        /// <param name="Code"></param>
+        public static void InsertMessageLog(string inMan, string Content, string Result, string Search, string Code)
+        {
+            sql.Clear();
+            sql.Append("insert into messagelog (ml_id,ml_date,ml_man,ml_content,ml_result,ml_search,code) ");
+            sql.Append("values (messagelog_seq.nextval,sysdate,'" + inMan + "','" + Content + "','" + Result + "','" + Search + "','" + Code + "')");
+            dh.ExecuteSql(sql.ToString(), "insert");
+        }
+
+        public static bool OQCBatchJudge(string iCheckno, string iSourceCode, string iResult, string iRework, string iUserCode, string iRemark, out string oReworkCode, out string oErrorMessage)
+        {
+            oReworkCode = "";
+            oErrorMessage = "";
+            string[] param = new string[] { iCheckno, iSourceCode, iResult, iRework, iUserCode, iRemark, oReworkCode, oErrorMessage };
+            dh.CallProcedure("CS_OQCRESULTJUDGE", ref param);
+            oReworkCode = param[6];
+            oErrorMessage = param[7];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 保存Mac地址和BT地址
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMac"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iCode1"></param>
+        /// <param name="iCode2"></param>
+        /// <param name="iCode3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetAddressInfo(string iSN, string iMac, string iBT, string iCode1, string iCode2, string iCode3, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string[] param = new string[] { iSN, iMac, iBT, iCode1, iCode2, iCode3, oErrorMessage };
+            dh.CallProcedure("CS_SETADDRESSINFO", ref param);
+            oErrorMessage = param[6];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        public static bool SetStepFinish(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_SetFinish(iMakeCode, iSourceCode, iSN, iUserCode, out oErrorMessage);
+            }
+        }
+
+        /// <summary>
+        /// 设置测试结果
+        /// </summary>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iSN"></param>
+        /// <param name="iMPKind"></param>
+        /// <param name="iResult"></param>
+        /// <param name="iUserCode"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetTestResult(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
+        {
+            return SetStepFinish(iMakeCode, iSourceCode, iSN, iMPKind, iResult, iUserCode, out oErrorMessage);
+        }
+
+        public static bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, oErrorMessage };
+            dh.CallProcedure("CS_SETSTEPFINISH", ref param);
+            oErrorMessage = param[4];
+            if (oErrorMessage == "" || oErrorMessage == null || oErrorMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 方法说明:测试详细信息录入系统,针对一个SN多个测试项目结果可循环调用
+        /// </summary>
+        /// <param name="iSnCode">序列号</param>
+        /// <param name="iClass"></param>
+        /// <param name="iSubClass1"></param>
+        /// <param name="iSubClass2"></param>
+        /// <param name="iSubClass3"></param>
+        /// <param name="iMaxValue"></param>
+        /// <param name="iMinValue"></param>
+        /// <param name="iActualValue"></param>
+        /// <param name="iValue1"></param>
+        /// <param name="iValue2"></param>
+        /// <param name="iValue3"></param>
+        /// <param name="iTestResult"></param>
+        /// <param name="oErrMessage"></param>                                                      
+        /// <returns></returns>
+        public static bool SetTestDetail(string iSnCode, string iMakeCode, string iClass, string iSubClass1, string iSubClass2, string iSubClass3, string iMaxValue, string iMinValue, string iActualValue, string iValue1, string iValue2, string iValue3, string iTestResult, string iSourceCode, out string oErrMessage)
+        {
+            oErrMessage = "";
+            sql.Clear();
+            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_record)");
+            dh.ExecuteSql(sql.ToString(), "select", iSnCode, iMakeCode, iClass, iSubClass1, iSubClass2, iSubClass3, iMaxValue, iMinValue, iActualValue, iValue1, iValue2, iValue3, iTestResult, iSourceCode);
+            return true;
+        }
+
+        /// <summary>
+        /// 作业调用该方法将确认接收SN对应的IMEI及附属信息。
+        /// </summary>
+        /// <param name="iSN"></param>
+        /// <param name="iMO"></param>
+        /// <param name="iIMEI1"></param>
+        /// <param name="iIMEI2"></param>
+        /// <param name="iIMEI3"></param>
+        /// <param name="iMEID"></param>
+        /// <param name="iNetCode"></param>
+        /// <param name="iPSN"></param>
+        /// <param name="iID1"></param>
+        /// <param name="iBT"></param>
+        /// <param name="iID1"></param>
+        /// <param name="iID2"></param>
+        /// <param name="iID3"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetIMEIInfo(string iSnCode, string iIMEI1, string iIMEI2, string iIMEI3, string iMEID, string iNetCode, string iPSN, string iID1, string iID2, string iID3, out string oErrMessage)
+        {
+            oErrMessage = "";
+            string[] param = new string[] { iSnCode, iIMEI1, iIMEI2, iIMEI3, iMEID, iNetCode, iPSN, iID1, iID2, iID3, oErrMessage };
+            dh.CallProcedure("CS_SETIMEIINFO", ref param);
+            oErrMessage = param[10];
+            if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null")
+                return true;
+            else
+                return false;
+        }
+
+        /// <summary>
+        /// 执行不良信息采集
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iUserCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iBadCode"></param>
+        /// <param name="iBadRemark"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetTestNGDetail(string iSnCode, string iMakeCode, string iUserCode, string iSourceCode, string iResult, string[] iBadGroupCode, string[] iBadCode, string[] iBadRemark, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string StepCode = "";
+            string StepName = "";
+            if (iResult == "" || iResult == null)
+                iResult = "检查未通过";
+            GetStepCodeAndNameBySource(iSourceCode, ref StepCode, ref StepName);
+            string ms_status = dh.getFieldDataByCondition("makeserial", "ms_status", "ms_sncode='" + iSnCode + "'").ToString();
+            sql.Clear();
+            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_bgcode,mb_badtable,mb_soncode,mb_status,mb_badremark)");
+            sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
+            sql.Append("sp_soncode,'0',:bc_remark 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='" + iSnCode + "'");
+            dh.BatchInsert(sql.ToString(), new string[] { "bc_code", "bg_code", "bc_remark" }, iBadCode, iBadGroupCode, iBadRemark);
+            //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
+            //如果存在送检批号则进行删除
+            if (dh.CheckExist("oqcbatchdetail", "obd_sncode='" + iSnCode + "'"))
+            {
+                string checkno = dh.getFieldDataByCondition("oqcbatchdetail", "obd_checkno", "obd_sncode='" + iSnCode + "'").ToString();
+                dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + iSnCode + "'", "delete");
+                dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1 where ob_checkno='" + checkno + "'", "update");
+            }
+            //之前保存的不良就不再调用
+
+            DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework" }, "ms_sncode='" + iSnCode + "'");
+            if (dt.Rows.Count > 0)
+            {
+                string ifrework = dt.Rows[0]["ms_ifrework"].ToString();
+                string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                if (ms_stepcode == StepCode)
+                {
+                    if (ifrework == "0")
+                        dh.UpdateByCondition("makeserial", "ms_status=3", "ms_sncode='" + iSnCode + "'");
+                    else
+                        dh.UpdateByCondition("makeserial", "ms_reworkstatus=3", "ms_sncode='" + iSnCode + "'");
+                }
+                else
+                {
+                    if (ifrework == "0")
+                        dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "',ms_status=3", "ms_sncode='" + iSnCode + "'");
+                    else
+                        dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "',ms_reworkstatus=3", "ms_sncode='" + iSnCode + "'");
+                    SetStepFinish(iMakeCode, iSourceCode, iSnCode, "不良采集", iResult, iUserCode, out oErrorMessage);
+                }
+            }
+            return true;
+        }
+
+        /// <summary>
+        /// 判断是否扣料工序,执行扣料,执行上料表记录
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="iSourceCode"></param>
+        public static bool SetCollectionFinish(string iSnCode, string iMakeCode, string iUserName, string iSourceCode, out string oErrorMessage)
+        {
+            string StepCode = "";
+            string StepName = "";
+            string LineCode = "";
+            oErrorMessage = "";
+            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
+            if (StepCode == "" && StepName == "")
+            {
+                oErrorMessage = "当前岗位资源找不到对应工序,请先进行维护";
+                return false;
+            }
+            sql.Clear();
+            sql.Append("select nvl(cd_ifreduce,0) cd_ifreduce from craft left join craftdetail on cd_crid=cr_id ");
+            sql.Append("where cr_code=(select ma_craftcode  from makeserial left join make on ma_code = ms_makecode ");
+            sql.Append("where ms_sncode = '" + iSnCode + "') and cd_stepcode='" + StepCode + "'");
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+            sql.Clear();
+            if (dt.Rows.Count > 0)
+            {
+                string cd_ifreduce = dt.Rows[0][0].ToString();
+                if (cd_ifreduce == "-1")
+                {
+                    sql.Clear();
+                    sql.Append("select dsl_location,dsl_table,max(dsl_baseqty) baseqty from devsmtlocation where dsl_makecode='" + iMakeCode + "' and ");
+                    sql.Append("dsl_linecode='" + LineCode + "' and dsl_status=0 and dsl_remainqty>0 and dsl_invalidtime is null group by dsl_location,dsl_table");
+                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
+                        sql.Clear();
+                        sql.Append("select dsl_id,dsl_remainqty from devsmtlocation where dsl_makecode='" + iMakeCode + "' and dsl_linecode='" + LineCode + "' ");
+                        sql.Append("and dsl_status=0 and dsl_remainqty>0 and dsl_invalidtime is null and rownum<3 order by dsl_id asc ");
+                        DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
+                        for (int j = 0; j < dt1.Rows.Count; j++)
+                        {
+                            //外层循环的值dt
+                            double baseqty = (double)dt.Rows[i]["baseqty"];
+                            //内层循环的值dt1
+                            double dsl_remainqty = (double)dt1.Rows[j]["dsl_remainqty"];
+                            string dsl_id = dt1.Rows[j]["dsl_id"].ToString();
+                            if (baseqty > 0)
+                            {
+                                if (dsl_remainqty <= baseqty)
+                                {
+                                    sql.Clear();
+                                    sql.Append("update devsmtlocation set dsl_remainqty=0,dsl_invalidtime =sysdate, dsl_validtime =(case when dsl_validtime ");
+                                    sql.Append("is null then sysdate else  dsl_validtime end),dsl_status=-1 where dsl_id=" + dsl_id);
+                                    dh.ExecuteSql(sql.ToString(), "update");
+                                    baseqty -= dsl_remainqty;
+                                }
+                                else
+                                {
+                                    sql.Clear();
+                                    sql.Append("update devsmtlocation set dsl_remainqty=dsl_remainqty-NVL(dsl_baseqty,0),DSL_INVALIDTIME=(case when");
+                                    sql.Append("dsl_validtime is null then sysdate else dsl_validtime end) where dsl_id=" + dsl_id);
+                                    dh.ExecuteSql(sql.ToString(), "update");
+                                    baseqty = 0;
+                                }
+                            }
+                            else
+                                dh.ExecuteSql("update devsmtlocation set DSL_INVALIDTIME=sysdate where dsl_id=" + dsl_id, "update");
+                        }
+                    }
+                    sql.Clear();
+                    sql.Append("insert into ReduceStepRecord (rsd_id,rsd_macode,rsd_maprodcode,rsd_table,rsd_sncode,rsd_linecode,rsd_sourcecode) select ");
+                    sql.Append("ReduceStepRecord_SEQ.nextval,'" + iMakeCode + "',ma_prodcode,'','" + iSnCode + "','" + LineCode + "','" + iSourceCode + "' ");
+                    sql.Append("from make where ma_code='" + iMakeCode + "'");
+                    dh.ExecuteSql(sql.ToString(), "insert");
+                }
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 上料采集
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iBarcode"></param>
+        /// <param name="iSonCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="iSonID"></param>
+        /// <param name="iType"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetMaterialUp(string iSnCode, string iMakeCode, string iBarcode, string iSonCode, string iSourceCode, string iUserName, string iSonID, out string oErrorMessage)
+        {
+            oErrorMessage = "";
+            string StepCode = "";
+            string StepName = "";
+            string iRemainQty = dh.getFieldDataByCondition("barcode", "bar_remain", "bar_code='" + iBarcode + "'").ToString();
+            GetStepCodeAndNameBySource(iSourceCode, ref StepCode, ref StepName);
+            DataTable dt = (DataTable)dh.ExecuteSql("select cm_id from craftmaterial  where cm_sncode='" + iSnCode + "' and cm_barcode='" + iBarcode + "' and cm_soncode='" + iSonCode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                oErrorMessage = "条码已经上料";
+                return false;
+            }
+            else
+            {
+                sql.Clear();
+                sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,");
+                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid)");
+                sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,ms_code,ms_sncode,mcd_stepcode,");
+                sql.Append("mcd_stepname,ma_craftcode,ma_craftname,'" + iBarcode + "',1,sysdate,'" + iUserName + "',ma_linecode,ma_wccode,");
+                sql.Append("'" + iSourceCode + "','" + iSonID + "' from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
+                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='" + iMakeCode + "'and sp_id=" + iSonID + " and mcd_stepcode = '" + StepCode + "' and ms_sncode='" + iSnCode + "'");
+                dh.ExecuteSql(sql.ToString(), "insert");
+                return true;
+            }
+        }
+
+        /// <summary>
+        /// 执行下料操作
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iBarCode"></param>
+        /// <param name="iCurrentStep"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool SetMaterialDown(string iSnCode, string iBarCode, string iSourceCode, string iCurrentStep, string iUserName, out string oErrorMessage)
+        {
+            //序列号不为空的时候
+            oErrorMessage = "";
+            DataTable dt;
+            //对序列号进行验证
+            dt = (DataTable)dh.ExecuteSql("select  ms_status,ms_stepcode,ms_nextstepcode  from  makeserial  where  ms_sncode='" + iBarCode + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string ms_status = dt.Rows[0]["ms_status"].ToString();
+                string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                string ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
+                if (ms_status == "1" && ms_stepcode != iCurrentStep)
+                    oErrorMessage = "当前工序不是" + iCurrentStep + "\n";
+                else if (ms_status == "0" && ms_stepcode != iCurrentStep)
+                    oErrorMessage = "当前工序不是" + iCurrentStep + "";
+                else if (ms_status == "2" && ms_nextstepcode != iCurrentStep)
+                    oErrorMessage = "该序列号已经包装";
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select * from craftmaterial where cm_sncode='" + iSnCode + "'", "select");
+                    if (dt.Rows.Count > 0)
+                        oErrorMessage = "请采集需要下料的序列号";
+                    else
+                        oErrorMessage = "该序列号未上料,无需下料";
+                }
+            }
+
+            if (oErrorMessage == "")
+            {
+                dt = (DataTable)dh.ExecuteSql("select cm_id,cm_stepcode,ms_makecode,cm_mccode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + iSnCode + "' and cm_barcode='" + iBarCode + "'", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    string cm_id = dt.Rows[0]["cm_id"].ToString();
+                    string ms_macode = dt.Rows[0]["ms_makecode"].ToString();
+                    string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
+                    string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
+                    dh.ExecuteSql("delete from Craftmaterial where cm_id=" + cm_id, "delete");
+                    InsertMakeProcess(ms_macode, iSnCode, iSourceCode, "下料操作", "下料成功", iUserName);
+                    int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + iSnCode + "'");
+                    if (count == 0)
+                        dh.UpdateByCondition("makecraftdetail ", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty = mcd_okqty - 1", "mcd_mccode='" + cm_mccode + "' and mcd_stepcode='" + cm_stepcode + "'");
+                }
+                return true;
+            }
+            else
+                return false;
+        }
+
+        //public static bool UpdateOQCMessage(string iSnCode, string iCheckno, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
+        //{
+        //    oErrorMessage = "";
+        //    string StepCode = "";
+        //    string StepName = "";
+        //    string LineCode = "";
+        //    if (iResult == "" || iResult == null)
+        //    {
+        //        iResult = "测试合格";
+        //    }
+        //    GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
+        //    //查询批次和批数量
+        //    string batchqty = dh.getFieldDataByCondition("oqcbatch", "ob_nowcheckqty", "ob_checkno='" + iCheckno + "'").ToString();
+        //    string nextstepcode = dh.getFieldDataByCondition("make left join craft on ma_craftcode=cr_code and ma_prodcode=cr_prodcode left join craftdetail on cr_id = cd_crid", "cd_nextstepcode", "ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'").ToString();
+        //    if (iResult.Contains("批次通过"))
+        //    {
+        //        //更新执行的数量
+        //        sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+" + batchqty + ",mcd_outqty = mcd_outqty + " + batchqty + ",mcd_okqty = mcd_okqty + " + batchqty + " where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
+        //        //更新makeSerial 的下一工序
+        //        sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode + "' where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //    }
+        //    else
+        //    {
+        //        //更新执行的数量
+        //        sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1,mcd_okqty = mcd_okqty + 1 where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
+        //        //更新makeSerial 的下一工序
+        //        sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode + "' where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //    }
+        //    //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
+        //    dh.ExecuteSQLTran(sqls.ToArray());
+        //    sqls.Clear();
+        //    //检测下道工序是否存在,不存在 更新状态为已完成
+        //    if (nextstepcode == null || nextstepcode == "")
+        //    {
+        //        if (iResult.Contains("批次通过"))
+        //        {
+        //            sqls.Add("update make set ma_madeqty=ma_madeqty+" + batchqty + " where ma_code='" + iMakeCode + "'");
+        //            sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //        }
+        //        else
+        //        {
+        //            sqls.Add("update make set ma_madeqty=ma_madeqty+1  where ma_code='" + iMakeCode + "'");
+        //            sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //        }
+        //        dh.ExecuteSQLTran(sqls.ToArray());
+        //        sqls.Clear();
+        //    }
+        //    return true;
+        //}
+
+        /// <summary>
+        /// 设置良品采集结果,iResult含有“批次通过”按抽检批次通过
+        /// </summary>
+        /// <param name="iSnCode"></param>
+        /// <param name="iMakeCode"></param>
+        /// <param name="iSourceCode"></param>
+        /// <param name="iUserName"></param>
+        /// <param name="iResult"></param>
+        /// <param name="oErrorMessage"></param>
+        /// <returns></returns>
+        public static bool UpdateMakeMessage(string iSnCode, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
+        {
+            return SetStepFinish(iMakeCode, iSourceCode, iSnCode, iMPKind, iResult, iUserCode, out oErrorMessage);
+        }
+
+        /// <summary>
+        /// 获取执行步骤代码,名称和线别
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        /// <param name="LineCode"></param>
+        private static void GetStepCodeAndNameAndLineBySource(string Source, ref string StepCode, ref string StepName, ref string LineCode)
+        {
+            DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+                LineCode = dt.Rows[0]["sc_linecode"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码和名称
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <param name="StepCode"></param>
+        /// <param name="StepName"></param>
+        private static void GetStepCodeAndNameBySource(string Source, ref string StepCode, ref string StepName)
+        {
+            DataTable dt = dh.getFieldsDataByCondition("source", new string[] { "sc_stepcode", "sc_stepname", "sc_linecode" }, "sc_code='" + Source + "'");
+            if (dt.Rows.Count > 0)
+            {
+                StepCode = dt.Rows[0]["sc_stepcode"].ToString();
+                StepName = dt.Rows[0]["sc_stepname"].ToString();
+            }
+        }
+
+        /// <summary>
+        /// 获取步骤代码
+        /// </summary>
+        /// <param name="Source"></param>
+        /// <returns></returns>
+        private static string GetStepCodeBySource(string Source)
+        {
+            return dh.getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + Source + "'").ToString();
+        }
+
+        private static string lpad(int length, string number)
+        {
+            while (number.Length < length)
+            {
+                number = "0" + number;
+            }
+            number = number.Substring(number.Length - length, length);
+            return number;
+        }
+    }
+}

+ 132 - 0
UAS_XmlAnalysor/Login.Designer.cs

@@ -0,0 +1,132 @@
+namespace UAS_XmlAnalysor
+{
+    partial class Login
+    {
+        /// <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.label2 = new System.Windows.Forms.Label();
+            this.UserName = new System.Windows.Forms.TextBox();
+            this.PassWord = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.Source = new System.Windows.Forms.TextBox();
+            this.LoginButton = new System.Windows.Forms.Button();
+            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(145, 70);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(58, 21);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "用户名";
+            // 
+            // 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(145, 121);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(42, 21);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "密码";
+            // 
+            // UserName
+            // 
+            this.UserName.Location = new System.Drawing.Point(231, 71);
+            this.UserName.Name = "UserName";
+            this.UserName.Size = new System.Drawing.Size(174, 21);
+            this.UserName.TabIndex = 2;
+            // 
+            // PassWord
+            // 
+            this.PassWord.Location = new System.Drawing.Point(231, 122);
+            this.PassWord.Name = "PassWord";
+            this.PassWord.PasswordChar = '*';
+            this.PassWord.Size = new System.Drawing.Size(174, 21);
+            this.PassWord.TabIndex = 3;
+            // 
+            // 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(145, 171);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(74, 21);
+            this.label3.TabIndex = 4;
+            this.label3.Text = "岗位资源";
+            // 
+            // Source
+            // 
+            this.Source.Location = new System.Drawing.Point(231, 171);
+            this.Source.Name = "Source";
+            this.Source.Size = new System.Drawing.Size(174, 21);
+            this.Source.TabIndex = 5;
+            // 
+            // LoginButton
+            // 
+            this.LoginButton.Location = new System.Drawing.Point(245, 232);
+            this.LoginButton.Name = "LoginButton";
+            this.LoginButton.Size = new System.Drawing.Size(75, 23);
+            this.LoginButton.TabIndex = 6;
+            this.LoginButton.Text = "登陆";
+            this.LoginButton.UseVisualStyleBackColor = true;
+            this.LoginButton.Click += new System.EventHandler(this.LoginButton_Click);
+            // 
+            // Login
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(561, 294);
+            this.Controls.Add(this.LoginButton);
+            this.Controls.Add(this.Source);
+            this.Controls.Add(this.label3);
+            this.Controls.Add(this.PassWord);
+            this.Controls.Add(this.UserName);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+            this.Name = "Login";
+            this.Text = "登陆";
+            this.ResumeLayout(false);
+            this.PerformLayout();
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox UserName;
+        private System.Windows.Forms.TextBox PassWord;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.TextBox Source;
+        private System.Windows.Forms.Button LoginButton;
+    }
+}

+ 32 - 0
UAS_XmlAnalysor/Login.cs

@@ -0,0 +1,32 @@
+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;
+
+namespace UAS_XmlAnalysor
+{
+    public partial class Login : Form
+    {
+        public Login()
+        {
+            InitializeComponent();
+        }
+
+        private void LoginButton_Click(object sender, EventArgs e)
+        {
+            string ErrorMessage = "";
+            if (LogicHandler.CheckUserLogin(UserName.Text, PassWord.Text, out ErrorMessage))
+            {
+
+            }
+            else
+            {
+                MessageBox.Show(ErrorMessage);
+            }
+        }
+    }
+}

+ 120 - 0
UAS_XmlAnalysor/Login.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>

+ 10 - 0
UAS_XmlAnalysor/Properties/Resources.Designer.cs

@@ -59,5 +59,15 @@ namespace UAS_XmlAnalysor.Properties {
                 resourceCulture = value;
             }
         }
+        
+        /// <summary>
+        ///   查找类似于 (图标) 的 System.Drawing.Icon 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Icon xml_48px_1124003_easyicon_net {
+            get {
+                object obj = ResourceManager.GetObject("xml_48px_1124003_easyicon_net", resourceCulture);
+                return ((System.Drawing.Icon)(obj));
+            }
+        }
     }
 }

+ 12 - 5
UAS_XmlAnalysor/Properties/Resources.resx

@@ -46,7 +46,7 @@
     
     mimetype: application/x-microsoft.net.object.binary.base64
     value   : The object must be serialized with 
-            : System.Serialization.Formatters.Binary.BinaryFormatter
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
             : and then encoded with base64 encoding.
     
     mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
             : 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">
@@ -68,9 +69,10 @@
               <xsd:sequence>
                 <xsd:element name="value" type="xsd:string" minOccurs="0" />
               </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" />
+              <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">
@@ -85,9 +87,10 @@
                 <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="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">
@@ -109,9 +112,13 @@
     <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>
+    <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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+  <data name="xml_48px_1124003_easyicon_net" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\xml_48px_1124003_easyicon.net.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

+ 38 - 0
UAS_XmlAnalysor/Properties/Settings.Designer.cs

@@ -22,5 +22,43 @@ namespace UAS_XmlAnalysor.Properties {
                 return defaultInstance;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADD" +
+            "RESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA" +
+            "=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+        public string MES {
+            get {
+                return ((string)(this["MES"]));
+            }
+            set {
+                this["MES"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string FolderPath {
+            get {
+                return ((string)(this["FolderPath"]));
+            }
+            set {
+                this["FolderPath"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string BackUpFolderPath {
+            get {
+                return ((string)(this["BackUpFolderPath"]));
+            }
+            set {
+                this["BackUpFolderPath"] = value;
+            }
+        }
     }
 }

+ 14 - 6
UAS_XmlAnalysor/Properties/Settings.settings

@@ -1,7 +1,15 @@
 <?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>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="UAS_XmlAnalysor.Properties" GeneratedClassName="Settings">
+  <Profiles />
+  <Settings>
+    <Setting Name="MES" Type="System.String" Scope="User">
+      <Value Profile="(Default)">Password=select!#%*(;User ID=MES_TEST;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=117.25.180.218)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+    </Setting>
+    <Setting Name="FolderPath" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="BackUpFolderPath" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+  </Settings>
+</SettingsFile>

BIN
UAS_XmlAnalysor/Resources/xml_48px_1124003_easyicon.net.ico


+ 59 - 1
UAS_XmlAnalysor/UAS_XmlAnalysor.csproj

@@ -8,11 +8,34 @@
     <OutputType>WinExe</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>UAS_XmlAnalysor</RootNamespace>
-    <AssemblyName>UAS_XmlAnalysor</AssemblyName>
+    <AssemblyName>UAS_XML解析器</AssemblyName>
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <TargetFrameworkProfile />
+    <IsWebBootstrapper>true</IsWebBootstrapper>
+    <PublishUrl>ftp://192.168.253.9/MESSetting/Xml/</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Web</InstallFrom>
+    <UpdateEnabled>true</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <InstallUrl>http://218.17.158.219:8888/Xml/</InstallUrl>
+    <ProductName>UAS_XML解析器</ProductName>
+    <PublisherName>深圳市优软科技有限公司</PublisherName>
+    <SuiteName>UAS_XML解析器</SuiteName>
+    <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
+    <WebPage>publish.htm</WebPage>
+    <ApplicationRevision>3</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <CreateDesktopShortcut>true</CreateDesktopShortcut>
+    <PublishWizardCompleted>true</PublishWizardCompleted>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -33,6 +56,21 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
+  <PropertyGroup>
+    <ManifestCertificateThumbprint>8DBDB0F3546886069CF4A1A6A9E86032DE41A024</ManifestCertificateThumbprint>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ManifestKeyFile>UAS_XmlAnalysor_TemporaryKey.pfx</ManifestKeyFile>
+  </PropertyGroup>
+  <PropertyGroup>
+    <GenerateManifests>true</GenerateManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignManifests>true</SignManifests>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ApplicationIcon>Resources\xml_48px_1124003_easyicon.net.ico</ApplicationIcon>
+  </PropertyGroup>
   <ItemGroup>
     <Reference Include="Oracle.ManagedDataAccess">
       <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
@@ -57,11 +95,21 @@
     <Compile Include="Form1.Designer.cs">
       <DependentUpon>Form1.cs</DependentUpon>
     </Compile>
+    <Compile Include="LogicHandler.cs" />
+    <Compile Include="Login.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Login.Designer.cs">
+      <DependentUpon>Login.cs</DependentUpon>
+    </Compile>
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <EmbeddedResource Include="Form1.resx">
       <DependentUpon>Form1.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Login.resx">
+      <DependentUpon>Login.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Properties\Resources.resx">
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -85,6 +133,16 @@
   <ItemGroup>
     <None Include="App.config" />
   </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Resources\xml_48px_1124003_easyicon.net.ico" />
+  </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.

BIN
UAS_XmlAnalysor/tool/Oracle.ManagedDataAccess.dll