Browse Source

添加切换账套功能

callm 3 years ago
parent
commit
c93fc72a94

+ 159 - 104
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.Designer.cs

@@ -42,6 +42,16 @@ namespace UAS_MES_NEW.Make
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
             this.CheckItemDGV = new System.Windows.Forms.DataGridView();
+            this.std_class = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_testresult = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_sn = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_mac = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_bt = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_imei1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_imei2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_googlekey = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_videotest = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.std_version = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label6 = new System.Windows.Forms.Label();
             this.WatchPath = new System.Windows.Forms.TextBox();
             this.PSN = new System.Windows.Forms.Label();
@@ -73,19 +83,13 @@ namespace UAS_MES_NEW.Make
             this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ReSet = new UAS_MES_NEW.CustomControl.CustomCheckBox.ReSetCheckBox();
-            this.std_class = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_testresult = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_sn = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_mac = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_bt = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_imei1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_imei2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_googlekey = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_videotest = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.std_version = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.StepCount = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SourceStepCount();
             this.sncode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.OperateResult = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
+            this.rom = new System.Windows.Forms.Label();
+            this.label9 = new System.Windows.Forms.Label();
+            this.ram = new System.Windows.Forms.Label();
+            this.label14 = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.CheckItemDGV)).BeginInit();
             this.SuspendLayout();
             // 
@@ -227,6 +231,89 @@ namespace UAS_MES_NEW.Make
             this.CheckItemDGV.TabIndex = 33;
             this.CheckItemDGV.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(this.CheckItemDGV_CellPainting);
             // 
+            // std_class
+            // 
+            this.std_class.DataPropertyName = "std_class";
+            this.std_class.HeaderText = "检测项";
+            this.std_class.MinimumWidth = 140;
+            this.std_class.Name = "std_class";
+            this.std_class.ReadOnly = true;
+            this.std_class.Width = 150;
+            // 
+            // std_testresult
+            // 
+            this.std_testresult.DataPropertyName = "std_testresult";
+            this.std_testresult.HeaderText = "测试结果";
+            this.std_testresult.MinimumWidth = 150;
+            this.std_testresult.Name = "std_testresult";
+            this.std_testresult.ReadOnly = true;
+            this.std_testresult.Width = 150;
+            // 
+            // std_sn
+            // 
+            this.std_sn.DataPropertyName = "std_sn";
+            this.std_sn.HeaderText = "SN";
+            this.std_sn.MinimumWidth = 100;
+            this.std_sn.Name = "std_sn";
+            this.std_sn.ReadOnly = true;
+            this.std_sn.Visible = false;
+            this.std_sn.Width = 200;
+            // 
+            // std_mac
+            // 
+            this.std_mac.DataPropertyName = "std_mac";
+            this.std_mac.HeaderText = "MAC";
+            this.std_mac.MinimumWidth = 100;
+            this.std_mac.Name = "std_mac";
+            this.std_mac.Visible = false;
+            this.std_mac.Width = 200;
+            // 
+            // std_bt
+            // 
+            this.std_bt.DataPropertyName = "std_bt";
+            this.std_bt.HeaderText = "BT";
+            this.std_bt.MinimumWidth = 100;
+            this.std_bt.Name = "std_bt";
+            this.std_bt.Visible = false;
+            this.std_bt.Width = 200;
+            // 
+            // std_imei1
+            // 
+            this.std_imei1.DataPropertyName = "std_imei1";
+            this.std_imei1.HeaderText = "IMEI1";
+            this.std_imei1.MinimumWidth = 100;
+            this.std_imei1.Name = "std_imei1";
+            this.std_imei1.Visible = false;
+            // 
+            // std_imei2
+            // 
+            this.std_imei2.DataPropertyName = "std_imei2";
+            this.std_imei2.HeaderText = "IMEI2";
+            this.std_imei2.MinimumWidth = 100;
+            this.std_imei2.Name = "std_imei2";
+            this.std_imei2.Visible = false;
+            // 
+            // std_googlekey
+            // 
+            this.std_googlekey.DataPropertyName = "std_googlekey";
+            this.std_googlekey.HeaderText = "GoogleKey";
+            this.std_googlekey.Name = "std_googlekey";
+            this.std_googlekey.Visible = false;
+            // 
+            // std_videotest
+            // 
+            this.std_videotest.DataPropertyName = "std_videotest";
+            this.std_videotest.HeaderText = "老化测试";
+            this.std_videotest.Name = "std_videotest";
+            this.std_videotest.Visible = false;
+            // 
+            // std_version
+            // 
+            this.std_version.DataPropertyName = "std_version";
+            this.std_version.HeaderText = "软件版本";
+            this.std_version.Name = "std_version";
+            this.std_version.Visible = false;
+            // 
             // label6
             // 
             this.label6.AutoSize = true;
