Browse Source

界面调整

章政 8 years ago
parent
commit
6d2e77289e

+ 22 - 16
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.Designer.cs

@@ -143,7 +143,7 @@
             this.collects.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.collects.Name = "collects";
             this.collects.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.collects.Size = new System.Drawing.Size(164, 239);
+            this.collects.Size = new System.Drawing.Size(199, 239);
             this.collects.TabIndex = 92;
             this.collects.TabStop = false;
             this.collects.TextColor = System.Drawing.Color.Black;
@@ -151,11 +151,12 @@
             // Mac
             // 
             this.Mac.AutoSize = true;
-            this.Mac.Location = new System.Drawing.Point(33, 26);
+            this.Mac.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Mac.Location = new System.Drawing.Point(33, 20);
             this.Mac.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Mac.Name = "Mac";
             this.Mac.Power = null;
-            this.Mac.Size = new System.Drawing.Size(93, 19);
+            this.Mac.Size = new System.Drawing.Size(133, 31);
             this.Mac.TabIndex = 5;
             this.Mac.Text = "MAC/WIFI";
             this.Mac.UseVisualStyleBackColor = true;
@@ -164,11 +165,12 @@
             // Bt
             // 
             this.Bt.AutoSize = true;
-            this.Bt.Location = new System.Drawing.Point(33, 62);
+            this.Bt.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Bt.Location = new System.Drawing.Point(33, 57);
             this.Bt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Bt.Name = "Bt";
             this.Bt.Power = null;
-            this.Bt.Size = new System.Drawing.Size(45, 19);
+            this.Bt.Size = new System.Drawing.Size(58, 31);
             this.Bt.TabIndex = 4;
             this.Bt.Text = "BT";
             this.Bt.UseVisualStyleBackColor = true;
@@ -177,11 +179,12 @@
             // NetCode
             // 
             this.NetCode.AutoSize = true;
+            this.NetCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.NetCode.Location = new System.Drawing.Point(33, 93);
             this.NetCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.NetCode.Name = "NetCode";
             this.NetCode.Power = null;
-            this.NetCode.Size = new System.Drawing.Size(59, 19);
+            this.NetCode.Size = new System.Drawing.Size(74, 31);
             this.NetCode.TabIndex = 3;
             this.NetCode.Text = "网标";
             this.NetCode.UseVisualStyleBackColor = true;
@@ -190,11 +193,12 @@
             // Imei1
             // 
             this.Imei1.AutoSize = true;
-            this.Imei1.Location = new System.Drawing.Point(33, 130);
+            this.Imei1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Imei1.Location = new System.Drawing.Point(33, 129);
             this.Imei1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei1.Name = "Imei1";
             this.Imei1.Power = null;
-            this.Imei1.Size = new System.Drawing.Size(69, 19);
+            this.Imei1.Size = new System.Drawing.Size(89, 31);
             this.Imei1.TabIndex = 2;
             this.Imei1.Text = "IMEI1";
             this.Imei1.UseVisualStyleBackColor = true;
@@ -203,11 +207,12 @@
             // Imei2
             // 
             this.Imei2.AutoSize = true;
-            this.Imei2.Location = new System.Drawing.Point(33, 163);
+            this.Imei2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Imei2.Location = new System.Drawing.Point(33, 166);
             this.Imei2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei2.Name = "Imei2";
             this.Imei2.Power = null;
-            this.Imei2.Size = new System.Drawing.Size(69, 19);
+            this.Imei2.Size = new System.Drawing.Size(89, 31);
             this.Imei2.TabIndex = 1;
             this.Imei2.Text = "IMEI2";
             this.Imei2.UseVisualStyleBackColor = true;
@@ -216,11 +221,12 @@
             // Imei3
             // 
             this.Imei3.AutoSize = true;
-            this.Imei3.Location = new System.Drawing.Point(33, 199);
+            this.Imei3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Imei3.Location = new System.Drawing.Point(33, 202);
             this.Imei3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei3.Name = "Imei3";
             this.Imei3.Power = null;
