shim 8 سال پیش
والد
کامیت
e0764332ac
2فایلهای تغییر یافته به همراه31 افزوده شده و 41 حذف شده
  1. 7 7
      UAS-MES/FunctionCode/Make/Make_RePrintLabel.Designer.cs
  2. 24 34
      UAS-MES/FunctionCode/Make/Make_RePrintLabel.cs

+ 7 - 7
UAS-MES/FunctionCode/Make/Make_RePrintLabel.Designer.cs

@@ -61,7 +61,7 @@
             this.giftBox.AutoSize = true;
             this.giftBox.Checked = true;
             this.giftBox.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.giftBox.Location = new System.Drawing.Point(83, 50);
+            this.giftBox.Location = new System.Drawing.Point(83, 51);
             this.giftBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.giftBox.Name = "giftBox";
             this.giftBox.Size = new System.Drawing.Size(135, 35);
@@ -69,33 +69,33 @@
             this.giftBox.TabStop = true;
             this.giftBox.Text = "彩标打印";
             this.giftBox.UseVisualStyleBackColor = true;
-            this.giftBox.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
+            this.giftBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
             // 
             // CartonBox
             // 
             this.CartonBox.AutoSize = true;
             this.CartonBox.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.CartonBox.Location = new System.Drawing.Point(431, 50);
+            this.CartonBox.Location = new System.Drawing.Point(431, 51);
             this.CartonBox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.CartonBox.Name = "CartonBox";
             this.CartonBox.Size = new System.Drawing.Size(164, 35);
             this.CartonBox.TabIndex = 2;
             this.CartonBox.Text = "Carton打印";
             this.CartonBox.UseVisualStyleBackColor = true;
-            this.CartonBox.CheckedChanged += new System.EventHandler(this.CartonBox_CheckedChanged);
+            this.CartonBox.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
             // 
             // fuselagel
             // 
             this.fuselagel.AutoSize = true;
             this.fuselagel.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.fuselagel.Location = new System.Drawing.Point(845, 50);
+            this.fuselagel.Location = new System.Drawing.Point(845, 51);
             this.fuselagel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.fuselagel.Name = "fuselagel";
             this.fuselagel.Size = new System.Drawing.Size(159, 35);
             this.fuselagel.TabIndex = 3;
             this.fuselagel.Text = "机身标打印";
             this.fuselagel.UseVisualStyleBackColor = true;
-            this.fuselagel.CheckedChanged += new System.EventHandler(this.fuselagel_CheckedChanged);
+            this.fuselagel.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChange);
             // 
             // label
             // 
@@ -279,7 +279,7 @@
             this.normalButton1.TabIndex = 194;
             this.normalButton1.Text = "打印";
             this.normalButton1.UseVisualStyleBackColor = false;
-            this.normalButton1.Click += new System.EventHandler(this.normalButton1_Click);
+            this.normalButton1.Click += new System.EventHandler(this.print_Click);
             // 
             // printNum
             // 

+ 24 - 34
UAS-MES/FunctionCode/Make/Make_RePrintLabel.cs

@@ -89,30 +89,17 @@ namespace UAS_MES.Make
         {
             //窗口关闭的时候
         }
-
-        private void radioButton1_CheckedChanged(object sender, EventArgs e)
+        private void radioButton_CheckedChange(object sender, EventArgs e)
         {
-            //切换打印类型,清除输入值、工单代码、产品编号,名称、打印模板、核对第一次输入的SN
-            if (giftBox.Checked)
+            RadioButton btn = sender as RadioButton;
+            if ((btn.Name == "giftBox" || btn.Name == "fuselagel") && btn.Checked)
             {
                 //如果是切换成彩盒或者机身标提示用户 输入SN
                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
                 clearAll();
-            }
-        }
-        private void CartonBox_CheckedChanged(object sender, EventArgs e)
-        {
-            if (CartonBox.Checked) {
-                OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
-                clearAll();
-            }
-        }
-
-        private void fuselagel_CheckedChanged(object sender, EventArgs e)
-        {
-            if (fuselagel.Checked)
+            } else if (btn.Name == "CartonBox" || btn.Checked)
             {
-                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
                 clearAll();
             }
         }
@@ -204,23 +191,24 @@ namespace UAS_MES.Make
                 indate[i] = Convert.ToDateTime(listA.Rows[i]["pl_indate"].ToString());
             }
         }
