Browse Source

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

Hcsy 8 years ago
parent
commit
fe7f295673

+ 1 - 0
UAS-MES/CustomControl/TextBoxWithIcon/MaCodeSearchTextBox.Designer.cs

@@ -57,6 +57,7 @@
             this.TextBox.Lock = false;
             this.TextBox.Name = "TextBox";
             this.TextBox.Power = null;
+            this.TextBox.Size = new System.Drawing.Size(178, 28);
             this.TextBox.Size = new System.Drawing.Size(178, 21);
             this.TextBox.Str = null;
             this.TextBox.Str1 = null;

+ 25 - 26
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithTextArea.Designer.cs

@@ -28,51 +28,50 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.textBox1 = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
+            this.TextAreaTextBox = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
             this.TextAreaIcon = new System.Windows.Forms.PictureBox();
             ((System.ComponentModel.ISupportInitialize)(this.TextAreaIcon)).BeginInit();
             this.SuspendLayout();
             // 
-            // textBox1
+            // TextAreaTextBox
             // 
-            this.textBox1.AllPower = null;
-            this.textBox1.BackColor = System.Drawing.Color.White;
-            this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.textBox1.ID = null;
-            this.textBox1.Location = new System.Drawing.Point(0, 0);
-            this.textBox1.Lock = false;
-            this.textBox1.Margin = new System.Windows.Forms.Padding(4);
-            this.textBox1.Name = "textBox1";
-            this.textBox1.Power = null;
-            this.textBox1.Size = new System.Drawing.Size(265, 25);
-            this.textBox1.Str = null;
-            this.textBox1.Str1 = null;
-            this.textBox1.Str2 = null;
-            this.textBox1.TabIndex = 0;
-            this.textBox1.Enter += new System.EventHandler(this.textBox1_Enter);
-            this.textBox1.Leave += new System.EventHandler(this.textBox1_Leave);
+            this.TextAreaTextBox.AllPower = null;
+            this.TextAreaTextBox.BackColor = System.Drawing.Color.White;
+            this.TextAreaTextBox.Dock = System.Windows.Forms.DockStyle.Left;
+            this.TextAreaTextBox.ID = null;
+            this.TextAreaTextBox.Location = new System.Drawing.Point(0, 0);
+            this.TextAreaTextBox.Lock = false;
+            this.TextAreaTextBox.Name = "TextAreaTextBox";
+            this.TextAreaTextBox.Power = null;
+            this.TextAreaTextBox.Size = new System.Drawing.Size(173, 21);
+            this.TextAreaTextBox.Str = null;
+            this.TextAreaTextBox.Str1 = null;
+            this.TextAreaTextBox.Str2 = null;
+            this.TextAreaTextBox.TabIndex = 0;
+            this.TextAreaTextBox.Enter += new System.EventHandler(this.textBox1_Enter);
+            this.TextAreaTextBox.Leave += new System.EventHandler(this.textBox1_Leave);
             // 
             // TextAreaIcon
             // 
             this.TextAreaIcon.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.TextAreaIcon.Dock = System.Windows.Forms.DockStyle.Right;
             this.TextAreaIcon.Image = global::UAS_MES.Properties.Resources.notice_text_editor_16px_11373_easyicon_net;
-            this.TextAreaIcon.Location = new System.Drawing.Point(239, 1);
-            this.TextAreaIcon.Margin = new System.Windows.Forms.Padding(4);
+            this.TextAreaIcon.Location = new System.Drawing.Point(174, 0);
             this.TextAreaIcon.Name = "TextAreaIcon";
-            this.TextAreaIcon.Size = new System.Drawing.Size(25, 21);
+            this.TextAreaIcon.Size = new System.Drawing.Size(19, 21);
             this.TextAreaIcon.TabIndex = 1;
             this.TextAreaIcon.TabStop = false;
             this.TextAreaIcon.Click += new System.EventHandler(this.TextAreaIcon_Click);
             // 
             // TextBoxWithTextArea
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.TextAreaIcon);
-            this.Controls.Add(this.textBox1);
-            this.Margin = new System.Windows.Forms.Padding(4);
+            this.Controls.Add(this.TextAreaTextBox);
             this.Name = "TextBoxWithTextArea";
-            this.Size = new System.Drawing.Size(265, 25);
+            this.Size = new System.Drawing.Size(193, 21);
+            this.SizeChanged += new System.EventHandler(this.TextBoxWithTextArea_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.TextAreaIcon)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
@@ -81,7 +80,7 @@
 
         #endregion
 
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox textBox1;
+        private CustomControl.TextBoxWithIcon.MaCodeTextBox TextAreaTextBox;
         private System.Windows.Forms.PictureBox TextAreaIcon;
     }
 }

+ 9 - 4
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithTextArea.cs

@@ -16,11 +16,11 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         {
             get
             {
-                return textBox1.Text;
+                return TextAreaTextBox.Text;
             }
             set
             {
-                textBox1.Text = value;
+                TextAreaTextBox.Text = value;
             }
         }
 
@@ -68,12 +68,17 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         private void textBox1_Leave(object sender, EventArgs e)
         {
-            textBox1.BackColor = Color.White;
+            TextAreaTextBox.BackColor = Color.White;
         }
 
         private void textBox1_Enter(object sender, EventArgs e)
         {
-            textBox1.BackColor = Color.GreenYellow;
+            TextAreaTextBox.BackColor = Color.GreenYellow;
+        }
+
+        private void TextBoxWithTextArea_SizeChanged(object sender, EventArgs e)
+        {
+            TextAreaTextBox.Width = this.Width - TextAreaIcon.Width - 3;
         }
     }
 }

+ 4 - 6
UAS-MES/FunctionCode/Employee/Employee_ChooseUserToGroup.Designer.cs

@@ -39,8 +39,8 @@
             this.em_code2_label = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.ug_name_title_label = new System.Windows.Forms.Label();
-            this.em_name3 = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
-            this.em_name2 = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
+            this.em_name3 = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.em_name2 = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ScreenOutGroup = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ScreenInGroup = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.OutGroupUser = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
@@ -178,7 +178,6 @@
             this.em_name3.BackColor = System.Drawing.Color.White;
             this.em_name3.ID = null;
             this.em_name3.Location = new System.Drawing.Point(153, 135);
-            this.em_name3.Lock = false;
             this.em_name3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.em_name3.Name = "em_name3";
             this.em_name3.Power = null;
@@ -195,7 +194,6 @@
             this.em_name2.BackColor = System.Drawing.Color.White;
             this.em_name2.ID = null;
             this.em_name2.Location = new System.Drawing.Point(772, 130);
-            this.em_name2.Lock = false;
             this.em_name2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.em_name2.Name = "em_name2";
             this.em_name2.Power = null;
@@ -464,8 +462,8 @@
         private System.Windows.Forms.Label label6;
         private CustomControl.ButtonUtil.NormalButton ScreenInGroup;
         private CustomControl.ButtonUtil.NormalButton ScreenOutGroup;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox em_name2;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox em_name3;
+        private CustomControl.TextBoxWithIcon.EnterTextBox em_name2;
+        private CustomControl.TextBoxWithIcon.EnterTextBox em_name3;
         private System.Windows.Forms.Label ug_name_title_label;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_code1;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_name1;

+ 8 - 8
UAS-MES/FunctionCode/Employee/Employee_Data.Designer.cs

@@ -38,14 +38,14 @@
             this.em_email = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.em_mobile = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Screen = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.em_code11 = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
-            this.em_name11 = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
+            this.em_code11 = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.em_name11 = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.em_name_label = new System.Windows.Forms.Label();
             this.em_code_label = new System.Windows.Forms.Label();
             this.pagination1 = new UAS_MES.CustomControl.Pagination.PaginationDbFind();
-            this.em_depart1 = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
+            this.em_depart1 = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label1 = new System.Windows.Forms.Label();
-            this.em_position1 = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
+            this.em_position1 = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.label2 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.Employee)).BeginInit();
             this.SuspendLayout();
@@ -290,14 +290,14 @@
 
         private CustomControl.DataGrid_View.DataGridViewWithSerialNum Employee;
         private CustomControl.ButtonUtil.NormalButton Screen;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox em_code11;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox em_name11;
+        private CustomControl.TextBoxWithIcon.EnterTextBox em_code11;
+        private CustomControl.TextBoxWithIcon.EnterTextBox em_name11;
         private System.Windows.Forms.Label em_name_label;
         private System.Windows.Forms.Label em_code_label;
         private CustomControl.Pagination.PaginationDbFind pagination1;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox em_depart1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox em_depart1;
         private System.Windows.Forms.Label label1;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox em_position1;
+        private CustomControl.TextBoxWithIcon.EnterTextBox em_position1;
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_code;
         private System.Windows.Forms.DataGridViewTextBoxColumn em_name;

+ 4 - 4
UAS-MES/FunctionCode/Employee/Employee_NewGroup.Designer.cs

@@ -34,8 +34,8 @@
             this.ug_code_label = new System.Windows.Forms.Label();
             this.ug_name_label = new System.Windows.Forms.Label();
             this.SaveGroup = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ug_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
-            this.ug_name = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeTextBox();
+            this.ug_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ug_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SuspendLayout();
             // 
             // headBar1
@@ -159,7 +159,7 @@
         private System.Windows.Forms.Label ug_code_label;
         private System.Windows.Forms.Label ug_name_label;
         private CustomControl.ButtonUtil.NormalButton SaveGroup;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox ug_code;
-        private CustomControl.TextBoxWithIcon.MaCodeTextBox ug_name;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ug_code;
+        private CustomControl.TextBoxWithIcon.EnterTextBox ug_name;
     }
 }

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_NewBadCode.cs

@@ -154,6 +154,11 @@ namespace UAS_MES.Make
 
         private void Save_Click(object sender, EventArgs e)
         {
+            if (ms_sncode.Text == "" || ms_makecode.Text == "")
+            {
+                MessageBox.Show("序列号和工单号不允许为空");
+                return;
+            }
             int RejectCount = ChoosedRejectList.Items.Count;
             string[] bccode = new string[RejectCount];
             string[] bcremark = new string[RejectCount];
@@ -182,7 +187,7 @@ namespace UAS_MES.Make
             sql.Append("select :id,ma_code,ms_code,ms_sncode,'" + User.UserName + "',sysdate,'" + User.CurrentStepCode + "',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='" + sncode + "'");
-            dh.BatchInsert(sql.GetString(), new string[] { "bg_code","id", "bg_code", "bc_code", "bc_remark" }, bgcode, id, bgcode, bccode, bcremark);
+            dh.BatchInsert(sql.GetString(), new string[] { "bg_code", "id", "bg_code", "bc_code", "bc_remark" }, bgcode, id, bgcode, bccode, bcremark);
             MessageBox.Show("保存成功");
             Close();
         }

+ 42 - 36
UAS-MES/FunctionCode/Make/Make_NewMatainInf.Designer.cs

@@ -68,9 +68,10 @@
             listViewItem1,
             listViewItem2,
             listViewItem3});
-            this.mbc_component_lsv.Location = new System.Drawing.Point(12, 159);
+            this.mbc_component_lsv.Location = new System.Drawing.Point(9, 127);
+            this.mbc_component_lsv.Margin = new System.Windows.Forms.Padding(2);
             this.mbc_component_lsv.Name = "mbc_component_lsv";
-            this.mbc_component_lsv.Size = new System.Drawing.Size(291, 190);
+            this.mbc_component_lsv.Size = new System.Drawing.Size(219, 153);
             this.mbc_component_lsv.TabIndex = 1;
             this.mbc_component_lsv.UseCompatibleStateImageBehavior = false;
             this.mbc_component_lsv.View = System.Windows.Forms.View.Details;
@@ -89,9 +90,10 @@
             this.nrg_name_lsv.Cursor = System.Windows.Forms.Cursors.Default;
             this.nrg_name_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nrg_name_lsv.FullRowSelect = true;
-            this.nrg_name_lsv.Location = new System.Drawing.Point(309, 159);
+            this.nrg_name_lsv.Location = new System.Drawing.Point(232, 127);
+            this.nrg_name_lsv.Margin = new System.Windows.Forms.Padding(2);
             this.nrg_name_lsv.Name = "nrg_name_lsv";