@@ -292,7 +379,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.BT.AutoSize = true;
             this.BT.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.BT.Location = new System.Drawing.Point(955, 312);
+            this.BT.Location = new System.Drawing.Point(955, 299);
             this.BT.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.BT.Name = "BT";
             this.BT.Size = new System.Drawing.Size(0, 41);
@@ -302,7 +389,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.label13.AutoSize = true;
             this.label13.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label13.Location = new System.Drawing.Point(761, 312);
+            this.label13.Location = new System.Drawing.Point(761, 299);
             this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label13.Name = "label13";
             this.label13.Size = new System.Drawing.Size(56, 41);
@@ -313,7 +400,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.IMEI1.AutoSize = true;
             this.IMEI1.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.IMEI1.Location = new System.Drawing.Point(955, 386);
+            this.IMEI1.Location = new System.Drawing.Point(955, 371);
             this.IMEI1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.IMEI1.Name = "IMEI1";
             this.IMEI1.Size = new System.Drawing.Size(0, 41);
@@ -323,7 +410,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.label15.AutoSize = true;
             this.label15.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label15.Location = new System.Drawing.Point(761, 386);
+            this.label15.Location = new System.Drawing.Point(761, 365);
             this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label15.Name = "label15";
             this.label15.Size = new System.Drawing.Size(104, 41);
@@ -344,7 +431,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.label17.AutoSize = true;
             this.label17.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label17.Location = new System.Drawing.Point(1276, 165);
+            this.label17.Location = new System.Drawing.Point(1276, 161);
             this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label17.Name = "label17";
             this.label17.Size = new System.Drawing.Size(104, 41);
@@ -376,7 +463,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.Aging.AutoSize = true;
             this.Aging.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.Aging.Location = new System.Drawing.Point(1505, 320);
+            this.Aging.Location = new System.Drawing.Point(1505, 299);
             this.Aging.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.Aging.Name = "Aging";
             this.Aging.Size = new System.Drawing.Size(0, 41);
@@ -386,7 +473,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.label21.AutoSize = true;
             this.label21.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label21.Location = new System.Drawing.Point(1276, 310);
+            this.label21.Location = new System.Drawing.Point(1276, 299);
             this.label21.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label21.Name = "label21";
             this.label21.Size = new System.Drawing.Size(146, 41);
@@ -397,7 +484,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.Version.AutoSize = true;
             this.Version.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.Version.Location = new System.Drawing.Point(1506, 385);
+            this.Version.Location = new System.Drawing.Point(1506, 371);
             this.Version.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.Version.MaximumSize = new System.Drawing.Size(360, 0);
             this.Version.Name = "Version";
@@ -408,7 +495,7 @@ namespace UAS_MES_NEW.Make
             // 
             this.label23.AutoSize = true;
             this.label23.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label23.Location = new System.Drawing.Point(1276, 375);
+            this.label23.Location = new System.Drawing.Point(1276, 365);
             this.label23.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label23.Name = "label23";
             this.label23.Size = new System.Drawing.Size(146, 41);