-            this.Imei3.Size = new System.Drawing.Size(69, 19);
+            this.Imei3.Size = new System.Drawing.Size(89, 31);
             this.Imei3.TabIndex = 0;
             this.Imei3.Text = "IMEI3";
             this.Imei3.UseVisualStyleBackColor = true;
@@ -231,7 +237,7 @@
             this.inputValue.AllPower = null;
             this.inputValue.BackColor = System.Drawing.Color.White;
             this.inputValue.ID = null;
-            this.inputValue.Location = new System.Drawing.Point(173, 477);
+            this.inputValue.Location = new System.Drawing.Point(147, 477);
             this.inputValue.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.inputValue.Name = "inputValue";
             this.inputValue.Power = null;
@@ -248,7 +254,7 @@
             this.OperateResult.Location = new System.Drawing.Point(24, 272);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(895, 191);
+            this.OperateResult.Size = new System.Drawing.Size(876, 191);
             this.OperateResult.TabIndex = 88;
             this.OperateResult.Text = "";
             // 
@@ -256,7 +262,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(95, 475);
+            this.label3.Location = new System.Drawing.Point(69, 475);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(72, 27);
             this.label3.TabIndex = 93;
@@ -266,7 +272,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(996, 512);
+            this.ClientSize = new System.Drawing.Size(924, 512);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.collects);
             this.Controls.Add(this.inputValue);

+ 35 - 33
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.cs

@@ -31,12 +31,12 @@ namespace UAS_MES.Make
 
         string ms_id = "";
 
-        StringBuilder sb ;
+        StringBuilder sb;
 
         string sncode = "";
-        StringBuilder oldData ;
+        StringBuilder oldData;
         //记录新数据
