Browse Source

序列号转换优化

shim 8 years ago
parent
commit
84bf650d53

+ 135 - 156
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -37,21 +37,21 @@
             this.sncode_label = new System.Windows.Forms.Label();
             this.ChangeResult = new System.Windows.Forms.CheckBox();
             this.changenum_lanel = new System.Windows.Forms.Label();
-            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.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
-            this.ms_makecode_lock = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
             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.beforeTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.afterTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.beforeTransSNPre = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             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.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
+            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.beforeTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
+            this.afterTransSNLength = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
+            this.changenum = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxNumOnly();
             this.SuspendLayout();
             // 
             // pr_detail
@@ -140,6 +140,110 @@
             this.changenum_lanel.TabIndex = 71;
             this.changenum_lanel.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(30, 95);
+            this.beforeTransSNLength_checkBox.Name = "beforeTransSNLength_checkBox";
+            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
+            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(30, 144);
+            this.afterTransSNLength_checkBox.Name = "afterTransSNLength_checkBox";
+            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
+            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(631, 93);
+            this.beforeTransSNPre_checkBox.Name = "beforeTransSNPre_checkBox";
+            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
+            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(631, 143);
+            this.afterTransSNPre_checkBox.Name = "afterTransSNPre_checkBox";
+            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
+            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(871, 143);
+            this.afterTransSNPre.Name = "afterTransSNPre";
+            this.afterTransSNPre.Power = null;
+            this.afterTransSNPre.Size = new System.Drawing.Size(250, 34);
+            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(871, 93);
+            this.beforeTransSNPre.Name = "beforeTransSNPre";
+            this.beforeTransSNPre.Power = null;
+            this.beforeTransSNPre.Size = new System.Drawing.Size(250, 34);
+            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(30, 26);
+            this.ms_makecode_lock.Name = "ms_makecode_lock";
+            this.ms_makecode_lock.Size = new System.Drawing.Size(72, 28);
+            this.ms_makecode_lock.TabIndex = 80;
+            this.ms_makecode_lock.Text = "锁定";
+            this.ms_makecode_lock.UseVisualStyleBackColor = true;
+            // 
+            // 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.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ma_code.FormName = null;
+            this.ma_code.Location = new System.Drawing.Point(108, 22);
+            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(221, 32);
+            this.ma_code.TabIndex = 79;
+            this.ma_code.TableName = null;
+            this.ma_code.Tag = "ma_code";
+            this.ma_code.TextBoxEnable = true;
+            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -206,165 +310,41 @@
             this.Confirm.UseVisualStyleBackColor = true;
             this.Confirm.Click += new System.EventHandler(this.Confirm_Click);
             // 
-            // changenum
-            // 
-            this.changenum.AllPower = null;
-            this.changenum.BackColor = System.Drawing.Color.White;
-            this.changenum.ID = null;
-            this.changenum.Location = new System.Drawing.Point(807, 662);
-            this.changenum.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
-            this.changenum.Name = "changenum";
-            this.changenum.Power = null;
-            this.changenum.ReadOnly = true;
-            this.changenum.Size = new System.Drawing.Size(238, 28);
-            this.changenum.Str = null;
-            this.changenum.Str1 = null;
-            this.changenum.Str2 = null;
-            this.changenum.TabIndex = 72;
-            // 
-            // 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.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(108, 22);
-            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(221, 32);
-            this.ma_code.TabIndex = 79;
-            this.ma_code.TableName = null;
-            this.ma_code.Tag = "ma_code";
-            this.ma_code.TextBoxEnable = false;
-            // 
-            // 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(30, 26);
-            this.ms_makecode_lock.Name = "ms_makecode_lock";
-            this.ms_makecode_lock.Size = new System.Drawing.Size(72, 28);
-            this.ms_makecode_lock.TabIndex = 80;
-            this.ms_makecode_lock.Text = "锁定";
-            this.ms_makecode_lock.UseVisualStyleBackColor = true;
-            // 
-            // beforeTransSNLength_checkBox
-            // 
-            this.beforeTransSNLength_checkBox.AutoSize = true;
-            this.beforeTransSNLength_checkBox.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.beforeTransSNLength_checkBox.Location = new System.Drawing.Point(30, 95);
-            this.beforeTransSNLength_checkBox.Name = "beforeTransSNLength_checkBox";
-            this.beforeTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
-            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(30, 144);
-            this.afterTransSNLength_checkBox.Name = "afterTransSNLength_checkBox";
-            this.afterTransSNLength_checkBox.Size = new System.Drawing.Size(198, 31);
-            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(631, 93);
-            this.beforeTransSNPre_checkBox.Name = "beforeTransSNPre_checkBox";
-            this.beforeTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
-            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(631, 143);
-            this.afterTransSNPre_checkBox.Name = "afterTransSNPre_checkBox";
-            this.afterTransSNPre_checkBox.Size = new System.Drawing.Size(198, 31);
-            this.afterTransSNPre_checkBox.TabIndex = 84;
-            this.afterTransSNPre_checkBox.Text = "转换后序列号前缀";
-            this.afterTransSNPre_checkBox.UseVisualStyleBackColor = true;
-            // 
             // beforeTransSNLength
             // 