-            this.nrg_name_lsv.Size = new System.Drawing.Size(264, 190);
+            this.nrg_name_lsv.Size = new System.Drawing.Size(199, 153);
             this.nrg_name_lsv.TabIndex = 2;
             this.nrg_name_lsv.UseCompatibleStateImageBehavior = false;
             this.nrg_name_lsv.View = System.Windows.Forms.View.Details;
@@ -99,7 +101,7 @@
             // 
             // nrg_code
             // 
-            this.nrg_code.Text = "";
+            this.nrg_code.Text = "不良原因组代码";
             this.nrg_code.Width = 0;
             // 
             // nrg_name
@@ -115,9 +117,10 @@
             this.nr_groupcode});
             this.nr_name_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nr_name_lsv.FullRowSelect = true;
-            this.nr_name_lsv.Location = new System.Drawing.Point(581, 159);
+            this.nr_name_lsv.Location = new System.Drawing.Point(436, 127);
+            this.nr_name_lsv.Margin = new System.Windows.Forms.Padding(2);
             this.nr_name_lsv.Name = "nr_name_lsv";
-            this.nr_name_lsv.Size = new System.Drawing.Size(241, 381);
+            this.nr_name_lsv.Size = new System.Drawing.Size(182, 306);
             this.nr_name_lsv.TabIndex = 3;
             this.nr_name_lsv.UseCompatibleStateImageBehavior = false;
             this.nr_name_lsv.View = System.Windows.Forms.View.Details;
@@ -125,6 +128,7 @@
             // 
             // nr_code
             // 
+            this.nr_code.Text = "不良原因代码";
             this.nr_code.Width = 0;
             // 
             // nr_name
@@ -143,9 +147,10 @@
             this.nd_name});
             this.mbr_dutycode_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_dutycode_lsv.FullRowSelect = true;
-            this.mbr_dutycode_lsv.Location = new System.Drawing.Point(12, 355);
+            this.mbr_dutycode_lsv.Location = new System.Drawing.Point(9, 284);
+            this.mbr_dutycode_lsv.Margin = new System.Windows.Forms.Padding(2);
             this.mbr_dutycode_lsv.Name = "mbr_dutycode_lsv";
-            this.mbr_dutycode_lsv.Size = new System.Drawing.Size(291, 185);
+            this.mbr_dutycode_lsv.Size = new System.Drawing.Size(219, 149);
             this.mbr_dutycode_lsv.TabIndex = 5;
             this.mbr_dutycode_lsv.UseCompatibleStateImageBehavior = false;
             this.mbr_dutycode_lsv.View = System.Windows.Forms.View.Details;
@@ -168,9 +173,10 @@
             this.so_name});
             this.mbr_solutioncode_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mbr_solutioncode_lsv.FullRowSelect = true;
-            this.mbr_solutioncode_lsv.Location = new System.Drawing.Point(309, 355);
+            this.mbr_solutioncode_lsv.Location = new System.Drawing.Point(232, 284);
+            this.mbr_solutioncode_lsv.Margin = new System.Windows.Forms.Padding(2);
             this.mbr_solutioncode_lsv.Name = "mbr_solutioncode_lsv";
-            this.mbr_solutioncode_lsv.Size = new System.Drawing.Size(264, 185);
+            this.mbr_solutioncode_lsv.Size = new System.Drawing.Size(199, 149);
             this.mbr_solutioncode_lsv.TabIndex = 6;
             this.mbr_solutioncode_lsv.UseCompatibleStateImageBehavior = false;
             this.mbr_solutioncode_lsv.View = System.Windows.Forms.View.Details;
@@ -193,12 +199,13 @@
             this.Cancel.DownImage = ((System.Drawing.Image)(resources.GetObject("Cancel.DownImage")));
             this.Cancel.Image = null;
             this.Cancel.IsShowBorder = true;
-            this.Cancel.Location = new System.Drawing.Point(435, 563);
+            this.Cancel.Location = new System.Drawing.Point(326, 450);
+            this.Cancel.Margin = new System.Windows.Forms.Padding(2);
             this.Cancel.MoveImage = ((System.Drawing.Image)(resources.GetObject("Cancel.MoveImage")));
             this.Cancel.Name = "Cancel";
             this.Cancel.NormalImage = ((System.Drawing.Image)(resources.GetObject("Cancel.NormalImage")));
             this.Cancel.Power = null;
-            this.Cancel.Size = new System.Drawing.Size(80, 35);
+            this.Cancel.Size = new System.Drawing.Size(60, 28);
             this.Cancel.TabIndex = 58;
             this.Cancel.Text = "取消";
             this.Cancel.UseVisualStyleBackColor = false;
@@ -211,12 +218,13 @@
             this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
             this.Save.Image = null;
             this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(317, 563);
+            this.Save.Location = new System.Drawing.Point(238, 450);
+            this.Save.Margin = new System.Windows.Forms.Padding(2);
             this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
             this.Save.Name = "Save";
             this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
             this.Save.Power = null;
-            this.Save.Size = new System.Drawing.Size(80, 35);
+            this.Save.Size = new System.Drawing.Size(60, 28);
             this.Save.TabIndex = 57;
             this.Save.Text = "保存";
             this.Save.UseVisualStyleBackColor = false;
@@ -231,9 +239,11 @@
             this.groupBoxWithBorder1.Controls.Add(this.bg_name_label);
             this.groupBoxWithBorder1.Dock = System.Windows.Forms.DockStyle.Top;
             this.groupBoxWithBorder1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.groupBoxWithBorder1.Location = new System.Drawing.Point(0, 40);
+            this.groupBoxWithBorder1.Location = new System.Drawing.Point(0, 32);
+            this.groupBoxWithBorder1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBoxWithBorder1.Name = "groupBoxWithBorder1";
-            this.groupBoxWithBorder1.Size = new System.Drawing.Size(832, 100);
+            this.groupBoxWithBorder1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBoxWithBorder1.Size = new System.Drawing.Size(624, 80);
             this.groupBoxWithBorder1.TabIndex = 4;
             this.groupBoxWithBorder1.TabStop = false;
             this.groupBoxWithBorder1.Text = "工单信息";
@@ -242,18 +252,17 @@
             // bc_name
             // 
             this.bc_name.AllPower = null;
-            this.bc_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            this.bc_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
             | System.Windows.Forms.AnchorStyles.Left)));
             this.bc_name.BackColor = System.Drawing.Color.White;
             this.bc_name.Enabled = false;
             this.bc_name.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_name.ForeColor = System.Drawing.Color.Black;
             this.bc_name.ID = null;
-            this.bc_name.Location = new System.Drawing.Point(538, 42);
-            this.bc_name.Margin = new System.Windows.Forms.Padding(4);
+            this.bc_name.Location = new System.Drawing.Point(404, 34);
             this.bc_name.Name = "bc_name";
             this.bc_name.Power = null;
-            this.bc_name.Size = new System.Drawing.Size(187, 27);
+            this.bc_name.Size = new System.Drawing.Size(141, 23);
             this.bc_name.Str = null;
             this.bc_name.Str1 = null;
             this.bc_name.Str2 = null;
@@ -264,28 +273,26 @@
             // 
             this.bc_name_label.AutoSize = true;
             this.bc_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bc_name_label.Location = new System.Drawing.Point(411, 42);
-            this.bc_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.bc_name_label.Location = new System.Drawing.Point(308, 34);
             this.bc_name_label.Name = "bc_name_label";
-            this.bc_name_label.Size = new System.Drawing.Size(92, 27);
+            this.bc_name_label.Size = new System.Drawing.Size(74, 21);
             this.bc_name_label.TabIndex = 101;
             this.bc_name_label.Text = "不良代码";
             // 
             // bg_name
             // 
             this.bg_name.AllPower = null;
-            this.bg_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            this.bg_name.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
             | System.Windows.Forms.AnchorStyles.Left)));
             this.bg_name.BackColor = System.Drawing.Color.White;
             this.bg_name.Enabled = false;
             this.bg_name.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bg_name.ForeColor = System.Drawing.Color.Black;
             this.bg_name.ID = null;
-            this.bg_name.Location = new System.Drawing.Point(170, 42);
-            this.bg_name.Margin = new System.Windows.Forms.Padding(4);
+            this.bg_name.Location = new System.Drawing.Point(128, 34);
             this.bg_name.Name = "bg_name";
             this.bg_name.Power = null;
-            this.bg_name.Size = new System.Drawing.Size(187, 27);
+            this.bg_name.Size = new System.Drawing.Size(141, 23);
             this.bg_name.Str = null;
             this.bg_name.Str1 = null;
             this.bg_name.Str2 = null;
@@ -296,10 +303,9 @@
             // 
             this.bg_name_label.AutoSize = true;
             this.bg_name_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bg_name_label.Location = new System.Drawing.Point(25, 42);
-            this.bg_name_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.bg_name_label.Location = new System.Drawing.Point(19, 34);
             this.bg_name_label.Name = "bg_name_label";
-            this.bg_name_label.Size = new System.Drawing.Size(112, 27);
+            this.bg_name_label.Size = new System.Drawing.Size(90, 21);
             this.bg_name_label.TabIndex = 99;
             this.bg_name_label.Text = "不良代码组";
             // 
@@ -308,17 +314,16 @@
             this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
             this.headBar1.Location = new System.Drawing.Point(0, 0);
-            this.headBar1.Margin = new System.Windows.Forms.Padding(4);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(832, 40);
+            this.headBar1.Size = new System.Drawing.Size(624, 32);
             this.headBar1.TabIndex = 0;
             this.headBar1.Title = "新增维修信息";
             // 
             // Make_NewMatainInf
             // 
-            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(832, 610);
+            this.ClientSize = new System.Drawing.Size(624, 488);
             this.Controls.Add(this.Cancel);
             this.Controls.Add(this.Save);
             this.Controls.Add(this.mbr_solutioncode_lsv);
@@ -329,6 +334,7 @@
             this.Controls.Add(this.mbc_component_lsv);
             this.Controls.Add(this.headBar1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Make_NewMatainInf";
             this.Tag = "ShowDialogWindow";
             this.Text = "Make_NewMatainInf";
@@ -358,11 +364,11 @@
         private System.Windows.Forms.ColumnHeader nd_code;
         private System.Windows.Forms.ColumnHeader so_code;
         private System.Windows.Forms.ColumnHeader nr_name;
-        private System.Windows.Forms.ColumnHeader nrg_code;
         private System.Windows.Forms.ColumnHeader nr_code;
         private System.Windows.Forms.ColumnHeader nr_groupcode;
         private System.Windows.Forms.ColumnHeader nd_name;
         private System.Windows.Forms.ColumnHeader so_name;
         private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.ColumnHeader nrg_code;
     }
 }

+ 17 - 21
UAS-MES/FunctionCode/Make/Make_NewMatainInf.cs

@@ -107,10 +107,9 @@ namespace UAS_MES.Make
             lsv.BeginUpdate();
             for (int i = 0; i < dt.Rows.Count; i++)
             {
-                ListViewItem lvi = new ListViewItem();
+                ListViewItem lvi = new ListViewItem(dt.Rows[i][0].ToString());
                 //第一列是勾选列,设置列头文本为空
-                lvi.Text = "";
-                for (int j = 0; j < dt.Columns.Count; j++)
+                for (int j = 1; j < dt.Columns.Count; j++)
                     lvi.SubItems.Add(dt.Rows[i][j].ToString());
                 lsv.Items.Add(lvi);
             }