-        StringBuilder newData ;
+        StringBuilder newData;
         public Make_UpdateCollectCode()
         {
             InitializeComponent();
@@ -62,15 +62,15 @@ namespace UAS_MES.Make
 
         private void inputValue_KeyDown(object sender, KeyEventArgs e)
         {
-            if (e.KeyCode==Keys.Enter)
+            if (e.KeyCode == Keys.Enter)
             {
                 //输入不能为空
-                if (inputValue.Text=="")
+                if (inputValue.Text == "")
                 {
                     OperateResult.AppendText("<<输入不能为空\n", Color.Red);
                     return;
                 }
-                OperateResult.AppendText(">>"+inputValue.Text+"\n", Color.Black);
+                OperateResult.AppendText(">>" + inputValue.Text + "\n", Color.Black);
                 if (step == 0)
                 {
                     //判断是否有已勾选的项次
@@ -81,10 +81,10 @@ namespace UAS_MES.Make
                             list.Add((ctl as CheckBox));
                         }
                     }
-                    if (list.Count==0)
+                    if (list.Count == 0)
                     {
                         //无勾选的内容
-                        OperateResult.AppendText("<<请先勾选需要更新的信息\n", Color.Red,inputValue);
+                        OperateResult.AppendText("<<请先勾选需要更新的信息\n", Color.Red, inputValue);
                         return;
                     }
                     //判断TSN或者SN是否存在
@@ -96,9 +96,9 @@ namespace UAS_MES.Make
                         return;
                     }
                     //查询序列号状态
-                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_makecode from makeserial where ms_id='"+ms_id+"'", "select");
+                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_makecode from makeserial where ms_id='" + ms_id + "'", "select");
                     //序列号状态码必须是3
-                    if (dt.Rows[0]["ms_status"].ToString()!="3")
+                    if (dt.Rows[0]["ms_status"].ToString() != "3")
                     {
                         OperateResult.AppendText("<<序列号必须是待维修状态\n", Color.Red, inputValue);
                         return;
@@ -106,9 +106,9 @@ namespace UAS_MES.Make
                     sql.Clear();
                     sql.Append("select * from (select rownum rn, ms_prodcode,ms_makecode,ms_salecode,");
                     sql.Append("ms_mac,ms_imei1,ms_bt,ms_netcode,ms_imei2,ms_imei3  from makeserial ");
-                    sql.Append("where ms_firstsn=(select ms_firstsn from makeserial where ms_id='"+ms_id+"')");
+                    sql.Append("where ms_firstsn=(select ms_firstsn from makeserial where ms_id='" + ms_id + "')");
                     sql.Append(" and (nvl(ms_mac,' ')<>' ' or nvl(ms_bt,' ')<>' ' or nvl(ms_imei1,' ')<>' ' ) order by ms_id asc)where rn=1");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(),"select");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     //无值则提示没有需要更新的信息
                     if (dt.Rows.Count == 0)
                     {
@@ -117,12 +117,12 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        info = (DataTable)dh.ExecuteSql("select psr_type,psr_prefix,psr_length from productsnrelation where psr_prodcode='"+dt.Rows[0]["ms_prodcode"].ToString() +"'", "select");
+                        info = (DataTable)dh.ExecuteSql("select psr_type,psr_prefix,psr_length from productsnrelation where psr_prodcode='" + dt.Rows[0]["ms_prodcode"].ToString() + "'", "select");
                         //查询规则显示
                         collectCodeRules.DataSource = info;
                     }
                     step = 1;
-                    OperateResult.AppendText("<<请输入"+((CheckBox)list[0]).Text+"\n", Color.Green, inputValue);
+                    OperateResult.AppendText("<<请输入" + ((CheckBox)list[0]).Text + "\n", Color.Green, inputValue);
                     sb = new StringBuilder();
                     oldData = new StringBuilder();
                     newData = new StringBuilder();
@@ -131,7 +131,7 @@ namespace UAS_MES.Make
                 //采集的关联采集信息
                 {
                     //从第一个开始
-                    switch (((CheckBox)list[step-1]).Text)
+                    switch (((CheckBox)list[step - 1]).Text)
                     {
                         case "MAC/WIFI":
                         case "BT":
@@ -139,13 +139,13 @@ namespace UAS_MES.Make
                             {
                                 //如果一样提示用户“MAC 不允许与原来的值一致”,“请采集MAC”;
                                 OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "不允许与原来的值一致\n", Color.Red);
-                                OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black,inputValue);
+                                OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black, inputValue);
                                 return;
                             }
                             else
                             {
                                 //判断是否有合同号MAC范围
-                                if (dh.CheckExist("SaleMacBTRange", "sr_sacode='"+dt.Rows[0]["ms_salecode"].ToString()+"' and sr_type='"+ ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'"))
+                                if (dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'"))
                                 {
                                     //有范围的情况下看是否在范围内
                                     if (!dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and  sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "' AND  '" + inputValue.Text + "' between sr_startcode and sr_endcode"))
@@ -156,19 +156,20 @@ namespace UAS_MES.Make
                                     }
                                 }
                                 //验证长度前缀
-                                if (!checkPrefixAndLength()) {
+                                if (!checkPrefixAndLength())
+                                {
                                     return;
                                 }
                                 //验证长度前缀通过,验证数据库
-                                if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')<>' ' and  ms_"+ ((CheckBox)list[step - 1]).Text.Split('/')[0] + " ='"+inputValue.Text+"'"))
+                                if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')<>' ' and  ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + " ='" + inputValue.Text + "'"))
                                 {
                                     OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text + ":" + inputValue.Text + "错误,已被使用\n", Color.Red, inputValue);
                                     return;
                                 }
                                 //通过校验
-                                sb.Append("ms_"+((CheckBox)list[step - 1]).Text.Split('/')[0]+" = '"+inputValue.Text+"',");
-                                oldData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":"+ dt.Rows[0]["ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0]].ToString()+",");
-                                newData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" +inputValue.Text+",");
+                                sb.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + " = '" + inputValue.Text + "',");
+                                oldData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + dt.Rows[0]["ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0]].ToString() + ",");
+                                newData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + inputValue.Text + ",");
                             }
                             break;
                         case "网标":
@@ -176,7 +177,8 @@ namespace UAS_MES.Make
                         case "IMEI2":
                         case "IMEI3":
                             //验证长度前缀
-                            if (!checkPrefixAndLength()) {
+                            if (!checkPrefixAndLength())
+                            {
                                 return;
                             }
                             //验证长度前缀通过,验证数据库
@@ -186,7 +188,7 @@ namespace UAS_MES.Make
                                 return;
                             }
                             //通过校验
-                            sb.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text)+" = '"+inputValue.Text+"',");
+                            sb.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + " = '" + inputValue.Text + "',");
                             oldData.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + ":" + dt.Rows[0]["ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text)].ToString() + ",");
                             newData.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + ":" + inputValue.Text + ",");
                             break;