@@ -531,89 +618,6 @@ namespace UAS_MES_NEW.Make
             this.ReSet.Text = "恢复出厂设置";
             this.ReSet.UseVisualStyleBackColor = true;
             // 
-            // std_class
-            // 
-            this.std_class.DataPropertyName = "std_class";
-            this.std_class.HeaderText = "检测项";
-            this.std_class.MinimumWidth = 140;
-            this.std_class.Name = "std_class";
-            this.std_class.ReadOnly = true;
-            this.std_class.Width = 150;
-            // 
-            // std_testresult
-            // 
-            this.std_testresult.DataPropertyName = "std_testresult";
-            this.std_testresult.HeaderText = "测试结果";
-            this.std_testresult.MinimumWidth = 150;
-            this.std_testresult.Name = "std_testresult";
-            this.std_testresult.ReadOnly = true;
-            this.std_testresult.Width = 150;
-            // 
-            // std_sn
-            // 
-            this.std_sn.DataPropertyName = "std_sn";
-            this.std_sn.HeaderText = "SN";
-            this.std_sn.MinimumWidth = 100;
-            this.std_sn.Name = "std_sn";
-            this.std_sn.ReadOnly = true;
-            this.std_sn.Visible = false;
-            this.std_sn.Width = 200;
-            // 
-            // std_mac
-            // 
-            this.std_mac.DataPropertyName = "std_mac";
-            this.std_mac.HeaderText = "MAC";
-            this.std_mac.MinimumWidth = 100;
-            this.std_mac.Name = "std_mac";
-            this.std_mac.Visible = false;
-            this.std_mac.Width = 200;
-            // 
-            // std_bt
-            // 
-            this.std_bt.DataPropertyName = "std_bt";
-            this.std_bt.HeaderText = "BT";
-            this.std_bt.MinimumWidth = 100;
-            this.std_bt.Name = "std_bt";
-            this.std_bt.Visible = false;
-            this.std_bt.Width = 200;
-            // 
-            // std_imei1
-            // 
-            this.std_imei1.DataPropertyName = "std_imei1";
-            this.std_imei1.HeaderText = "IMEI1";
-            this.std_imei1.MinimumWidth = 100;
-            this.std_imei1.Name = "std_imei1";
-            this.std_imei1.Visible = false;
-            // 
-            // std_imei2
-            // 
-            this.std_imei2.DataPropertyName = "std_imei2";
-            this.std_imei2.HeaderText = "IMEI2";
-            this.std_imei2.MinimumWidth = 100;
-            this.std_imei2.Name = "std_imei2";
-            this.std_imei2.Visible = false;
-            // 
-            // std_googlekey
-            // 
-            this.std_googlekey.DataPropertyName = "std_googlekey";
-            this.std_googlekey.HeaderText = "GoogleKey";
-            this.std_googlekey.Name = "std_googlekey";
-            this.std_googlekey.Visible = false;
-            // 
-            // std_videotest
-            // 
-            this.std_videotest.DataPropertyName = "std_videotest";
-            this.std_videotest.HeaderText = "老化测试";
-            this.std_videotest.Name = "std_videotest";
-            this.std_videotest.Visible = false;
-            // 
-            // std_version
-            // 
-            this.std_version.DataPropertyName = "std_version";
-            this.std_version.HeaderText = "软件版本";
-            this.std_version.Name = "std_version";
-            this.std_version.Visible = false;
-            // 
             // StepCount
             // 
             this.StepCount.LineCode = null;
@@ -644,18 +648,65 @@ namespace UAS_MES_NEW.Make
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(768, 437);
+            this.OperateResult.Location = new System.Drawing.Point(768, 475);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(991, 324);
+            this.OperateResult.Size = new System.Drawing.Size(991, 286);
             this.OperateResult.TabIndex = 27;
             this.OperateResult.Text = "";
             // 