@@ -136,18 +135,21 @@ namespace UAS_MES.Make
 
         private string GetListViewSelectedItemText(ListView lsv)
         {
-            string Text = "";
-            //已存在在ListView中的Item是不能添加到其他ListView中的,需要调用其克隆的方法
             for (int i = lsv.Items.Count - 1; i >= 0; i--)
             {
                 if (lsv.Items[i].Selected)
-                    Text = lsv.Items[i].SubItems[0].Text;
+                    return lsv.Items[i].SubItems[0].Text;
             }
-            return Text;
+            return null;
         }
 
         private void Save_Click(object sender, EventArgs e)
         {
+            if (bg_name.Text == "" || bc_name.Text == "")
+            {
+                MessageBox.Show("不良代码组和不良代码不能为空");
+                return;
+            }
             string[] mbc_component = new string[GetListViewCheckCount(mbc_component_lsv)];
             string[] nrg_name = new string[GetListViewCheckCount(nrg_name_lsv)];
             string[] nr_name = new string[GetListViewCheckCount(nr_name_lsv)];
@@ -166,28 +168,22 @@ namespace UAS_MES.Make
             {
                 ErrorMessage = "";
                 string mbccomponent = GetListViewSelectedItemText(mbc_component_lsv);
-                string nrgname = GetListViewSelectedItemText(nrg_name_lsv);
-                string nrname = GetListViewSelectedItemText(nr_name_lsv);
+                string nrgcode = GetListViewSelectedItemText(nrg_name_lsv);
+                string nrcode = GetListViewSelectedItemText(nr_name_lsv);
                 string mbrdutycode = GetListViewSelectedItemText(mbr_dutycode_lsv);
                 string mbrsolutioncode = GetListViewSelectedItemText(mbr_solutioncode_lsv);
-                Console.WriteLine(mbccomponent);
-                Console.WriteLine(nrgname);
-                Console.WriteLine(nrname);
-                Console.WriteLine(mbrdutycode);
-                Console.WriteLine(mbrsolutioncode);
                 dt = (DataTable)dh.ExecuteSql("select ms_makecode from makeserial where ms_id='" + msid + "' and ms_sncode='" + sncode + "' and ms_status=3", "select");
                 if (dt.Rows.Count > 0)
                 {
                     string macode = dt.Rows[0]["ms_makecode"].ToString();
+                    string mbr_id = dh.GetSEQ("makebadreason_seq");
                     if (!dh.CheckExist("makebadreason", "mbr_sncode='" + sncode + "' and mbr_badcode='" + bccode + "' "))
                     {
-                        string mbr_id = dh.GetSEQ("makebadreason_seq");
                         sql.Clear();
                         sql.Append("insert into makebadreason (mbr_mbid,mbr_id,mbr_brcode,mbr_solutioncode,");
                         sql.Append("mbr_dutycode,mbr_brgcode,mbr_badcode,mbr_sncode,mbr_makecode,mbr_indate,");
-                        sql.Append("mbr_inman) select '" + mbid + "'," + mbr_id + ",'" + nrgname + "',");
-                        sql.Append("'" + mbrsolutioncode + "','" + mbrdutycode + "','" + nrgname + "','" + bccode
-                            + "',");
+                        sql.Append("mbr_inman) select '" + mbid + "','" + mbr_id + "','" + nrcode + "',");
+                        sql.Append("'" + mbrsolutioncode + "','" + mbrdutycode + "','" + nrgcode + "','" + bccode + "',");
                         sql.Append("'" + sncode + "','" + macode + "',sysdate,'" + User.UserCode + "' from dual");
                         dh.ExecuteSql(sql.GetString(), "insert");
                     }
@@ -199,8 +195,8 @@ namespace UAS_MES.Make
                             sql.Clear();
                             sql.Append("insert into makebadrscom (mbc_id,mbc_mbrid,mbc_component,mbc_badcode,");
                             sql.Append("mbc_brcode,mbc_sncode,mbc_makecode,mbc_indate,mbc_inman ) values ");
-                            sql.Append("(makebadrscom_seq.nextval,'" + mbid + "' ,'" + mbccomponent + "',");
-                            sql.Append("'" + bccode + "','" + nrname + "','" + sncode + "','" + macode + "',sysdate,'" + User.UserCode + "')");
+                            sql.Append("(makebadrscom_seq.nextval,'" + mbr_id + "' ,'" + mbccomponent + "',");
+                            sql.Append("'" + bccode + "','" + nrcode + "','" + sncode + "','" + macode + "',sysdate,'" + User.UserCode + "')");
                             dh.ExecuteSql(sql.GetString(), "insert");
                         }
                         else ErrorMessage += "序列号" + sncode + "已存在不良组件" + mbccomponent;
@@ -218,7 +214,7 @@ namespace UAS_MES.Make
         }
 
         private void ListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
-        { 
+        {
             e.Item.BackColor = Color.LightBlue;
             foreach (ListViewItem item in (sender as ListView).Items)
             {

+ 21 - 105
UAS-MES/FunctionCode/Make/Make_NewPallet.Designer.cs

@@ -44,17 +44,9 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-
-            this.pr_code_label.Location = new System.Drawing.Point(28, 90);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pr_code_label.Name = "pr_code_label";
-            this.pr_code_label.Size = new System.Drawing.Size(110, 31);
-
-            this.pr_code_label.Location = new System.Drawing.Point(25, 75);
-            this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_code_label.Location = new System.Drawing.Point(19, 60);
             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 = 0;
             this.pr_code_label.Text = "产品编号";
             // 
@@ -62,17 +54,9 @@
             // 
             this.pa_packageqty_label.AutoSize = true;
             this.pa_packageqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-
-            this.pa_packageqty_label.Location = new System.Drawing.Point(28, 158);
-            this.pa_packageqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_packageqty_label.Name = "pa_packageqty_label";
-            this.pa_packageqty_label.Size = new System.Drawing.Size(110, 31);
-
-            this.pa_packageqty_label.Location = new System.Drawing.Point(25, 131);
-            this.pa_packageqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_packageqty_label.Location = new System.Drawing.Point(19, 105);
             this.pa_packageqty_label.Name = "pa_packageqty_label";
-            this.pa_packageqty_label.Size = new System.Drawing.Size(92, 27);
-
+            this.pa_packageqty_label.Size = new System.Drawing.Size(74, 21);
             this.pa_packageqty_label.TabIndex = 1;
             this.pa_packageqty_label.Text = "箱内数量";
             // 
@@ -80,17 +64,9 @@
             // 
             this.pa_outboxcode_label.AutoSize = true;
             this.pa_outboxcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-
-            this.pa_outboxcode_label.Location = new System.Drawing.Point(28, 226);
-            this.pa_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.pa_outboxcode_label.Name = "pa_outboxcode_label";
-            this.pa_outboxcode_label.Size = new System.Drawing.Size(62, 31);
-
-            this.pa_outboxcode_label.Location = new System.Drawing.Point(25, 189);
-            this.pa_outboxcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pa_outboxcode_label.Location = new System.Drawing.Point(19, 151);
             this.pa_outboxcode_label.Name = "pa_outboxcode_label";
-            this.pa_outboxcode_label.Size = new System.Drawing.Size(52, 27);
-
+            this.pa_outboxcode_label.Size = new System.Drawing.Size(42, 21);
             this.pa_outboxcode_label.TabIndex = 2;
             this.pa_outboxcode_label.Text = "箱号";
             // 
@@ -100,35 +76,18 @@
             this.title.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.title.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.title.ForeColor = System.Drawing.SystemColors.ButtonFace;
-
-            this.title.Location = new System.Drawing.Point(10, 9);
-            this.title.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.title.Location = new System.Drawing.Point(7, 6);
             this.title.Name = "title";
-            this.title.Size = new System.Drawing.Size(0, 31);
-
-            this.title.Location = new System.Drawing.Point(9, 8);
-            this.title.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.title.Name = "title";
-            this.title.Size = new System.Drawing.Size(0, 27);
-
+            this.title.Size = new System.Drawing.Size(0, 21);
             this.title.TabIndex = 9;
             // 
             // pa_outboxcode
             // 
             this.pa_outboxcode.ErrorMsg = null;
-
-            this.pa_outboxcode.Location = new System.Drawing.Point(142, 226);
-            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(6);
-            this.pa_outboxcode.Name = "pa_outboxcode";
-            this.pa_outboxcode.Pr_id = null;
-            this.pa_outboxcode.Size = new System.Drawing.Size(212, 32);
-
-            this.pa_outboxcode.Location = new System.Drawing.Point(128, 189);
-            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.pa_outboxcode.Location = new System.Drawing.Point(96, 151);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Pr_id = null;
-            this.pa_outboxcode.Size = new System.Drawing.Size(206, 26);
-
+            this.pa_outboxcode.Size = new System.Drawing.Size(176, 21);
             this.pa_outboxcode.TabIndex = 10;
             // 
             // headBar1
@@ -136,36 +95,22 @@
             this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
             this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
             this.headBar1.Location = new System.Drawing.Point(0, 0);
-
-            this.headBar1.Margin = new System.Windows.Forms.Padding(6);
+            this.headBar1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(448, 48);
-
-            this.headBar1.Margin = new System.Windows.Forms.Padding(5);
-            this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(399, 40);
-
+            this.headBar1.Size = new System.Drawing.Size(299, 32);
             this.headBar1.TabIndex = 7;
+            this.headBar1.Title = null;
             // 
             // pa_packageqty
             // 
             this.pa_packageqty.AllPower = null;
             this.pa_packageqty.BackColor = System.Drawing.Color.White;
             this.pa_packageqty.ID = null;
-
-            this.pa_packageqty.Location = new System.Drawing.Point(144, 158);
-
-            this.pa_packageqty.Location = new System.Drawing.Point(128, 131);
-
-            this.pa_packageqty.Margin = new System.Windows.Forms.Padding(4);
+            this.pa_packageqty.Location = new System.Drawing.Point(96, 105);
             this.pa_packageqty.Name = "pa_packageqty";
             this.pa_packageqty.Negative = false;
             this.pa_packageqty.Power = null;
-
-            this.pa_packageqty.Size = new System.Drawing.Size(264, 28);
-
-            this.pa_packageqty.Size = new System.Drawing.Size(206, 25);
-
+            this.pa_packageqty.Size = new System.Drawing.Size(156, 21);
             this.pa_packageqty.Str = null;
             this.pa_packageqty.Str1 = null;
             this.pa_packageqty.Str2 = null;
@@ -178,21 +123,12 @@
             this.pr_code.Condition = null;
             this.pr_code.DBTitle = "产品编号查询";
             this.pr_code.FormName = null;
-
-            this.pr_code.Location = new System.Drawing.Point(142, 90);
-
-            this.pr_code.Location = new System.Drawing.Point(128, 75);
-
-            this.pr_code.Margin = new System.Windows.Forms.Padding(4);
+            this.pr_code.Location = new System.Drawing.Point(96, 60);
             this.pr_code.Name = "pr_code";
             this.pr_code.Power = "ifread";
             this.pr_code.SelectField = null;
             this.pr_code.SetValueField = null;
-
-            this.pr_code.Size = new System.Drawing.Size(224, 32);
-
-            this.pr_code.Size = new System.Drawing.Size(206, 26);
-
+            this.pr_code.Size = new System.Drawing.Size(176, 21);
             this.pr_code.TabIndex = 4;
             this.pr_code.TableName = null;
             this.pr_code.TextBoxEnable = false;
@@ -205,21 +141,12 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = null;
             this.Confirm.IsShowBorder = true;
-
-            this.Confirm.Location = new System.Drawing.Point(184, 284);
-
-            this.Confirm.Location = new System.Drawing.Point(164, 236);
-
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4);
+            this.Confirm.Location = new System.Drawing.Point(123, 189);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = null;
-
-            this.Confirm.Size = new System.Drawing.Size(80, 34);
-
-            this.Confirm.Size = new System.Drawing.Size(71, 29);
-
+            this.Confirm.Size = new System.Drawing.Size(53, 23);
             this.Confirm.TabIndex = 3;
             this.Confirm.Tag = "Make!NewPallet";
             this.Confirm.Text = "确认";
@@ -228,15 +155,9 @@
             // 
             // Make_NewPallet
             // 
-
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(448, 336);
-
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(399, 280);
-
+            this.ClientSize = new System.Drawing.Size(299, 224);
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.title);
             this.Controls.Add(this.headBar1);
@@ -247,11 +168,6 @@
             this.Controls.Add(this.pa_packageqty_label);
             this.Controls.Add(this.pr_code_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-
-            this.Margin = new System.Windows.Forms.Padding(4);
-
             this.Name = "Make_NewPallet";
             this.Tag = "ShowDialogWindow";
             this.Text = "新增栈板";

+ 39 - 36
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -58,6 +58,8 @@
             this.bc_code = new System.Windows.Forms.Label();
             this.bg_code = new System.Windows.Forms.Label();
             this.nr_code = new System.Windows.Forms.Label();
+            this.mb_badremark = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithTextArea();
+            this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.mbp_partdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
             this.mbp_part1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -78,7 +80,6 @@
             this.nrg_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bc_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bg_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.mb_badremark = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithTextArea();
             this.OperatResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -90,7 +91,6 @@
             this.SaveBadLocation = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Scrap = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.RepairComplete = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
@@ -304,7 +304,7 @@
             // 
             this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.panel1.Location = new System.Drawing.Point(163, 280);
-            this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(829, 2);
             this.panel1.TabIndex = 108;
@@ -326,7 +326,7 @@
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.ForeColor = System.Drawing.Color.Black;
-            this.label2.Location = new System.Drawing.Point(12, 125);
+            this.label2.Location = new System.Drawing.Point(12, 127);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(74, 22);
             this.label2.TabIndex = 117;
@@ -336,7 +336,7 @@
             // 
             this.panel3.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.panel3.Location = new System.Drawing.Point(1, 117);
-            this.panel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel3.Margin = new System.Windows.Forms.Padding(2);
             this.panel3.Name = "panel3";
             this.panel3.Size = new System.Drawing.Size(990, 2);
             this.panel3.TabIndex = 109;
@@ -345,7 +345,7 @@
             // 
             this.BadCodeTree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.BadCodeTree.Location = new System.Drawing.Point(16, 154);
-            this.BadCodeTree.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.BadCodeTree.Margin = new System.Windows.Forms.Padding(2);
             this.BadCodeTree.Name = "BadCodeTree";
             this.BadCodeTree.Size = new System.Drawing.Size(146, 426);
             this.BadCodeTree.TabIndex = 118;
@@ -384,6 +384,24 @@
             this.nr_code.TabIndex = 125;
             this.nr_code.Visible = false;
             // 
+            // mb_badremark
+            // 
+            this.mb_badremark.Location = new System.Drawing.Point(822, 154);
+            this.mb_badremark.Name = "mb_badremark";
+            this.mb_badremark.Size = new System.Drawing.Size(161, 21);
+            this.mb_badremark.TabIndex = 127;
+            // 
+            // ms_sncode
+            // 
+            this.ms_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+            this.ms_sncode.AutoSize = true;
+            this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_sncode.Location = new System.Drawing.Point(94, 41);
+            this.ms_sncode.Name = "ms_sncode";
+            this.ms_sncode.Size = new System.Drawing.Size(0, 21);
+            this.ms_sncode.TabIndex = 126;
+            // 
             // prodcode
             // 
             this.prodcode.AllPower = null;
@@ -392,12 +410,12 @@
             this.prodcode.DBTitle = null;
             this.prodcode.FormName = null;
             this.prodcode.Location = new System.Drawing.Point(560, 299);
-            this.prodcode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.prodcode.Margin = new System.Windows.Forms.Padding(2);
             this.prodcode.Name = "prodcode";
             this.prodcode.Power = null;
             this.prodcode.SelectField = null;
             this.prodcode.SetValueField = null;
-            this.prodcode.Size = new System.Drawing.Size(157, 21);
+            this.prodcode.Size = new System.Drawing.Size(165, 21);
             this.prodcode.TabIndex = 124;
             this.prodcode.TableName = null;
             this.prodcode.TextBoxEnable = true;
@@ -411,7 +429,7 @@
             this.mbp_part1,
             this.mbp_id});
             this.mbp_partdgv.Location = new System.Drawing.Point(485, 335);
-            this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbp_partdgv.Name = "mbp_partdgv";
             this.mbp_partdgv.RowTemplate.Height = 27;
             this.mbp_partdgv.Size = new System.Drawing.Size(270, 152);
@@ -423,6 +441,7 @@
             this.mbp_part1.DataPropertyName = "mbp_part";
             this.mbp_part1.HeaderText = "已选择不良零件";
             this.mbp_part1.Name = "mbp_part1";
+            this.mbp_part1.ReadOnly = true;
             // 
             // mbp_id
             // 
@@ -439,7 +458,7 @@
             this.mbl_loc1,
             this.mbl_id});
             this.mbl_locdgv.Location = new System.Drawing.Point(186, 335);