-            this.beforeTransSNLength.AllPower = null;
-            this.beforeTransSNLength.BackColor = System.Drawing.Color.White;
-            this.beforeTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.beforeTransSNLength.ID = null;
-            this.beforeTransSNLength.Location = new System.Drawing.Point(247, 93);
+            this.beforeTransSNLength.Location = new System.Drawing.Point(247, 97);
             this.beforeTransSNLength.Name = "beforeTransSNLength";
-            this.beforeTransSNLength.Power = null;
-            this.beforeTransSNLength.Size = new System.Drawing.Size(250, 34);
-            this.beforeTransSNLength.Str = null;
-            this.beforeTransSNLength.Str1 = null;
-            this.beforeTransSNLength.Str2 = null;
-            this.beforeTransSNLength.TabIndex = 85;
+            this.beforeTransSNLength.Size = new System.Drawing.Size(250, 28);
+            this.beforeTransSNLength.TabIndex = 89;
+            this.beforeTransSNLength.Text = "0";
             // 
             // afterTransSNLength
             // 
-            this.afterTransSNLength.AllPower = null;
-            this.afterTransSNLength.BackColor = System.Drawing.Color.White;
-            this.afterTransSNLength.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.afterTransSNLength.ID = null;
-            this.afterTransSNLength.Location = new System.Drawing.Point(247, 144);
+            this.afterTransSNLength.Location = new System.Drawing.Point(247, 149);
             this.afterTransSNLength.Name = "afterTransSNLength";
-            this.afterTransSNLength.Power = null;
-            this.afterTransSNLength.Size = new System.Drawing.Size(250, 34);
-            this.afterTransSNLength.Str = null;
-            this.afterTransSNLength.Str1 = null;
-            this.afterTransSNLength.Str2 = null;
-            this.afterTransSNLength.TabIndex = 86;
-            // 
-            // beforeTransSNPre
+            this.afterTransSNLength.Size = new System.Drawing.Size(250, 28);
+            this.afterTransSNLength.TabIndex = 90;
+            this.afterTransSNLength.Text = "0";
             // 
-            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(871, 93);
-            this.beforeTransSNPre.Name = "beforeTransSNPre";
-            this.beforeTransSNPre.Power = null;
-            this.beforeTransSNPre.Size = new System.Drawing.Size(250, 34);
-            this.beforeTransSNPre.Str = null;
-            this.beforeTransSNPre.Str1 = null;
-            this.beforeTransSNPre.Str2 = null;
-            this.beforeTransSNPre.TabIndex = 87;
-            // 
-            // afterTransSNPre
+            // changenum
             // 
-            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(871, 143);
-            this.afterTransSNPre.Name = "afterTransSNPre";
-            this.afterTransSNPre.Power = null;
-            this.afterTransSNPre.Size = new System.Drawing.Size(250, 34);
-            this.afterTransSNPre.Str = null;
-            this.afterTransSNPre.Str1 = null;
-            this.afterTransSNPre.Str2 = null;
-            this.afterTransSNPre.TabIndex = 88;
+            this.changenum.Enabled = false;
+            this.changenum.Location = new System.Drawing.Point(830, 662);
+            this.changenum.Name = "changenum";
+            this.changenum.Size = new System.Drawing.Size(203, 28);
+            this.changenum.TabIndex = 91;
+            this.changenum.Text = "0";
             // 
             // Make_SeqTransform
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1274, 768);
-            this.Controls.Add(this.afterTransSNPre);
-            this.Controls.Add(this.beforeTransSNPre);
+            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);
@@ -375,7 +355,6 @@
             this.Controls.Add(this.sncode);
             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);