+            // rom
+            // 
+            this.rom.AutoSize = true;
+            this.rom.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.rom.Location = new System.Drawing.Point(1506, 423);
+            this.rom.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.rom.MaximumSize = new System.Drawing.Size(360, 0);
+            this.rom.Name = "rom";
+            this.rom.Size = new System.Drawing.Size(0, 41);
+            this.rom.TabIndex = 59;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label9.Location = new System.Drawing.Point(1276, 423);
+            this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(146, 41);
+            this.label9.TabIndex = 58;
+            this.label9.Text = "存储内存";
+            // 
+            // ram
+            // 
+            this.ram.AutoSize = true;
+            this.ram.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.ram.Location = new System.Drawing.Point(955, 423);
+            this.ram.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ram.Name = "ram";
+            this.ram.Size = new System.Drawing.Size(0, 41);
+            this.ram.TabIndex = 57;
+            // 
+            // label14
+            // 
+            this.label14.AutoSize = true;
+            this.label14.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label14.Location = new System.Drawing.Point(761, 423);
+            this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label14.Name = "label14";
+            this.label14.Size = new System.Drawing.Size(146, 41);
+            this.label14.TabIndex = 56;
+            this.label14.Text = "运行内存";
+            // 
             // Make_GetTestFileData
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1772, 866);
+            this.Controls.Add(this.rom);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.ram);
+            this.Controls.Add(this.label14);
             this.Controls.Add(this.ZHANXUN);
             this.Controls.Add(this.MTK);
             this.Controls.Add(this.Version);
@@ -761,5 +812,9 @@ namespace UAS_MES_NEW.Make
         private System.Windows.Forms.DataGridViewTextBoxColumn std_version;
         private System.Windows.Forms.RadioButton MTK;
         private System.Windows.Forms.RadioButton ZHANXUN;
+        private System.Windows.Forms.Label rom;
+        private System.Windows.Forms.Label label9;
+        private System.Windows.Forms.Label ram;
+        private System.Windows.Forms.Label label14;
     }
 }

+ 24 - 8
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.cs

@@ -92,8 +92,12 @@ namespace UAS_MES_NEW.Make
                     }
                     string ms_prodcode = dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsid + "'").ToString();
                     DataTable dt = new DataTable();
+                    if (Directory.Exists(Application.StartupPath + "/" + DateTime.Now.ToString("yyyy-MM-dd") + @"/" + sncode.Text))
+                    {
+                        DirectoryInfo di = new DirectoryInfo(Application.StartupPath + "/" + DateTime.Now.ToString("yyyy-MM-dd") + @"/" + sncode.Text);
+                        di.Delete(true);
+                    }
                     BaseUtil.GetDataFromDevice("GETFILE", WatchPath.Text + " ./" + DateTime.Now.ToString("yyyy-MM-dd") + @"/" + sncode.Text);
-                    Console.WriteLine(Application.StartupPath + "/" + DateTime.Now.ToString("yyyy-MM-dd") + @"/" + sncode.Text);
                     string[] files = Directory.GetFiles(Application.StartupPath + "/" + DateTime.Now.ToString("yyyy-MM-dd") + @"/" + sncode.Text + "", "*.csv");
                     BaseUtil.OpenCSVFile(ref dt, files[0]);
                     //移除标题行
@@ -109,12 +113,11 @@ namespace UAS_MES_NEW.Make
                     dt.Columns[7].ColumnName = "std_googlekey";
                     dt.Columns[8].ColumnName = "std_videotest";
                     dt.Columns[9].ColumnName = "std_version";