-            this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbl_locdgv.Name = "mbl_locdgv";
             this.mbl_locdgv.RowTemplate.Height = 27;
             this.mbl_locdgv.Size = new System.Drawing.Size(270, 152);
@@ -451,6 +470,7 @@
             this.mbl_loc1.DataPropertyName = "mbl_loc";
             this.mbl_loc1.HeaderText = "已选择不良位置";
             this.mbl_loc1.Name = "mbl_loc1";
+            this.mbl_loc1.ReadOnly = true;
             // 
             // mbl_id
             // 
@@ -464,11 +484,12 @@
             this.RefreshTreeView.AllPower = null;
             this.RefreshTreeView.Cursor = System.Windows.Forms.Cursors.Hand;
             this.RefreshTreeView.Image = global::UAS_MES.Properties.Resources.refresh;
-            this.RefreshTreeView.Location = new System.Drawing.Point(84, 126);
-            this.RefreshTreeView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.RefreshTreeView.Location = new System.Drawing.Point(89, 128);
+            this.RefreshTreeView.Margin = new System.Windows.Forms.Padding(2);
             this.RefreshTreeView.Name = "RefreshTreeView";
             this.RefreshTreeView.Power = null;
-            this.RefreshTreeView.Size = new System.Drawing.Size(20, 22);
+            this.RefreshTreeView.Size = new System.Drawing.Size(20, 20);
+            this.RefreshTreeView.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
             this.RefreshTreeView.TabIndex = 119;
             this.RefreshTreeView.TabStop = false;
             this.RefreshTreeView.Click += new System.EventHandler(this.RefreshTreeView_Click);
@@ -498,7 +519,7 @@
             this.NewRepairInf.DownImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.DownImage")));
             this.NewRepairInf.Image = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.Image")));
             this.NewRepairInf.IsShowBorder = true;
-            this.NewRepairInf.Location = new System.Drawing.Point(296, 502);
+            this.NewRepairInf.Location = new System.Drawing.Point(298, 502);
             this.NewRepairInf.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.MoveImage")));
             this.NewRepairInf.Name = "NewRepairInf";
             this.NewRepairInf.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewRepairInf.NormalImage")));
@@ -695,13 +716,6 @@
             this.bg_name.TabIndex = 91;
             this.bg_name.Tag = "Read";
             // 
-            // mb_badremark
-            // 
-            this.mb_badremark.Location = new System.Drawing.Point(820, 155);
-            this.mb_badremark.Name = "mb_badremark";
-            this.mb_badremark.Size = new System.Drawing.Size(140, 20);
-            this.mb_badremark.TabIndex = 90;
-            // 
             // OperatResult
             // 
             this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -751,7 +765,7 @@
             this.Clean.DownImage = ((System.Drawing.Image)(resources.GetObject("Clean.DownImage")));
             this.Clean.Image = ((System.Drawing.Image)(resources.GetObject("Clean.Image")));
             this.Clean.IsShowBorder = true;
-            this.Clean.Location = new System.Drawing.Point(848, 558);
+            this.Clean.Location = new System.Drawing.Point(858, 558);
             this.Clean.MoveImage = ((System.Drawing.Image)(resources.GetObject("Clean.MoveImage")));
             this.Clean.Name = "Clean";
             this.Clean.NormalImage = ((System.Drawing.Image)(resources.GetObject("Clean.NormalImage")));
@@ -880,22 +894,12 @@
             this.RepairComplete.UseVisualStyleBackColor = true;
             this.RepairComplete.Click += new System.EventHandler(this.RepairComplete_Click);
             // 
-            // ms_sncode
-            // 
-            this.ms_sncode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.ms_sncode.AutoSize = true;
-            this.ms_sncode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_sncode.Location = new System.Drawing.Point(94, 41);
-            this.ms_sncode.Name = "ms_sncode";
-            this.ms_sncode.Size = new System.Drawing.Size(0, 21);
-            this.ms_sncode.TabIndex = 126;
-            // 
             // Make_Repair
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(995, 588);
+            this.Controls.Add(this.mb_badremark);
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.nr_code);
             this.Controls.Add(this.prodcode);
@@ -928,7 +932,6 @@
             this.Controls.Add(this.mbr_brgcode_label);
             this.Controls.Add(this.bc_name);
             this.Controls.Add(this.bg_name);
-            this.Controls.Add(this.mb_badremark);
             this.Controls.Add(this.OperatResult);
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.ms_prodcode);
@@ -991,7 +994,6 @@
         private CustomControl.ValueLabel.ValueLabel ms_prodcode;
         private CustomControl.ValueLabel.ValueLabel ms_makecode;
         private CustomControl.RichText.RichTextAutoBottom OperatResult;
-        private CustomControl.TextBoxWithIcon.TextBoxWithTextArea mb_badremark;
         private CustomControl.TextBoxWithIcon.EnterTextBox bg_name;
         private CustomControl.TextBoxWithIcon.EnterTextBox bc_name;
         private CustomControl.TextBoxWithIcon.EnterTextBox nrg_name;
@@ -1025,10 +1027,11 @@
         private System.Windows.Forms.Label bg_code;
         private CustomControl.TextBoxWithIcon.SearchTextBox prodcode;
         private System.Windows.Forms.Label nr_code;
+        private CustomControl.ValueLabel.ValueLabel ms_sncode;
+        private CustomControl.TextBoxWithIcon.TextBoxWithTextArea mb_badremark;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbp_part1;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbp_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_loc1;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_id;
-        private CustomControl.ValueLabel.ValueLabel ms_sncode;
     }
 }

+ 41 - 60
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -74,16 +74,19 @@ namespace UAS_MES.Make
             cr_code.TableName = "craft";
             cr_code.SelectField = "cr_name # 工艺名称 ,cr_code # 工艺编号,cr_prodcode # 物料编号";
             cr_code.SetValueField = new string[] { "cr_code" };
+            cr_code.DBTitle = "回流工艺";
 
             cd_stepcode.FormName = Name;
             cd_stepcode.TableName = "craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id";
             cd_stepcode.SetValueField = new string[] { "cd_stepcode" };
             cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
+            cd_stepcode.DBTitle = "回流工序";
 
             prodcode.FormName = Name;
             prodcode.TableName = dbtable1.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text);
             prodcode.SetValueField = new string[] { "prodcode" };
             prodcode.SelectField = "prodcode # 不良零件编号,pr_detail # 零件名称";
+            prodcode.DBTitle = "不良零件";
 
             asc.controllInitializeSize(this);
             GetSNCode.Focus();