-
-        private void normalButton1_Click(object sender, EventArgs e)
+        private void print_Click(object sender, EventArgs e)
         {
             //输入值字段值不为空,打印不为空,有选中打印模板,才可以进行打印,打印前再次判断
-            if (inputValue.Text=="") {
+            if (inputValue.Text == "")
+            {
                 OperateResult.AppendText("<<无箱号或者序列号\n", Color.Red);
                 return;
             }
-            if (PrintLabel.Text=="") {
+            if (PrintLabel.Text == "")
+            {
                 OperateResult.AppendText("<<无打印模板\n", Color.Red);
                 return;
             }
             //打印类型 彩盒或者标签,再次判断是否已装箱,未转号
             if (giftBox.Checked || fuselagel.Checked)
             {
-                mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='"+ms_id+"' and ms_sncode='"+ inputValue.Text+"'", "select");
-                if (mapB.Rows.Count==0)
+                mapB = (DataTable)dh.ExecuteSql("select ms_outboxcode, nvl(ms_downstatus,0) ms_downstatus from makeserial where ms_id='" + ms_id + "' and ms_sncode='" + inputValue.Text + "'", "select");
+                if (mapB.Rows.Count == 0)
                 {
                     //无值提示用户序列号错误,不存在或者已经发生转号
                     OperateResult.AppendText("<<序列号错误,不存在或已经发生转号\n", Color.Red);
@@ -237,23 +225,24 @@ namespace UAS_MES.Make
                 OperateResult.AppendText("<<打印成功\n", Color.Green);
                 Print.CodeSoft(Tag.ToString(), lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
-                LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode, "", User.UserLineCode, User.UserSourceCode, giftBox.Checked?"彩盒标补打印":"机身标补打印", "补打印成功", inputValue.Text, "");
+                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, giftBox.Checked ? "彩盒标补打印" : "机身标补打印", "补打印成功", inputValue.Text, "");
                 //如果ms_downstatus<>0,则更新ms_downstatus=-1 where ms_id=?id,同时插入记录至表 MAKEDOWN
-                if (mapB.Rows[0]["ms_downstatus"].ToString()=="0")
+                if (mapB.Rows[0]["ms_downstatus"].ToString() == "0")
                 {
-                    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='"+ms_id+"'","update");
+                    dh.ExecuteSql("update makeserial set ms_downstatus='-1' where ms_id='" + ms_id + "'", "update");
                     //插入数据
                     putInfo2MakeDown();
                 }
             }
             //打印类型为卡通箱标签
-            else if(CartonBox.Checked)
+            else if (CartonBox.Checked)
             {
                 //select pa_downstatus from package where pa_outboxcode=? 输入值code
-                mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='"+inputValue.Text+"'", "select");
+                mapB = (DataTable)dh.ExecuteSql("select pa_downstatus from package where pa_outboxcode='" + inputValue.Text + "'", "select");
                 //无值提示用户箱号错误,不存在。
-                if (mapB.Rows.Count==0) {
-                    OperateResult.AppendText("<<箱号:"+inputValue.Text+"错误,不存在\n", Color.Red);
+                if (mapB.Rows.Count == 0)
+                {
+                    OperateResult.AppendText("<<箱号:" + inputValue.Text + "错误,不存在\n", Color.Red);
                     return;
                 }
                 //判断通过,打印
@@ -265,10 +254,11 @@ namespace UAS_MES.Make
                 sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
                 sql.Append("cl_result,cl_sncode,cl_code) values (commandlog_seq.nextval,:inman,sysdate,:linecode,:sourcecode,:makecode,");
                 sql.Append(":operate,:result,'','')");
-                dh.ExecuteSql(sql.GetString(), "insert",User.UserCode,User.UserLineCode,User.UserSourceCode,ms_makecode.Text,"卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功");
+                dh.ExecuteSql(sql.GetString(), "insert", User.UserCode, User.UserLineCode, User.UserSourceCode, ms_makecode.Text, "卡通箱标签补打印,箱号:" + inputValue.Text, "补打印成功");
                 //如果pa_downstatus<>0,则更新pa_downstatus=-1 where pa_outboxcode=?code,同时插入记录至表 MAKEDOWN
-                if (mapB.Rows[0]["pa_downstatus"].ToString()=="0") {
-                    dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='"+ inputValue.Text+"'", "update");
+                if (mapB.Rows[0]["pa_downstatus"].ToString() == "0")
+                {
+                    dh.ExecuteSql("update package set pa_downstatus='-1' where pa_outboxcode='" + inputValue.Text + "'", "update");
                     //插入MakeDown表
                     putInfo2MakeDown();
                 }