-                    dt.DefaultView.Sort = "std_testresult";
-                    CheckItemDGV.DataSource = dt;
-                    bool Result = true;
-
-                    for (int i = 0; i < dt.Rows.Count; i++)
-                    {
+                    if (dt.Columns.Count > 11) {
+                        dt.Columns[10].ColumnName = "std_rom";
+                        dt.Columns[11].ColumnName = "std_ram";
+                    }
+                    if (dt.Rows.Count > 0) {
                         PSN.Text = dt.Rows[0]["std_sn"].ToString();
                         MAC.Text = dt.Rows[0]["std_mac"].ToString().Replace(":", "").ToUpper();
                         BT.Text = dt.Rows[0]["std_bt"].ToString().Replace(":", "").ToUpper();
@@ -123,6 +126,19 @@ namespace UAS_MES_NEW.Make
                         GoogleKey.Text = dt.Rows[0]["std_googlekey"].ToString().Replace("null", "").Replace("unknow", "").ToUpper();
                         Aging.Text = dt.Rows[0]["std_videotest"].ToString().Replace("null", "").Replace("unknow", "").ToUpper();
                         Version.Text = dt.Rows[0]["std_version"].ToString().Replace("null", "").Replace("unknow", "");
+                        if (dt.Columns.Count > 11)
+                        {
+                            ram.Text = dt.Rows[0]["std_ram"].ToString().Replace("null", "").Replace("unknow", "");
+                            rom.Text = dt.Rows[0]["std_rom"].ToString().Replace("null", "").Replace("unknow", "");
+                        }
+                    }
+                    DataView dv = dt.DefaultView;
+                    dv.Sort = "std_testresult Asc";
+                    dt = dv.ToTable();
+                    CheckItemDGV.DataSource = dt;
+                    bool Result = true;
+                    for (int i = 0; i < dt.Rows.Count; i++)
+                    {
                         if (dt.Rows[i]["std_testresult"].ToString() != "OK" || dt.Rows[i]["std_testresult"].ToString() == "NOTEST")
                         {
                             Result = false;
@@ -207,7 +223,7 @@ namespace UAS_MES_NEW.Make
                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "标签核对", "参数核对成功", sncode.Text, "");
                         //SN核对成功
                         //>> 请输入SN
-                        OperateResult.AppendText("<<" + sncode.Text + "信息核对成功,转换SN" + PSN.Text + "\n", Color.Green, sncode);
+                        OperateResult.AppendText("<<" + sncode.Text + "信息核对成\n", Color.Green, sncode);
                         OperateResult.AppendText(">>请输入SN\n", Color.Black);
                         SetCheck set = new SetCheck("OK", Color.Green);
                         BaseUtil.SetFormCenter(set);

+ 0 - 30
UAS_MES_PW/FunctionCode/Make/Make_GetTestFileData.resx

@@ -147,34 +147,4 @@
   <metadata name="std_version.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="std_class.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_testresult.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_sn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_mac.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_bt.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_imei1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_imei2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_googlekey.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_videotest.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="std_version.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>

+ 1 - 0
UAS_MES_PW/PublicMethod/BaseUtil.cs

@@ -1516,6 +1516,7 @@ namespace UAS_MES_NEW.PublicMethod
                     p.Start();
                     value = p.StandardOutput.ReadToEnd().Replace(":", "").ToUpper();
                     p.Close();
+                 
                     break;
                 case "INSTALL":
                     p.StartInfo.Arguments = " install  " + Path;

+ 27 - 1
UAS_MES_YD/CustomControl/TextBoxWithIcon/SnCollectionBox.cs

@@ -7,6 +7,8 @@ using System.Linq;
 using System.Text;
 using System.Windows.Forms;
 using UAS_MES_NEW.Entity;
+using UAS_MES_NEW.PublicMethod;
+using DevExpress.XtraBars;
 
 namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
 {
@@ -21,7 +23,7 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
         {
             get
             {
-                if (SystemInf.UpperCollection)
+                if (SystemInf.UpperCollection && !base.Text.Contains("CHANGEUSER:"))
                     return base.Text.ToUpper();
                 else
                     return base.Text;
@@ -38,6 +40,30 @@ namespace UAS_MES_NEW.CustomControl.TextBoxWithIcon
             if (e.KeyCode == Keys.Enter)
             {
                 this.SelectAll();
+                //切换账号功能
+                if (Text.Contains("CHANGEUSER:"))
+                {
+                    string UserCode = Text.Replace("CHANGEUSER:", "").Split('|')[0];
+                    string Password = Text.Replace("CHANGEUSER:", "").Split('|')[1];
+                    string oErr = "";
+                    if (!LogicHandler.CheckUserLogin(UserCode, Password, out oErr)) { MessageBox.Show(oErr); return; }
+
+                    if (!LogicHandler.CheckUserAndResourcePassed(UserCode, User.UserSourceCode, out oErr)) { MessageBox.Show(oErr); return; }
+
+                    string[] field = { "em_code,em_depart,em_type,em_name,em_position,em_professname,em_type,ug_code,ug_name" };
+                    DataTable UserInf = SystemInf.dh.getFieldsDataByCondition("Employee left join cs$userresource on ur_emcode=em_code left join cs$usergroup on ug_code=ur_groupcode", field, "upper(em_code)='" + UserCode.ToUpper() + "' or em_mobile='" + UserCode + "'");
+                    //通过Source表关联岗位资源编号查询出当前的执行工序
+                    User.UserCode = UserInf.Rows[0]["em_code"].ToString();
+                    User.UserName = UserInf.Rows[0]["em_name"].ToString();
+                    Control ctl = BaseUtil.GetControl(this, "Main");
+                    if (ctl != null)
+                    {
+                        Main Main = (Main)ctl;
+                        Main.Inf_username_label.Caption = "姓名 : " + User.UserName;
+                    }
+                    Clear();
+                    return;
+                }
             }
         }
     }

+ 1 - 1
UAS_MES_YD/Main.Designer.cs

@@ -445,7 +445,7 @@
         private DevExpress.XtraBars.BarButtonItem barButtonItem1;
         private DevExpress.XtraBars.BarButtonItem barButtonItem2;
         private DevExpress.XtraBars.Bar BaseInf;
-        private DevExpress.XtraBars.BarStaticItem Inf_username_label;
+        public DevExpress.XtraBars.BarStaticItem Inf_username_label;
         private DevExpress.XtraBars.BarStaticItem Inf_currentstep_label;
         private DevExpress.XtraBars.BarStaticItem Inf_linecode_label;
         private DevExpress.XtraBars.BarStaticItem Inf_source_label;

+ 7 - 0
UAS_MES_YD/PublicMethod/BaseUtil.cs

@@ -41,6 +41,13 @@ namespace UAS_MES_NEW.PublicMethod
             return !((c.Client.Poll(1000, SelectMode.SelectRead) && (c.Client.Available == 0)) || !c.Client.Connected);
         }
 
+        public static Control GetControl(Control ctl,string Name) {
+            if (ctl.Name == Name)
+                return ctl;
+            else
+               return GetControl(ctl.Parent, Name);
+        }
+
         /// <summary>
         /// 通过DataTable的ColumnName和Caption来拼接一条语句
         /// </summary>

+ 10 - 0
UAS_MES_YD/UAS_MES_YD.csproj

@@ -1190,6 +1190,12 @@
       <DesignTimeSharedInput>True</DesignTimeSharedInput>
       <DependentUpon>Settings.settings</DependentUpon>
     </Compile>
+    <Compile Include="PublicForm\Change_user.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="PublicForm\Change_user.Designer.cs">
+      <DependentUpon>Change_user.cs</DependentUpon>
+    </Compile>
     <Compile Include="PublicForm\ChangePwd.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1276,6 +1282,7 @@
     </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\HeadBar\HeadBar.resx">
       <DependentUpon>HeadBar.cs</DependentUpon>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\HeadBar\HeadBar.zu.resx">
       <DependentUpon>HeadBar.cs</DependentUpon>
@@ -1681,6 +1688,9 @@
       <SubType>Designer</SubType>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
+    <EmbeddedResource Include="PublicForm\Change_user.resx">
+      <DependentUpon>Change_user.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="PublicForm\ChangePwd.resx">
       <DependentUpon>ChangePwd.cs</DependentUpon>
     </EmbeddedResource>