@@ -107,10 +110,10 @@ namespace UAS_MES.Make
                     {
                         //验证makeserial或者ms_firstsn表序列号是否存在
                         sql.Clear();
-                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_prodcode,ms_sncode,pr_detail ");
-                        sql.Append("ms_stepcode,ms_craftcode from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
-                        sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation ");
-                        sql.Append("where sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode");
+                        sql.Append("select max(ms_id) ms_id,ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode ");
+                        sql.Append("from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
+                        sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation where ");
+                        sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {
@@ -139,6 +142,7 @@ namespace UAS_MES.Make
             if (e.Node.Level == 0)
             {
                 mb_id = e.Node.Tag.ToString();
+                BaseUtil.CleanControlsText(bc_name, bc_code, bg_name, bg_code, mb_badremark, nrg_name, nr_name, nr_code, mbr_solutioncode, mbr_dutycode, mbc_component);
                 bc_name.Text = BadInf_1[mb_id]["bc_name"];
                 bc_code.Text = BadInf_1[mb_id]["mb_badcode"];
                 bg_name.Text = BadInf_1[mb_id]["bg_name"];
@@ -151,7 +155,7 @@ namespace UAS_MES.Make
                 nrg_name.Text = BadInf_2[mbr_id]["nrg_name"];
                 nr_name.Text = BadInf_2[mbr_id]["nr_name"];
                 nr_code.Text = BadInf_2[mbr_id]["nr_code"];
-                mbr_solutioncode.Text = BadInf_2[mbr_id]["mbr_solutioncode"];
+                mbr_solutioncode.Text = BadInf_2[mbr_id]["so_name"];
                 mbr_dutycode.Text = BadInf_2[mbr_id]["mbr_dutycode"];
                 mbc_component.Text = dh.getFieldDataByCondition("makebadrscom", "mbc_component", "mbc_mbrid=" + mbr_id).ToString();
                 //加载两个Grid的数据源
@@ -172,7 +176,7 @@ namespace UAS_MES.Make
             {
                 //添加根节点
                 TreeNode tnode_0 = new TreeNode();
-                tnode_0.Text = dt.Rows[i]["mb_bgcode"].ToString();
+                tnode_0.Text = dt.Rows[i]["bg_name"].ToString() + ":" + dt.Rows[i]["bc_name"].ToString();
                 tnode_0.Name = dt.Rows[i]["mb_bgcode"].ToString();
                 //作为Dictionary的主标识
                 string mb_id = dt.Rows[i]["mb_id"].ToString();
@@ -190,10 +194,10 @@ namespace UAS_MES.Make
                 BadCodeTree.Nodes.Add(tnode_0);
                 //添加子节点
                 sql.Clear();
-                sql.Append("select mbr_id,mbr_brcode,mbr_brgcode,mbr_solutioncode,so_name,mbr_dutycode,nd_name,");
-                sql.Append("nrg_name,nr_name,nr_code from makebadreason left join QUA_NGReason left join QUA_NGREASONGROUP on ");
-                sql.Append("nrg_code=nr_group on nr_code=mbr_brcode left join solution ");
-                sql.Append("on so_code=mbr_solutioncode left join ngduty on nd_code=mbr_dutycode where mbr_mbid=" + mb_id);
+                sql.Append("select mbr_id,mbr_brcode,mbr_brgcode,mbr_solutioncode,so_name,mbr_dutycode,nd_name,nrg_name");
+                sql.Append(",nr_name,nr_code from makebadreason left join QUA_NGReason left join QUA_NGREASONGROUP on ");
+                sql.Append("nrg_code=nr_group on nr_code=mbr_brcode left join solution on so_code=mbr_solutioncode ");
+                sql.Append("left join ngduty on nd_code=mbr_dutycode where mbr_mbid=" + mb_id);
                 DataTable dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 for (int j = 0; j < dt1.Rows.Count; j++)
                 {
@@ -219,9 +223,7 @@ namespace UAS_MES.Make
                 }
             }
             if (bg_code.Text != "")
-            {
                 BadCodeTree.Nodes[bg_code.Text].Expand();
-            }
         }
 
         private void RefreshTreeView_Click(object sender, EventArgs e)
@@ -231,32 +233,26 @@ namespace UAS_MES.Make
 
         private void RepairComplete_Click(object sender, EventArgs e)
         {
-            string ErrorMessage = "";
-            string oMakeCode = "";
-            string MsID = "";
-            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, GetSNCode.Text,User.UserCode,out oMakeCode,out MsID,out ErrorMessage))
+            int RejectNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + GetSNCode.Text + "' and mb_status not in (1,-1)").ToString());
+            if (RejectNum > 0)
+                OperatResult.AppendText(">>维修结果必须为已维修或无不良\n", Color.Red);
+            else
             {
-                int RejectNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + GetSNCode.Text + "' and mb_status not in (1,-1)").ToString());
-                if (RejectNum > 0)
-                    OperatResult.AppendText(">>维修结果必须为已维修或无不良\n", Color.Red);
+                dt = (DataTable)dh.ExecuteSql("select cr_id from craft where cr_statuscode='AUDITED' and cr_code='" + cr_code.Text + "'", "select");
+                if (dt.Rows.Count == 0)
+                    OperatResult.AppendText(">>回流工序不存在\n", Color.Red);
                 else
                 {
-                    dt = (DataTable)dh.ExecuteSql("select cr_id from craft where cr_statuscode='AUDITED' and cr_code='" + cr_code.Text + "'", "select");
+                    string cr_id = dt.Rows[0]["cr_id"].ToString();
+                    dt = (DataTable)dh.ExecuteSql("select cd_ifinput from craftdetail left join step on st_code=cd_stepcode where cd_crid='" + cr_id + "' and cd_stepcode='" + cd_stepcode.Text + "' and st_statuscode='AUDITED'", "select");
                     if (dt.Rows.Count == 0)
-                        OperatResult.AppendText(">>回流工序不在\n", Color.Red);
+                        OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
                     else
                     {
-                        string cr_id = dt.Rows[0]["cr_id"].ToString();
-                        dt = (DataTable)dh.ExecuteSql("select cd_ifinput from craftdetail left join step on st_code=cd_stepcode where cd_crid='" + cr_id + "' and cd_stepcode='" + cd_stepcode.Text + "' and st_statuscode='AUDITED'", "select");
-                        if (dt.Rows.Count == 0)
-                            OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
-                        else
-                        {
-                            dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
-                            dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
-                            OperatResult.AppendText(">>序列号" + ms_sncode.Text + "回流成功\n", Color.Green);
-                            GetSNCode.Clear();
-                        }
+                        dh.UpdateByCondition("makeserial", "ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
+                        dh.ExecuteSql(insert_makeprocess.Replace("#", "完成维修"), "insert", ms_sncode.Text, User.CurrentStepCode);
+                        OperatResult.AppendText(">>序列号" + ms_sncode.Text + "回流成功\n", Color.Green);
+                        GetSNCode.Clear();
                     }
                 }
             }
@@ -267,9 +263,7 @@ namespace UAS_MES.Make
             //判断是否有无法维修的记录
             int ScrapNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + ms_sncode.Text + "'").ToString());
             if (ScrapNum == 0)
-            {
                 OperatResult.AppendText(">>存在无法维修的记录才允许报废\n", Color.Red);
-            }
             else
             {
                 string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
@@ -342,17 +336,23 @@ namespace UAS_MES.Make
             {
                 if (mbr_id != "")
                 {
-                    string delete1 = "delete from  makebadrsloc where mbl_mbrid=" + mbr_id;
+                    string delete1 = "delete from makebadrsloc where mbl_mbrid=" + mbr_id;
                     string delete2 = "delete from makebadrspart where mbp_mbrid=" + mbr_id;
                     string delete3 = "delete from makebadrscom where mbc_mbrid=" + mbr_id;
-                    string delete4 = "delete from makebadreason where mbr_id" + mbr_id;
+                    string delete4 = "delete from makebadreason where mbr_id=" + mbr_id;
                     dh.ExecuteSQLTran(delete1, delete2, delete3, delete4);
-                    MessageBox.Show("删除成功");
+                    OperatResult.AppendText(">>删除成功\n", Color.Green);
+                    BaseUtil.CleanControlsText(bc_name, bc_code, bg_name, bg_code, mb_badremark, nrg_name, nr_name, nr_code, mbr_solutioncode, mbr_dutycode, mbc_component);
+                    mbp_partdgv.DataSource = null;
+                    mbl_locdgv.DataSource = null;
+                    mbr_id = "";
+                    //删除后重新加载Tree的信息
+                    LoadBadInfTree(sender, e);
                 }
-                else MessageBox.Show("必须选择不了原因");
+                else OperatResult.AppendText(">>必须选择不良原因\n", Color.Red);
             }
             else
-                MessageBox.Show("序列号错误,不存在或者不处于维修状态");
+                OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
         }
 
         private void SaveBadLocation_Click(object sender, EventArgs e)
@@ -369,34 +369,17 @@ namespace UAS_MES.Make
                         dr["mbl_loc"] = mbl_loc.Text;
                         dt.Rows.Add(dr);
                     }
-                    else MessageBox.Show("请先选择不良原因");
+                    else OperatResult.AppendText(">>请先选择不良原因\n", Color.Red);
                 }
             }
             else
-                MessageBox.Show("序列号错误,不存在或者不处于维修状态");
+                OperatResult.AppendText(">>序列号错误,不存在或者不处于维修状态\n", Color.Red);
         }
 
         private void mbl_loc_TextChanged(object sender, EventArgs e)
         {
             if (mbl_loc.Text != "")
-            {
                 prodcode.TableName = dbtable2.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text).Replace(":msl_location", mbl_loc.Text);
-            }
-        }
-
-        /// <summary>
-        /// 加载不良零件Grid
-        /// </summary>
-        private void LoadBadPart()
-        {
-        }
-
-        /// <summary>
-        /// 加载不良位置信息
-        /// </summary>
-        private void LoadBadLocation()
-        {
-
         }
 
         private void nr_name_TextChanged(object sender, EventArgs e)
@@ -411,9 +394,7 @@ namespace UAS_MES.Make
         private void mbl_loc_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
-            {
                 SaveBadLocation_Click(sender, e);
-            }
         }
 
         private void prodcode_TextKeyDown(object sender, KeyEventArgs e)

+ 0 - 12
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -126,27 +126,15 @@
   <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="mbp_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="mbp_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="mbl_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="mbl_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="NewRepairInf.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>

+ 195 - 104
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -37,55 +37,57 @@
             this.sncode_label = new System.Windows.Forms.Label();
             this.ChangeResult = new System.Windows.Forms.CheckBox();
             this.changenum_lanel = new System.Windows.Forms.Label();
-            this.ma_qty = new System.Windows.Forms.Label();
-            this.ma_qty_lable = new System.Windows.Forms.Label();
+            this.beforeTransSNLength_checkBox = new System.Windows.Forms.CheckBox();
+            this.afterTransSNLength_checkBox = new System.Windows.Forms.CheckBox();
+            this.beforeTransSNPre_checkBox = new System.Windows.Forms.CheckBox();
+            this.afterTransSNPre_checkBox = new System.Windows.Forms.CheckBox();
+            this.afterTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.beforeTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.ms_makecode_lock = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.ReCall = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.changenum = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.ms_makecode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.beforeTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
+            this.afterTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
+            this.changenum = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
+            this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.SuspendLayout();
             // 
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(141, 69);
-            this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail.Location = new System.Drawing.Point(585, 15);
             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 = 65;
             // 
             // 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(20, 21);
-            this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ms_makecode_label.Location = new System.Drawing.Point(15, 17);
             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(0, 21);
             this.ms_makecode_label.TabIndex = 61;
-            this.ms_makecode_label.Text = "归属工单";
             // 
             // ma_prodcode
             // 
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(492, 22);
-            this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode.Location = new System.Drawing.Point(355, 15);
             this.ma_prodcode.Name = "ma_prodcode";
-            this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
+            this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 64;
             // 
             // 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(20, 69);
-            this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.pr_detail_label.Location = new System.Drawing.Point(492, 15);
             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 = 62;
             this.pr_detail_label.Text = "产品名称";
             // 
@@ -93,10 +95,9 @@
             // 
             this.ma_prodcode_label.AutoSize = true;
             this.ma_prodcode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode_label.Location = new System.Drawing.Point(375, 21);
-            this.ma_prodcode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ma_prodcode_label.Location = new System.Drawing.Point(264, 15);
             this.ma_prodcode_label.Name = "ma_prodcode_label";
-            this.ma_prodcode_label.Size = new System.Drawing.Size(92, 27);
+            this.ma_prodcode_label.Size = new System.Drawing.Size(74, 21);
             this.ma_prodcode_label.TabIndex = 63;
             this.ma_prodcode_label.Text = "产品编号";
             // 
@@ -104,10 +105,9 @@
             // 
             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(20, 552);
-            this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.sncode_label.Location = new System.Drawing.Point(15, 441);
             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 = 68;
             this.sncode_label.Text = "录入框";
             // 
@@ -115,10 +115,9 @@
             // 
             this.ChangeResult.AutoSize = true;
             this.ChangeResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ChangeResult.Location = new System.Drawing.Point(395, 552);
-            this.ChangeResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ChangeResult.Location = new System.Drawing.Point(296, 441);
             this.ChangeResult.Name = "ChangeResult";
-            this.ChangeResult.Size = new System.Drawing.Size(154, 31);
+            this.ChangeResult.Size = new System.Drawing.Size(125, 25);
             this.ChangeResult.TabIndex = 70;
             this.ChangeResult.Text = "修改转换结果";
             this.ChangeResult.UseVisualStyleBackColor = true;
@@ -127,41 +126,110 @@
             // 
             this.changenum_lanel.AutoSize = true;
             this.changenum_lanel.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.changenum_lanel.Location = new System.Drawing.Point(585, 552);
-            this.changenum_lanel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.changenum_lanel.Location = new System.Drawing.Point(439, 441);
             this.changenum_lanel.Name = "changenum_lanel";
-            this.changenum_lanel.Size = new System.Drawing.Size(92, 27);
+            this.changenum_lanel.Size = new System.Drawing.Size(74, 21);
             this.changenum_lanel.TabIndex = 71;
             this.changenum_lanel.Text = "转换数量";
             // 
