浏览代码

代码优化

Hcsy 8 年之前
父节点
当前提交
1f37b0991b
共有 2 个文件被更改,包括 27 次插入24 次删除
  1. 18 12
      UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs
  2. 9 12
      UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

+ 18 - 12
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs

@@ -50,7 +50,7 @@
             // 
             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(448, 7);
+            this.pr_detail_label.Location = new System.Drawing.Point(459, 9);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(74, 21);
             this.pr_detail_label.TabIndex = 206;
@@ -72,7 +72,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(218, 56);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(229, 58);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(58, 21);
             this.mcd_remainqty_label.TabIndex = 202;
@@ -82,7 +82,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(7, 56);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(27, 58);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(74, 21);
             this.mcd_okqty_label.TabIndex = 201;
@@ -92,7 +92,7 @@
             // 
             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(218, 7);
+            this.pr_code_label.Location = new System.Drawing.Point(229, 9);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(74, 21);
             this.pr_code_label.TabIndex = 200;
@@ -102,7 +102,7 @@
             // 
             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(7, 7);
+            this.ms_makecode_label.Location = new System.Drawing.Point(27, 9);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(74, 21);
             this.ms_makecode_label.TabIndex = 199;
@@ -129,9 +129,11 @@
             // ms_makecode
             // 
             this.ms_makecode.AutoSize = true;
+            this.ms_makecode.CutLength = null;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(92, 7);
+            this.ms_makecode.Location = new System.Drawing.Point(107, 9);
             this.ms_makecode.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.ms_makecode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 21);
             this.ms_makecode.TabIndex = 212;
@@ -140,7 +142,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(302, 56);
+            this.mcd_remainqty.Location = new System.Drawing.Point(313, 58);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_remainqty.TabIndex = 210;
@@ -150,7 +152,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(91, 56);
+            this.mcd_okqty.Location = new System.Drawing.Point(107, 58);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(19, 21);
             this.mcd_okqty.TabIndex = 209;
@@ -159,8 +161,10 @@
             // ma_prodcode
             // 
             this.ma_prodcode.AutoSize = true;
+            this.ma_prodcode.CutLength = null;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(302, 10);
+            this.ma_prodcode.Location = new System.Drawing.Point(313, 12);
+            this.ma_prodcode.MaximumSize = new System.Drawing.Size(200, 0);
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Size = new System.Drawing.Size(0, 21);
             this.ma_prodcode.TabIndex = 208;
@@ -168,8 +172,10 @@
             // pr_detail
             // 
             this.pr_detail.AutoSize = true;
+            this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(533, 7);
+            this.pr_detail.Location = new System.Drawing.Point(544, 9);
+            this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 21);
             this.pr_detail.TabIndex = 207;
@@ -196,7 +202,7 @@
             // 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(10, 89);
+            this.OperateResult.Location = new System.Drawing.Point(12, 97);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(706, 305);
             this.OperateResult.TabIndex = 203;
@@ -222,7 +228,7 @@
             this.Controls.Add(this.pr_code_label);
             this.Controls.Add(this.ms_makecode_label);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.Name = "Make_CollectBTMAC";
             this.Tag = "Make!CollectBTMAC";
             this.Text = "BT/MAC采集";

+ 9 - 12
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -107,7 +107,7 @@ namespace UAS_MES.Make
                                 {
                                     BaseUtil.SetFormValue(this.Controls, dt);
                                     dh.UpdateByCondition("makeserial", "ms_currentstepcode = '" + User.CurrentStepCode + "'", "ms_id = '" + oMsID + "'");
-                                    OperateResult.AppendText(">>请输入BT\n", Color.Green);
+                                    OperateResult.AppendText(">>请输入BT\n", Color.Black);
                                     sn_code = sncode.Text;
                                     sncode.Text = "";
                                     isBT = true;
@@ -115,20 +115,20 @@ namespace UAS_MES.Make
                                 }
                                 else
                                 {
-                                    sncode.Text = "";
                                     OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
+                                    sncode.Text = "";
                                 }
                             }
                             else
                             {
                                 sncode.Text = "";
-                                OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                                OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red);
                             }
                         }
                         else
                         {
                             sncode.Text = "";
-                            OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
+                            OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red);
                         }
                     }
                     else
@@ -185,14 +185,13 @@ namespace UAS_MES.Make
                         {
                             sncode.Text = "";
                             OperateResult.AppendText(">>BT错误,重复\n", Color.Red);
-                            OperateResult.AppendText(">>请输入BT\n", Color.Green);
+                            OperateResult.AppendText(">>请输入BT\n", Color.Black);
                             return;
                         }
                         else
                         {
                             ms_bt = sncode.Text;
-                            ErrorMessage = "BT采集完成>>>请输入MAC";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            OperateResult.AppendText(">>BT采集完成\n>>请输入MAC\n", Color.Green);
                             isBT = false;
                             isMAC = true;
                             sncode.Text = "";
@@ -255,7 +254,7 @@ namespace UAS_MES.Make
                     {
                         sncode.Text = "";
                         OperateResult.AppendText(">>MAC错误,重复\n", Color.Red);
-                        OperateResult.AppendText(">>请输入MAC\n", Color.Green);
+                        OperateResult.AppendText(">>请输入MAC\n", Color.Black);
                         return;
                     }
                     else
@@ -263,8 +262,7 @@ namespace UAS_MES.Make
                         if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sn_code,"BT/MAC采集", "BT/MAC采集完成",User.UserCode,out ErrorMessage))   
                         {
                             dh.UpdateByCondition("makeserial", "ms_mac = '" + sncode.Text + "' ," + "ms_bt = '" + ms_bt + "'", "ms_id = '" + oMsID + "'");
-                            ErrorMessage = "BT/MAC采集完成,执行更新";
-                            OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                            OperateResult.AppendText(">>BT/MAC采集完成,执行更新\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,ms_makecode.Text,User.UserLineCode,User.UserSourceCode,"BT/MAC采集","采集成功", sn_code,"");
                             sql.Clear();
                             sql.Append("select ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
@@ -282,8 +280,7 @@ namespace UAS_MES.Make
                             OperateResult.AppendText(">>采集错误" + ErrorMessage + "\n", Color.Red);
                             return;
                         }
-                        ErrorMessage = ">>>请输入SN";
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        OperateResult.AppendText(">>请输入SN\n", Color.Black);
                     }
                 }
             }