@@ -404,7 +383,6 @@
         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;
@@ -416,9 +394,10 @@
         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 beforeTransSNLength;
-        private CustomControl.TextBoxWithIcon.EnterTextBox afterTransSNLength;
         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;
     }
 }

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

@@ -55,8 +55,12 @@ namespace UAS_MES.Make
                     if (ma_code.Text != "")
                     {
                         macode = ma_code.Text;
+                        //定义传入方法的变量
+                        string oMakeCode = "";
+                        string oMsId = "";
+                        string errorMessage = "";
                         //用户填写了工单号,那么序列号必须要是该工单的,否则提示错误
-                        if (dh.CheckExist("makeserial", "ms_makecode='" + ma_code.Text + "' and (ms_sncode='" + sncode.Text + "' or ms_beforesn='" + sncode.Text + "')"))
+                        if (!LogicHandler.CheckStepSNAndMacode(macode,User.UserSourceCode,sncode.Text,User.UserCode,out oMakeCode,out oMsId,out errorMessage))
                         {
                             OperateResult.AppendText(">>序列号" + sncode.Text + "不属于工单" + ma_code.Text + ",请重新输入或者切换工单\n", Color.Red);
                             return;
@@ -150,12 +154,14 @@ namespace UAS_MES.Make
 
                                 if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'"))
                                 {
-                                    dh.UpdateByCondition("makeserial", "ms_sncode='" + sncode.Text + "'", "ms_beforesn='" + bsncode + "'");
-                                    OperateResult.AppendText(">>转换成功");
                                     //查询ms_firstsn
                                     string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + sncode.Text + "'").ToString();
+                                    //dh.UpdateByCondition("makeserial", "ms_sncode='" + sncode.Text + "'", "ms_beforesn='" + bsncode + "'");
+                                    dh.ExecuteSQLTran("update makeserial set ms_sncode='" + sncode.Text + "' where ms_beforesn='" + bsncode + "'",
+                                        "insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode.Text + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')");
+                                    OperateResult.AppendText(">>转换成功");
                                     //记录本次修改,存入makesnrelation表中
-                                    dh.ExecuteSql("insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')", "insert");
+                                    //dh.ExecuteSql("insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode.Text + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')", "insert");
                                     //写入日志
                                     LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
                                     OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Green);
@@ -174,12 +180,14 @@ namespace UAS_MES.Make
                             {
                                 if (!dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'"))
                                 {
-                                    dh.UpdateByCondition("makeserial", "ms_sncode='" + sncode.Text + "' and ms_beforesn='" + bsncode + "'", "ms_sncode='" + bsncode + "'");
-                                    OperateResult.AppendText(">>转换成功", Color.Green);
                                     //查询ms_firstsn
                                     string firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + sncode.Text + "'").ToString();
+                                    //dh.UpdateByCondition("makeserial", "ms_sncode='" + sncode.Text + "', ms_beforesn='" + bsncode + "'", "ms_sncode='" + bsncode + "'");
+                                    dh.ExecuteSQLTran("update makeserial set ms_sncode='" + sncode.Text + "', ms_beforesn='" + bsncode + "' where ms_sncode='" + bsncode + "'",
+                                        "insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')");
+                                    OperateResult.AppendText(">>转换成功", Color.Green);
                                     //记录本次修改,存入makesnrelation表中
-                                    dh.ExecuteSql("insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')", "insert");
+                                    //dh.ExecuteSql("insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')", "insert");
                                     //写入日志
                                     LogManager.DoLog("修改序列号:" + bsncode + "为" + sncode.Text + "成功!" + "操作人:" + User.UserCode);
                                     OperateResult.AppendText(">>请输入转换前的序列号\n", Color.Green);
@@ -339,7 +347,7 @@ namespace UAS_MES.Make
         /// <param name="checkbox"></param>
         /// <param name="c"></param>
         /// <param name="info"></param>
-        private bool checkLengthOrPre(CheckBox checkbox, EnterTextBox textbox, string type)
+        private bool checkLengthOrPre(CheckBox checkbox, TextBox textbox, string type)
         {
             if (checkbox.Checked == true)
             {