-            // ma_qty
-            // 
-            this.ma_qty.AutoSize = true;
-            this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(819, 22);
-            this.ma_qty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_qty.Name = "ma_qty";
-            this.ma_qty.Size = new System.Drawing.Size(0, 27);
-            this.ma_qty.TabIndex = 76;
-            // 
-            // ma_qty_lable
-            // 
-            this.ma_qty_lable.AutoSize = true;
-            this.ma_qty_lable.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty_lable.Location = new System.Drawing.Point(712, 22);
-            this.ma_qty_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.ma_qty_lable.Name = "ma_qty_lable";
-            this.ma_qty_lable.Size = new System.Drawing.Size(72, 27);
-            this.ma_qty_lable.TabIndex = 75;
-            this.ma_qty_lable.Text = "工单数";
+            // beforeTransSNLength_checkBox
+            // 
+            this.beforeTransSNLength_checkBox.AutoSize = true;
+            this.beforeTransSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.beforeTransSNLength_checkBox.Location = new System.Drawing.Point(20, 63);
+            this.beforeTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.beforeTransSNLength_checkBox.Name = "beforeTransSNLength_checkBox";
+            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(140, 24);
+            this.beforeTransSNLength_checkBox.TabIndex = 81;
+            this.beforeTransSNLength_checkBox.Text = "转换前序列号长度";
+            this.beforeTransSNLength_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // afterTransSNLength_checkBox
+            // 
+            this.afterTransSNLength_checkBox.AutoSize = true;
+            this.afterTransSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.afterTransSNLength_checkBox.Location = new System.Drawing.Point(20, 96);
+            this.afterTransSNLength_checkBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.afterTransSNLength_checkBox.Name = "afterTransSNLength_checkBox";
+            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(140, 24);
+            this.afterTransSNLength_checkBox.TabIndex = 82;
+            this.afterTransSNLength_checkBox.Text = "转换后序列号长度";
+            this.afterTransSNLength_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // beforeTransSNPre_checkBox
+            // 
+            this.beforeTransSNPre_checkBox.AutoSize = true;
+            this.beforeTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.beforeTransSNPre_checkBox.Location = new System.Drawing.Point(421, 62);
+            this.beforeTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.beforeTransSNPre_checkBox.Name = "beforeTransSNPre_checkBox";
+            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(140, 24);
+            this.beforeTransSNPre_checkBox.TabIndex = 83;
+            this.beforeTransSNPre_checkBox.Text = "转换前序列号前缀";
+            this.beforeTransSNPre_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // afterTransSNPre_checkBox
+            // 
+            this.afterTransSNPre_checkBox.AutoSize = true;
+            this.afterTransSNPre_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.afterTransSNPre_checkBox.Location = new System.Drawing.Point(421, 95);
+            this.afterTransSNPre_checkBox.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.afterTransSNPre_checkBox.Name = "afterTransSNPre_checkBox";
+            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(140, 24);
+            this.afterTransSNPre_checkBox.TabIndex = 84;
+            this.afterTransSNPre_checkBox.Text = "转换后序列号前缀";
+            this.afterTransSNPre_checkBox.UseVisualStyleBackColor = true;
+            // 
+            // afterTransSNPre
+            // 
+            this.afterTransSNPre.AllPower = null;
+            this.afterTransSNPre.BackColor = System.Drawing.Color.White;
+            this.afterTransSNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.afterTransSNPre.ID = null;
+            this.afterTransSNPre.Location = new System.Drawing.Point(581, 95);
+            this.afterTransSNPre.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.afterTransSNPre.Name = "afterTransSNPre";
+            this.afterTransSNPre.Power = null;
+            this.afterTransSNPre.Size = new System.Drawing.Size(168, 25);
+            this.afterTransSNPre.Str = null;
+            this.afterTransSNPre.Str1 = null;
+            this.afterTransSNPre.Str2 = null;
+            this.afterTransSNPre.TabIndex = 88;
+            // 
+            // beforeTransSNPre
+            // 
+            this.beforeTransSNPre.AllPower = null;
+            this.beforeTransSNPre.BackColor = System.Drawing.Color.White;
+            this.beforeTransSNPre.Font = new System.Drawing.Font("微软雅黑", 10F);
+            this.beforeTransSNPre.ID = null;
+            this.beforeTransSNPre.Location = new System.Drawing.Point(581, 62);
+            this.beforeTransSNPre.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.beforeTransSNPre.Name = "beforeTransSNPre";
+            this.beforeTransSNPre.Power = null;
+            this.beforeTransSNPre.Size = new System.Drawing.Size(168, 25);
+            this.beforeTransSNPre.Str = null;
+            this.beforeTransSNPre.Str1 = null;
+            this.beforeTransSNPre.Str2 = null;
+            this.beforeTransSNPre.TabIndex = 87;
+            // 
+            // ms_makecode_lock
+            // 
+            this.ms_makecode_lock.AutoSize = true;
+            this.ms_makecode_lock.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ms_makecode_lock.Location = new System.Drawing.Point(20, 17);
+            this.ms_makecode_lock.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ms_makecode_lock.Name = "ms_makecode_lock";
+            this.ms_makecode_lock.Size = new System.Drawing.Size(51, 21);
+            this.ms_makecode_lock.TabIndex = 80;
+            this.ms_makecode_lock.Text = "锁定";
+            this.ms_makecode_lock.UseVisualStyleBackColor = true;
             // 
             // 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(27, 109);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.OperateResult.Location = new System.Drawing.Point(20, 141);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(1081, 426);
+            this.OperateResult.Size = new System.Drawing.Size(812, 287);
             this.OperateResult.TabIndex = 78;
             this.OperateResult.Text = "";
             // 
@@ -170,11 +238,10 @@
             this.sncode.AllPower = "ifall";
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(127, 552);
-            this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.sncode.Location = new System.Drawing.Point(95, 441);
             this.sncode.Name = "sncode";
             this.sncode.Power = "ifwrite";
-            this.sncode.Size = new System.Drawing.Size(212, 25);
+            this.sncode.Size = new System.Drawing.Size(160, 21);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -189,13 +256,12 @@
             this.ReCall.DownImage = ((System.Drawing.Image)(resources.GetObject("ReCall.DownImage")));
             this.ReCall.Image = ((System.Drawing.Image)(resources.GetObject("ReCall.Image")));
             this.ReCall.IsShowBorder = true;
-            this.ReCall.Location = new System.Drawing.Point(584, 598);
-            this.ReCall.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.ReCall.Location = new System.Drawing.Point(438, 479);
             this.ReCall.MoveImage = ((System.Drawing.Image)(resources.GetObject("ReCall.MoveImage")));
             this.ReCall.Name = "ReCall";
             this.ReCall.NormalImage = ((System.Drawing.Image)(resources.GetObject("ReCall.NormalImage")));
             this.ReCall.Power = null;
-            this.ReCall.Size = new System.Drawing.Size(93, 30);
+            this.ReCall.Size = new System.Drawing.Size(70, 24);
             this.ReCall.TabIndex = 74;
             this.ReCall.Text = "撤销输入";
             this.ReCall.UseVisualStyleBackColor = true;
@@ -208,74 +274,93 @@
             this.Confirm.DownImage = ((System.Drawing.Image)(resources.GetObject("Confirm.DownImage")));
             this.Confirm.Image = ((System.Drawing.Image)(resources.GetObject("Confirm.Image")));
             this.Confirm.IsShowBorder = true;
-            this.Confirm.Location = new System.Drawing.Point(453, 598);
-            this.Confirm.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Confirm.Location = new System.Drawing.Point(340, 479);
             this.Confirm.MoveImage = ((System.Drawing.Image)(resources.GetObject("Confirm.MoveImage")));
             this.Confirm.Name = "Confirm";
             this.Confirm.NormalImage = ((System.Drawing.Image)(resources.GetObject("Confirm.NormalImage")));
             this.Confirm.Power = null;
-            this.Confirm.Size = new System.Drawing.Size(93, 30);
+            this.Confirm.Size = new System.Drawing.Size(70, 24);
             this.Confirm.TabIndex = 73;
             this.Confirm.Tag = "IfWrite";
             this.Confirm.Text = "确认";
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
+            // beforeTransSNLength
+            // 
+            this.beforeTransSNLength.Location = new System.Drawing.Point(165, 65);
+            this.beforeTransSNLength.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.beforeTransSNLength.Name = "beforeTransSNLength";
+            this.beforeTransSNLength.Size = new System.Drawing.Size(168, 21);
+            this.beforeTransSNLength.TabIndex = 89;
+            this.beforeTransSNLength.Text = "0";
+            // 
+            // afterTransSNLength
+            // 
+            this.afterTransSNLength.Location = new System.Drawing.Point(165, 99);
+            this.afterTransSNLength.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.afterTransSNLength.Name = "afterTransSNLength";
+            this.afterTransSNLength.Size = new System.Drawing.Size(168, 21);
+            this.afterTransSNLength.TabIndex = 90;
+            this.afterTransSNLength.Text = "0";
+            // 
             // changenum
             // 
-            this.changenum.AllPower = null;
-            this.changenum.BackColor = System.Drawing.Color.White;
-            this.changenum.ID = null;
-            this.changenum.Location = new System.Drawing.Point(717, 552);
-            this.changenum.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.changenum.Enabled = false;
+            this.changenum.Location = new System.Drawing.Point(553, 441);
+            this.changenum.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.changenum.Name = "changenum";
-            this.changenum.Power = null;
-            this.changenum.ReadOnly = true;
-            this.changenum.Size = new System.Drawing.Size(212, 25);
-            this.changenum.Str = null;
-            this.changenum.Str1 = null;
-            this.changenum.Str2 = null;
-            this.changenum.TabIndex = 72;
-            // 
-            // ms_makecode
-            // 
-            this.ms_makecode.AllPower = null;
-            this.ms_makecode.BackColor = System.Drawing.Color.White;
-            this.ms_makecode.ID = null;
-            this.ms_makecode.Location = new System.Drawing.Point(139, 21);
-            this.ms_makecode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.ms_makecode.Name = "ms_makecode";
-            this.ms_makecode.Power = null;
-            this.ms_makecode.Size = new System.Drawing.Size(212, 25);
-            this.ms_makecode.Str = null;
-            this.ms_makecode.Str1 = null;
-            this.ms_makecode.Str2 = null;
-            this.ms_makecode.TabIndex = 66;
-            // 
-            // 序列转换
-            // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.changenum.Size = new System.Drawing.Size(137, 21);
+            this.changenum.TabIndex = 91;
+            this.changenum.Text = "0";
+            // 
+            // ma_code
+            // 
+            this.ma_code.AllPower = null;
+            this.ma_code.Caller = null;
+            this.ma_code.Condition = null;
+            this.ma_code.DBTitle = null;
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(76, 16);
+            this.ma_code.Name = "ma_code";
+            this.ma_code.Power = null;
+            this.ma_code.SelectField = null;
+            this.ma_code.SetValueField = null;
+            this.ma_code.Size = new System.Drawing.Size(163, 22);
+            this.ma_code.TabIndex = 92;
+            this.ma_code.TableName = null;
+            this.ma_code.TextBoxEnable = false;
+            // 
+            // Make_SeqTransform
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1132, 640);
+            this.ClientSize = new System.Drawing.Size(849, 512);
+            this.Controls.Add(this.ma_code);
+            this.Controls.Add(this.changenum);
+            this.Controls.Add(this.afterTransSNLength);
+            this.Controls.Add(this.beforeTransSNLength);
+            this.Controls.Add(this.afterTransSNPre);
+            this.Controls.Add(this.beforeTransSNPre);
+            this.Controls.Add(this.afterTransSNPre_checkBox);
+            this.Controls.Add(this.beforeTransSNPre_checkBox);
+            this.Controls.Add(this.afterTransSNLength_checkBox);
+            this.Controls.Add(this.beforeTransSNLength_checkBox);
+            this.Controls.Add(this.ms_makecode_lock);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.sncode);
-            this.Controls.Add(this.ma_qty);
-            this.Controls.Add(this.ma_qty_lable);
             this.Controls.Add(this.ReCall);
             this.Controls.Add(this.Confirm);
-            this.Controls.Add(this.changenum);
             this.Controls.Add(this.changenum_lanel);
             this.Controls.Add(this.ChangeResult);
             this.Controls.Add(this.sncode_label);
-            this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.pr_detail);
             this.Controls.Add(this.ms_makecode_label);
             this.Controls.Add(this.ma_prodcode);
             this.Controls.Add(this.pr_detail_label);
             this.Controls.Add(this.ma_prodcode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
-            this.Name = "序列转换";
+            this.Name = "Make_SeqTransform";
             this.Tag = "Make!SeqTransform";
             this.Text = " ";
             this.Load += new System.EventHandler(this.序列转换_Load);
@@ -286,8 +371,6 @@
         }
 
         #endregion