@@ -197,19 +199,19 @@ namespace UAS_MES.Make
                         //更新数据库
                         sql.Clear();
                         sql.Append("update makeserial set ");
-                        sql.Append(sb.ToString().Substring(0,sb.ToString().Length-1));
-                        sql.Append(" where ms_id='"+ms_id+"'");
-                        dh.ExecuteSql(sql.GetString(),"update");
+                        sql.Append(sb.ToString().Substring(0, sb.ToString().Length - 1));
+                        sql.Append(" where ms_id='" + ms_id + "'");
+                        dh.ExecuteSql(sql.GetString(), "update");
                         //提示烧录成功
                         OperateResult.AppendText(">>烧录成功\n", Color.Green);
                         //记录日志
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["ms_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "更新烧录", "原数据:"+oldData.ToString()+"新数据:"+newData.ToString(), sncode,"");
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["ms_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "更新烧录", "原数据:" + oldData.ToString() + "新数据:" + newData.ToString(), sncode, "");
                         step = 0;
                         //清除规则
                         BaseUtil.CleanDataTableData(info);
                         //聚焦,提示
                         inputValue.Focus();
-                        OperateResult.AppendText("<<请采集SN\n", Color.Black,inputValue);
+                        OperateResult.AppendText("<<请采集SN\n", Color.Black, inputValue);
                         //清除LIST
                         list.Clear();
                     }
@@ -217,7 +219,7 @@ namespace UAS_MES.Make
                     {
                         step++;
                         //请输入下一个
-                        OperateResult.AppendText(">>请输入" + ((CheckBox)list[step-1]).Text.Split('/')[0] + "\n", Color.Green,inputValue);
+                        OperateResult.AppendText(">>请输入" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Green, inputValue);
                     }
                 }
             }
@@ -225,9 +227,9 @@ namespace UAS_MES.Make
         private bool checkPrefixAndLength()
         {
             //找到对应的规则
-            for(int i=0;i<info.Rows.Count;i++)
+            for (int i = 0; i < info.Rows.Count; i++)
             {
-                if ((((CheckBox)list[step - 1]).Text.Split('/')[0]=="网标"?"NETCODE": ((CheckBox)list[step - 1]).Text.Split('/')[0])==info.Rows[i]["psr_type"].ToString())
+                if ((((CheckBox)list[step - 1]).Text.Split('/')[0] == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text.Split('/')[0]) == info.Rows[i]["psr_type"].ToString())
                 {
                     //校验长度
                     if ((info.Rows[i]["psr_length"].ToString() == "" ? true : inputValue.Text.Length != int.Parse(info.Rows[i]["psr_length"].ToString())))
@@ -265,7 +267,7 @@ namespace UAS_MES.Make
         private void Mac_CheckedChanged(object sender, EventArgs e)
         {
             //当有checkBox状态改变的时候
-            if (step!=0)
+            if (step != 0)
             {
                 //步骤码归零
                 step = 0;