-
-        private CustomControl.TextBoxWithIcon.EnterTextBox ms_makecode;
         private System.Windows.Forms.Label pr_detail;
         private System.Windows.Forms.Label ms_makecode_label;
         private System.Windows.Forms.Label ma_prodcode;
@@ -295,13 +378,21 @@
         private System.Windows.Forms.Label ma_prodcode_label;
         private System.Windows.Forms.Label sncode_label;
         private System.Windows.Forms.CheckBox ChangeResult;
-        private CustomControl.TextBoxWithIcon.EnterTextBox changenum;
         private System.Windows.Forms.Label changenum_lanel;
         private CustomControl.ButtonUtil.NormalButton Confirm;
         private CustomControl.ButtonUtil.NormalButton ReCall;
-        private System.Windows.Forms.Label ma_qty;
-        private System.Windows.Forms.Label ma_qty_lable;
         private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
+        private CustomControl.CustomCheckBox.LockCheckBox ms_makecode_lock;
+        private System.Windows.Forms.CheckBox beforeTransSNLength_checkBox;
+        private System.Windows.Forms.CheckBox afterTransSNLength_checkBox;
+        private System.Windows.Forms.CheckBox beforeTransSNPre_checkBox;
+        private System.Windows.Forms.CheckBox afterTransSNPre_checkBox;
+        private CustomControl.TextBoxWithIcon.EnterTextBox beforeTransSNPre;
+        private CustomControl.TextBoxWithIcon.EnterTextBox afterTransSNPre;
+        private CustomControl.TextBoxWithIcon.TextBoxNumOnly beforeTransSNLength;
+        private CustomControl.TextBoxWithIcon.TextBoxNumOnly afterTransSNLength;
+        private CustomControl.TextBoxWithIcon.TextBoxNumOnly changenum;
+        private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
     }
 }

+ 279 - 75
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -1,6 +1,8 @@
 using System;
+using System.Data;
 using System.Drawing;
 using System.Windows.Forms;
+using UAS_MES.CustomControl.TextBoxWithIcon;
 using UAS_MES.DataOperate;
 using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
@@ -13,7 +15,11 @@ namespace UAS_MES.Make
 
         DataHelper dh;
 
-        string bsncode = "";
+        DataTable dt;
+
+        string bsncode = "";//转换前序列号
+
+        string errorMessage = "";
 
         public Make_SeqTransform()
         {
@@ -25,6 +31,17 @@ namespace UAS_MES.Make
             asc.controllInitializeSize(this);
             dh = new DataHelper();
             sncode.Focus();
+
+            //设置锁定工单
+            ms_makecode_lock.GetMakeCodeCtl(ma_code);
+            ma_code.SetLockCheckBox(ms_makecode_lock);
+
+            //工单放大镜的配置
+            ma_code.TableName = "make left join product on ma_prodcode=pr_code";
+            ma_code.SelectField = "ma_code # 工单号,ma_prodcode # 产品编号,pr_detail # 产品名称";
+            ma_code.FormName = Name;
+            ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "pr_detail" };
+            ma_code.Condition = "ma_statuscode='STARTED'";
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
@@ -37,98 +54,137 @@ namespace UAS_MES.Make
                     //如果用户没有输入工单号自行去后台查询
                     string macode;
                     //如果用户填写了工单号 
-                    if (ms_makecode.Text != "")
-                    {
-                        macode = ms_makecode.Text;
-                    }
-                    else
-                    {
-                        macode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "' or ms_psn='" + sncode.Text + "'").ToString();
-                    }
-                    string ErrorMessage = "";
-                    bool ifFirst;
-                    if (bsncode == "")
-                    {
-                        if (LogicHandler.CheckCurrentStepAndIfFirst(sncode.Text, macode, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
-                        {
-                            switch (ChangeResult.CheckState)
-                            {
-                                //勾选状态是验证已转换的序列
-                                case CheckState.Checked:
-                                    if (dh.CheckExist("MakeSerial", "ms_psn='" + sncode.Text + "'"))
-                                    {
-                                        bsncode = sncode.Text;
-                                        sncode.Text = "";
-                                        OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
-                                    }
-                                    else
-                                    {
-                                        OperateResult.AppendText(">>不存在该已转序列号" + sncode.Text + "\n");
-                                    }
-                                    break;
-                                case CheckState.Unchecked:
-                                    if (dh.getFieldDataByCondition("makeserial", "ms_psn", "ms_sncode='" + sncode.Text + "'").ToString() == "")
-                                    {
-                                        bsncode = sncode.Text;
-                                        sncode.Text = "";
-                                        OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
-                                    }
-                                    else
-                                    {
-                                        OperateResult.AppendText(">>序列号" + sncode.Text + "已进行了转换\n", Color.Red);
-                                    }
-                                    break;
-                                default:
-                                    break;
-                            }
-                        }
-                        else
-                        {
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
-                        }
-                    }
-                    else
+                    if (ma_code.Text != "")
                     {
-                        //如果两次输入的序列号相同进行提示
-                        if (bsncode != sncode.Text)
+                        macode = ma_code.Text;
+                        //定义传入方法的变量
+                        string oMakeCode = "";
+                        string oMsId = "";
+                        //用户填写了工单号,那么序列号必须要是该工单的,否则提示错误
+                        if (LogicHandler.CheckStepSNAndMacode(macode, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsId, out errorMessage))
                         {
-                            //勾选了取消转换
-                            if (ChangeResult.Checked)
+                            //通过工单序列号关系验证
+                            string ErrorMessage = "";
+                            bool ifFirst;
+                            //bsncode为空,就说明是输入转换之前的序列号
+                            if (bsncode == "")
                             {
-                                if (!dh.CheckExist("makeserial", "ms_psn='" + sncode.Text + "'"))
+                                //判断用户是否锁定输入转换前序列号长度,
+                                if (!checkLengthOrPre(beforeTransSNLength_checkBox, beforeTransSNLength, "长度"))
+                                    return;
+                                //判断用户是否锁定输入转换前序列号前缀,
+                                if (!checkLengthOrPre(beforeTransSNPre_checkBox, beforeTransSNPre, "前缀"))
+                                    return;
+                                switch (ChangeResult.CheckState)
                                 {
-                                    dh.UpdateByCondition("makeserial", "ms_psn='" + sncode.Text + "'", "ms_psn='" + bsncode + "'");
-                                    OperateResult.AppendText(">>转换成功");
-                                }
-                                else
-                                {
-                                    OperateResult.AppendText(">>该序列号已存在,请输入其他序列号\n", Color.Red);
+                                    //勾选是修改已转换的序列,矫正修改错了的序列号
+                                    case CheckState.Checked:
+                                        if (dh.CheckExist("MakeSerial", "ms_beforesn='" + sncode.Text + "'"))
+                                        {
+                                            bsncode = sncode.Text;
+                                            sncode.Text = "";
+                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
+                                        }
+                                        else
+                                        {
+                                            OperateResult.AppendText(">>不存在该已转序列号" + sncode.Text + "\n");
+                                            sncode.Text = "";
+                                            OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
+                                        }
+                                        break;
+                                    case CheckState.Unchecked:
+                                        string beforesn = dh.getFieldDataByCondition("makeserial", "ms_beforesn", "ms_sncode='" + sncode.Text + "'").ToString().Trim();
+                                        //为空,就说明,没有进行过序列号的转换
+                                        if (beforesn == "" || beforesn == null)
+                                        {
+                                            //记录转换前的序列号
+                                            bsncode = sncode.Text;
+                                            sncode.Text = "";
+                                            OperateResult.AppendText("<<请输入转换后的序列号\n", Color.Green);
+                                        }
+                                        else
+                                        //不为空,进行过转换。不勾选修改结果,就不能再修改
+                                        {
+                                            OperateResult.AppendText(">>序列号" + sncode.Text + "已进行了转换\n", Color.Red);
+                                            sncode.Text = "";
+                                            OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
+                                        }
+                                        break;
+                                    default:
+                                        break;
                                 }
                             }
-                            //未勾选取消转换
+                            //bsncode不为空,说明输入的是转换后的序列号
                             else
                             {
-                                if (!dh.CheckExist("makeserial", "ms_psn='" + sncode.Text + "'"))
+                                //判断用户是否锁定输入转换后序列号长度,
+                                if (!checkLengthOrPre(afterTransSNLength_checkBox, afterTransSNLength, "长度"))
+                                    return;
+                                //判断用户是否锁定输入转换后序列号前缀,
+                                if (!checkLengthOrPre(afterTransSNPre_checkBox, afterTransSNPre, "前缀"))
+                                    return;
+                                //如果两次输入的序列号相同进行提示,不相同则进行下一步
+                                if (bsncode != sncode.Text)
                                 {
-                                    dh.UpdateByCondition("makeserial", "ms_psn='" + sncode.Text + "'", "ms_sncode='" + bsncode + "'");
-                                    OperateResult.AppendText(">>转换成功", Color.Green);
+                                    //勾选了修改转换结果
+                                    if (ChangeResult.Checked)
+                                    {
+                                        if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'"))
+                                        {
+                                            //查询ms_firstsn
+                                            string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + sncode.Text + "'").ToString();
+                                            //记录本次修改,存入makesnrelation表中
+                                            string updateSql = "update makeserial set ms_sncode='" + sncode.Text + "' where ms_beforesn='" + bsncode + "'";
+                                            string insertSql = "insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode.Text + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')";
+                                            dh.ExecuteSQLTran(updateSql, insertSql);
+                                            OperateResult.AppendText(">>转换成功");
+                                            //写入日志
+                                            LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
+                                            OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Green);
+                                            //置空
+                                            bsncode = "";
+                                            //更新数量
+                                            changenum.Text = int.Parse(changenum.Text) + 1 + "";
+                                        }
+                                        else
+                                            OperateResult.AppendText(">>该序列号已存在,请输入其他序列号\n", Color.Red);
+                                    }
+                                    //未勾选修改转换结果
+                                    else
+                                    {
+                                        if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'"))
+                                        {
+                                            //查询ms_firstsn
+                                            string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + sncode.Text + "'").ToString();
+                                            //记录本次修改,存入makesnrelation表中
+                                            string updateSql = "update makeserial set ms_sncode='" + sncode.Text + "', ms_beforesn='" + bsncode + "' where ms_sncode='" + bsncode + "'";
+                                            string insertSql = "insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode.Text + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')";
+                                            dh.ExecuteSQLTran(updateSql, insertSql);
+                                            OperateResult.AppendText(">>转换成功", Color.Green);
+                                            //写入日志
+                                            LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
+                                            OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Green);
+                                            //置空
+                                            bsncode = "";
+                                            //更新数量
+                                            changenum.Text = int.Parse(changenum.Text) + 1 + "";
+                                        }
+                                        else
+                                            OperateResult.AppendText(">>该序列号已存在,请输入其他序列号\n", Color.Red);
+                                    }
                                 }
                                 else
-                                {
-                                    OperateResult.AppendText(">>该序列号已存在,请输入其他序列号\n", Color.Red);
-                                }
+                                    OperateResult.AppendText(">>相同序列号不能进行转换\n", Color.Red);
                             }
                         }
                         else
-                        {
-                            OperateResult.AppendText(">>相同序列号不能进行转换\n", Color.Red);
-                        }
+                            OperateResult.AppendText(">>" + errorMessage + "\n", Color.Red);
                     }
+                    else
+                        macode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode.Text + "' or ms_beforesn='" + sncode.Text + "'").ToString();
                 }
                 else
-                {
                     OperateResult.AppendText(">>序列号不能为空\n", Color.Red);
-                }
             }
         }
 
@@ -148,5 +204,153 @@ namespace UAS_MES.Make
             bsncode = "";
             OperateResult.AppendText(">>请输需要转换的序列号\n", Color.Green);
         }
+        /// <summary>
+        /// 工单号keydown
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ms_makecode_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                //查询表工单序列号防呆规则表
+                dt = (DataTable)dh.ExecuteSql("select msr_type, msr_prefix ,msr_length from makesnrule where msr_makecode=" + ma_code.Text, "select");
+                if (dt.Rows.Count > 0)
+                {
+                    foreach (DataRow dr in dt.Rows)
+                    {
+                        //如果有值,则这个字段自动勾选,并且不可编辑
+                        if (dr["msr_type"].ToString().ToLower() == "before")
+                        {
+                            //msr_type=before 的值赋值到转换前
+
+                            //临时变量记录
+                            string length = dr["msr_length"].ToString();
+                            string prefix = dr["msr_prefix"].ToString();
+                            //不为空
+                            if (prefix != "" && prefix != null)
+                            {
+                                //则赋值
+                                beforeTransSNPre.Text = prefix;
+                                //设置不可编辑
+                                beforeTransSNPre.ReadOnly = true;
+                                //勾选
+                                beforeTransSNPre_checkBox.Checked = true;
+                            }
+                            if (length != "" && length != null)
+                            {
+                                //赋值
+                                beforeTransSNLength.Text = length;
+                                //设置不可编辑
+                                beforeTransSNLength.ReadOnly = true;
+                                //勾选
+                                beforeTransSNLength_checkBox.Checked = true;
+                            }
+                        }
+                        else if (dr["msr_type"].ToString().ToLower() == "after")
+                        {
+                            //msr_type=after 的值赋值到转换后
+
+                            //临时变量记录
+                            string length = dr["msr_length"].ToString();
+                            string prefix = dr["msr_prefix"].ToString();
+                            //不为空
+                            if (prefix != "" && prefix != null)
+                            {
+                                //则赋值
+                                afterTransSNPre.Text = prefix;
+                                //设置不可编辑
+                                afterTransSNPre.ReadOnly = true;
+                                //勾选
+                                afterTransSNPre_checkBox.Checked = true;
+                            }
+                            if (length != "" && length != null)
+                            {
+                                //赋值
+                                afterTransSNLength.Text = length;
+                                //设置不可编辑
+                                afterTransSNLength.ReadOnly = true;
+                                //勾选
+                                afterTransSNLength_checkBox.Checked = true;
+                            }
+                        }
+                    }
+                }
+                else
+                {
+                    /*	如果转换前没有值,则取 select productsnrule where psr_prodcode=? 产品编号,
+                     *	有值则赋值到 转换前,并且自动勾选不可编辑。*/
+                    dt = (DataTable)dh.ExecuteSql("select psr_prefix ,psr_length from productsnrule where psr_prodcode = " + ma_prodcode.Text, "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        //将产品序列号防呆规则查出的数据填充
+                        beforeTransSNPre.Text = dt.Rows[0]["psr_prefix"].ToString();
+                        beforeTransSNPre.ReadOnly = true;
+                        beforeTransSNPre_checkBox.Checked = true;
+                        beforeTransSNLength.Text = dt.Rows[0]["psr_length"].ToString();
+                        beforeTransSNLength.ReadOnly = true;
+                        beforeTransSNLength_checkBox.Checked = true;
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// 如果清空了工单号,或者更换了工单号则将 : 转换前序列号长度,转换前序列号前缀
+        ///转换后序列号长度,转换后序列号前缀 四个字段值清空。
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ms_makecode_UserControlTextChanged(object sender, EventArgs e)
+        {
+            //清空
+            beforeTransSNPre.Text = "";
+            beforeTransSNLength.Text = "";
+            afterTransSNPre.Text = "";
+            afterTransSNLength.Text = "";
+
+            //取消勾选
+            beforeTransSNPre_checkBox.Checked = false;
+            beforeTransSNLength_checkBox.Checked = false;
+            afterTransSNPre_checkBox.Checked = false;
+            afterTransSNLength_checkBox.Checked = false;
+        }
+        /// <summary>
+        /// 检验长度或者前缀是否合法
+        /// </summary>
+        /// <param name="checkbox"></param>
+        /// <param name="c"></param>
+        /// <param name="info"></param>
+        private bool checkLengthOrPre(CheckBox checkbox, TextBox textbox, string type)
+        {
+            if (checkbox.Checked == true)
+            {
+                if (type == "长度")
+                {
+                    //则判断输入转换前的序列号长度是否合法,不合法则提示
+                    if (sncode.Text.Trim().Length != int.Parse(textbox.Text))
+                    {
+                        //序列号校验错误,长度错误
+                        OperateResult.AppendText(">>序列号校验错误,长度错误", Color.Red);
+                        sncode.Text = "";
+                        OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
+                        return false;
+                    }
+                }
+                else if (type == "前缀")
+                {
+                    //则判断输入转换前的序列号前缀是否合法,不合法则提示
+                    if (!sncode.Text.StartsWith(textbox.Text.Trim()))
+                    {
+                        //序列号校验错误,前缀错误
+                        OperateResult.AppendText(">>序列号校验错误,前缀错误", Color.Red);
+                        sncode.Text = "";
+                        OperateResult.AppendText("<<请重新输入序列号\n", Color.Green);
+                        return false;
+                    }
+                }
+                return true;
+            }
+            return true;
+        }
     }
 }

+ 8 - 2
UAS-MES/PublicMethod/BaseUtil.cs

@@ -82,7 +82,7 @@ namespace UAS_MES.PublicMethod
                     string controlName = collection[i].Name;
                     string controlsTag = collection[i].Tag == null ? "" : collection[i].Tag.ToString();
                     //默认给TextBox和Label赋值
-                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox||collection[i] is MaCodeSearchTextBox)
+                    if (collection[i] is TextBox || collection[i] is Label || collection[i] is SearchTextBox || collection[i] is MaCodeSearchTextBox)
                     {
                         for (int j = 0; j < dt.Columns.Count; j++)
                         {
@@ -134,7 +134,7 @@ namespace UAS_MES.PublicMethod
                         for (int j = 0; j < collection[i].Controls.Count; j++)
                         {
                             controlName = collection[i].Controls[j].Name;
-                            if (collection[i].Controls[j] is TextBox || collection[i].Controls[j] is Label || collection[i].Controls[j] is SearchTextBox)
+                            if (collection[i].Controls[j] is TextBox || collection[i].Controls[j] is Label || collection[i].Controls[j] is SearchTextBox || collection[i].Controls[j] is MaCodeSearchTextBox)
                             {
                                 for (int k = 0; k < dt.Columns.Count; k++)
                                 {
@@ -531,6 +531,12 @@ namespace UAS_MES.PublicMethod
             }
         }
 
+        public static void CleanControlsText(params Control[] ctl)
+        {
+            foreach (Control item in ctl)
+                item.Text = "";
+        }
+
         /// <summary>
         /// 需要SQL的顺序和DGV的列的顺序一致
         /// </summary>

+ 3 - 0
UAS-MES/UAS-MES.csproj

@@ -22,6 +22,7 @@
     </SccAuxPath>
     <SccProvider>
     </SccProvider>
+    <PublishUrl>ftp://172.16.11.99/</PublishUrl>
     <PublishUrl>ftp://192.168.253.9/MESSetting/</PublishUrl>
     <Install>true</Install>
     <InstallFrom>Web</InstallFrom>
@@ -32,6 +33,7 @@
     <UpdatePeriodically>false</UpdatePeriodically>
     <UpdateRequired>false</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
+    <InstallUrl>http://172.16.11.99/</InstallUrl>
     <InstallUrl>http://218.17.158.219:8888/publish.htm/</InstallUrl>
     <UpdateUrl>http://218.17.158.219:8888/publish.htm/</UpdateUrl>
     <TargetCulture>zh</TargetCulture>
@@ -41,6 +43,7 @@
     <MinimumRequiredVersion>1.0.0.59</MinimumRequiredVersion>
     <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
+    <ApplicationRevision>194</ApplicationRevision>
     <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
     <ApplicationRevision>201</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>

+ 5 - 5
UAS-出货标签管理/CustomControl/PrinterCombox.Designer.cs

@@ -37,19 +37,19 @@
             this.PrinterList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrinterList.FormattingEnabled = true;
             this.PrinterList.Location = new System.Drawing.Point(0, 0);
-            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.PrinterList.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.PrinterList.Name = "PrinterList";
-            this.PrinterList.Size = new System.Drawing.Size(252, 23);
+            this.PrinterList.Size = new System.Drawing.Size(284, 26);
             this.PrinterList.TabIndex = 0;
             // 
             // PrinterCombox
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.PrinterList);
-            this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+            this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.Name = "PrinterCombox";
-            this.Size = new System.Drawing.Size(252, 23);
+            this.Size = new System.Drawing.Size(284, 28);
             this.Load += new System.EventHandler(this.PrinterCombox_Load);
             this.ResumeLayout(false);
 

+ 28 - 0
UAS-出货标签管理/Settings.cs

@@ -0,0 +1,28 @@
+namespace UAS_LabelMachine.Properties {
+    
+    
+    // 通过此类可以处理设置类的特定事件: 
+    //  在更改某个设置的值之前将引发 SettingChanging 事件。
+    //  在更改某个设置的值之后将引发 PropertyChanged 事件。
+    //  在加载设置值之后将引发 SettingsLoaded 事件。
+    //  在保存设置值之前将引发 SettingsSaving 事件。
+    internal sealed partial class Settings {
+        
+        public Settings() {
+            // // 若要为保存和更改设置添加事件处理程序,请取消注释下列行: 
+            //
+            // this.SettingChanging += this.SettingChangingEventHandler;
+            //
+            // this.SettingsSaving += this.SettingsSavingEventHandler;
+            //
+        }
+        
+        private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e) {
+            // 在此处添加用于处理 SettingChangingEvent 事件的代码。
+        }
+        
+        private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e) {
+            // 在此处添加用于处理 SettingsSaving 事件的代码。
+        }
+    }
+}

+ 3 - 3
UAS-出货标签管理/UAS-出货标签管理.csproj

@@ -100,10 +100,9 @@
     <Reference Include="Analysis">
       <HintPath>tool\Analysis.dll</HintPath>
     </Reference>
-    <Reference Include="Interop.LabelManager2, Version=6.0.0.0, Culture=neutral, processorArchitecture=MSIL">
-      <SpecificVersion>False</SpecificVersion>
+    <Reference Include="Interop.LabelManager2">
+      <HintPath>..\..\..\UAS_WinForm\UAS-出货标签管理\bin\Debug\Interop.LabelManager2.dll</HintPath>
       <EmbedInteropTypes>False</EmbedInteropTypes>
-      <HintPath>bin\Debug\Interop.LabelManager2.dll</HintPath>
     </Reference>
     <Reference Include="NPOI">
       <HintPath>tool\NPOI.dll</HintPath>
@@ -247,6 +246,7 @@
     <Compile Include="SetLoadingWindow.Designer.cs">
       <DependentUpon>SetLoadingWindow.cs</DependentUpon>
     </Compile>
+    <Compile Include="Settings.cs" />
     <Compile Include="客户标签维护.cs">
       <SubType>Form</SubType>
     </Compile>

+ 7 - 7
UAS_WinForm.sln

@@ -1,18 +1,18 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 14
-VisualStudioVersion = 14.0.23107.0
+VisualStudioVersion = 14.0.25420.1
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-MES接口", "MES接口\UAS-MES接口.csproj", "{A52EFE9C-838E-4E8C-BAAA-B1C226E57A81}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-MES", "UAS-MES\UAS-MES.csproj", "{411DEE44-B893-47E0-A0C2-797A3DAE2466}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-特殊解析规则", "UAS-特殊解析规则\UAS-特殊解析规则.csproj", "{7D199649-095F-4280-BD82-9481BCAB85B4}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-出货标签管理", "UAS-出货标签管理\UAS-出货标签管理.csproj", "{AF6321B6-3B55-4756-8B0B-110354A7BC1E}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject", "TestProject\TestProject.csproj", "{92488A73-91D7-4797-9794-67C4D9D86D09}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UAS-特殊解析规则", "UAS-特殊解析规则\UAS-特殊解析规则.csproj", "{7D199649-095F-4280-BD82-9481BCAB85B4}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -27,10 +27,6 @@ Global
 		{411DEE44-B893-47E0-A0C2-797A3DAE2466}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{411DEE44-B893-47E0-A0C2-797A3DAE2466}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{411DEE44-B893-47E0-A0C2-797A3DAE2466}.Release|Any CPU.Build.0 = Release|Any CPU
-		{7D199649-095F-4280-BD82-9481BCAB85B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{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
 		{AF6321B6-3B55-4756-8B0B-110354A7BC1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{AF6321B6-3B55-4756-8B0B-110354A7BC1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{AF6321B6-3B55-4756-8B0B-110354A7BC1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -39,6 +35,10 @@ Global
 		{92488A73-91D7-4797-9794-67C4D9D86D09}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{92488A73-91D7-4797-9794-67C4D9D86D09}.Release|Any CPU.Build.0 = Release|Any CPU
+		{7D199649-095F-4280-BD82-9481BCAB85B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{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
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE