Browse Source

维修作业功能开发

章政 7 years ago
parent
commit
d7856fc6cc

+ 158 - 125
UAS-MES/FunctionCode/Make/Make_NewMatainInf.Designer.cs

@@ -28,54 +28,47 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.Windows.Forms.ListViewItem listViewItem4 = new System.Windows.Forms.ListViewItem(new string[] {
+            System.Windows.Forms.ListViewItem listViewItem1 = new System.Windows.Forms.ListViewItem(new string[] {
             "",
             "主板"}, -1);
-            System.Windows.Forms.ListViewItem listViewItem5 = new System.Windows.Forms.ListViewItem(new string[] {
+            System.Windows.Forms.ListViewItem listViewItem2 = new System.Windows.Forms.ListViewItem(new string[] {
             "",
             "液晶屏"}, -1);
-            System.Windows.Forms.ListViewItem listViewItem6 = new System.Windows.Forms.ListViewItem(new string[] {
+            System.Windows.Forms.ListViewItem listViewItem3 = new System.Windows.Forms.ListViewItem(new string[] {
             "",
             "电路板"}, -1);
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Make_NewMatainInf));
-            this.headBar1 = new UAS_MES.CustomControl.HeadBar();
             this.mbc_component_lsv = new System.Windows.Forms.ListView();
             this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.mbc_component = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.nrg_name_lsv = new System.Windows.Forms.ListView();
             this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.nrg_name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.nrg_code = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.nrg_name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.nr_name_lsv = new System.Windows.Forms.ListView();
             this.columnHeader9 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.nr_code = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.nr_name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.groupBoxWithBorder1 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.bc_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.bc_name_label = new System.Windows.Forms.Label();
-            this.bg_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.bg_name_label = new System.Windows.Forms.Label();
+            this.nr_groupcode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.mbr_dutycode_lsv = new System.Windows.Forms.ListView();
             this.columnHeader5 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.mbr_dutycode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.nd_code = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.nd_name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.mbr_solutioncode_lsv = new System.Windows.Forms.ListView();
             this.columnHeader7 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
-            this.mbr_solutioncode = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.so_code = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.so_name = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.Cancel = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Save = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.groupBoxWithBorder1 = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.bc_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.bc_name_label = new System.Windows.Forms.Label();
+            this.bg_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.bg_name_label = new System.Windows.Forms.Label();
+            this.headBar1 = new UAS_MES.CustomControl.HeadBar();
             this.groupBoxWithBorder1.SuspendLayout();
             this.SuspendLayout();
             // 
-            // headBar1
-            // 
-            this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
-            this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
-            this.headBar1.Location = new System.Drawing.Point(0, 0);
-            this.headBar1.Margin = new System.Windows.Forms.Padding(4);
-            this.headBar1.Name = "headBar1";
-            this.headBar1.Size = new System.Drawing.Size(832, 40);
-            this.headBar1.TabIndex = 0;
-            this.headBar1.Title = "新增维修信息";
-            // 
             // mbc_component_lsv
             // 
             this.mbc_component_lsv.CheckBoxes = true;
@@ -83,13 +76,13 @@
             this.columnHeader1,
             this.mbc_component});
             this.mbc_component_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            listViewItem4.StateImageIndex = 0;
-            listViewItem5.StateImageIndex = 0;
-            listViewItem6.StateImageIndex = 0;
+            listViewItem1.StateImageIndex = 0;
+            listViewItem2.StateImageIndex = 0;
+            listViewItem3.StateImageIndex = 0;
             this.mbc_component_lsv.Items.AddRange(new System.Windows.Forms.ListViewItem[] {
-            listViewItem4,
-            listViewItem5,
-            listViewItem6});
+            listViewItem1,
+            listViewItem2,
+            listViewItem3});
             this.mbc_component_lsv.Location = new System.Drawing.Point(12, 159);
             this.mbc_component_lsv.Name = "mbc_component_lsv";
             this.mbc_component_lsv.Size = new System.Drawing.Size(291, 190);
@@ -106,15 +99,16 @@
             // mbc_component
             // 
             this.mbc_component.Text = "不良组件";
-            this.mbc_component.Width = 253;
+            this.mbc_component.Width = 164;
             // 
             // nrg_name_lsv
             // 
             this.nrg_name_lsv.CheckBoxes = true;
             this.nrg_name_lsv.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
             this.columnHeader3,
-            this.nrg_name,
-            this.nrg_code});
+            this.nrg_code,
+            this.nrg_name});
+            this.nrg_name_lsv.Cursor = System.Windows.Forms.Cursors.Default;
             this.nrg_name_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.nrg_name_lsv.Location = new System.Drawing.Point(309, 159);
             this.nrg_name_lsv.Name = "nrg_name_lsv";
@@ -129,23 +123,26 @@
             this.columnHeader3.Text = "";
             this.columnHeader3.Width = 30;
             // 
-            // nrg_name
-            // 
-            this.nrg_name.Text = "不良原因组";
-            this.nrg_name.Width = 224;
-            // 
             // nrg_code
             // 
             this.nrg_code.Text = "";
             this.nrg_code.Width = 0;
             // 
+            // nrg_name
+            // 
+            this.nrg_name.Text = "不良原因组";
+            this.nrg_name.Width = 152;
+            // 
             // nr_name_lsv
             // 
+            this.nr_name_lsv.CheckBoxes = true;
             this.nr_name_lsv.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
             this.columnHeader9,
-            this.nr_name});
+            this.nr_code,
+            this.nr_name,
+            this.nr_groupcode});
             this.nr_name_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.nr_name_lsv.Location = new System.Drawing.Point(579, 159);
+            this.nr_name_lsv.Location = new System.Drawing.Point(581, 159);
             this.nr_name_lsv.Name = "nr_name_lsv";
             this.nr_name_lsv.Size = new System.Drawing.Size(241, 381);
             this.nr_name_lsv.TabIndex = 3;
@@ -158,10 +155,116 @@
             this.columnHeader9.Text = "";
             this.columnHeader9.Width = 30;
             // 
+            // nr_code
+            // 
+            this.nr_code.Width = 0;
+            // 
             // nr_name
             // 
             this.nr_name.Text = "不良原因";
-            this.nr_name.Width = 201;
+            this.nr_name.Width = 129;
+            // 
+            // nr_groupcode
+            // 
+            this.nr_groupcode.Width = 0;
+            // 
+            // mbr_dutycode_lsv
+            // 
+            this.mbr_dutycode_lsv.CheckBoxes = true;
+            this.mbr_dutycode_lsv.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader5,
+            this.nd_code,
+            this.nd_name});
+            this.mbr_dutycode_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mbr_dutycode_lsv.Location = new System.Drawing.Point(12, 355);
+            this.mbr_dutycode_lsv.Name = "mbr_dutycode_lsv";
+            this.mbr_dutycode_lsv.Size = new System.Drawing.Size(291, 185);
+            this.mbr_dutycode_lsv.TabIndex = 5;
+            this.mbr_dutycode_lsv.UseCompatibleStateImageBehavior = false;
+            this.mbr_dutycode_lsv.View = System.Windows.Forms.View.Details;
+            this.mbr_dutycode_lsv.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.OnlyCheckOne_ItemChecked);
+            // 
+            // columnHeader5
+            // 
+            this.columnHeader5.Text = "";
+            this.columnHeader5.Width = 30;
+            // 
+            // nd_code
+            // 
+            this.nd_code.Text = "责任别";
+            this.nd_code.Width = 0;
+            // 
+            // nd_name
+            // 
+            this.nd_name.Text = "责任别";
+            this.nd_name.Width = 120;
+            // 
+            // mbr_solutioncode_lsv
+            // 
+            this.mbr_solutioncode_lsv.CheckBoxes = true;
+            this.mbr_solutioncode_lsv.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader7,
+            this.so_code,
+            this.so_name});
+            this.mbr_solutioncode_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.mbr_solutioncode_lsv.Location = new System.Drawing.Point(309, 355);
+            this.mbr_solutioncode_lsv.Name = "mbr_solutioncode_lsv";
+            this.mbr_solutioncode_lsv.Size = new System.Drawing.Size(264, 185);
+            this.mbr_solutioncode_lsv.TabIndex = 6;
+            this.mbr_solutioncode_lsv.UseCompatibleStateImageBehavior = false;
+            this.mbr_solutioncode_lsv.View = System.Windows.Forms.View.Details;
+            this.mbr_solutioncode_lsv.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.OnlyCheckOne_ItemChecked);
+            // 
+            // columnHeader7
+            // 
+            this.columnHeader7.Text = "";
+            this.columnHeader7.Width = 30;
+            // 
+            // so_code
+            // 
+            this.so_code.Text = "解决方案";
+            this.so_code.Width = 0;
+            // 
+            // so_name
+            // 
+            this.so_name.Text = "解决方案";
+            this.so_name.Width = 120;
+            // 
+            // Cancel
+            // 
+            this.Cancel.AllPower = null;
+            this.Cancel.BackColor = System.Drawing.Color.Transparent;
+            this.Cancel.DownImage = ((System.Drawing.Image)(resources.GetObject("Cancel.DownImage")));
+            this.Cancel.Image = null;
+            this.Cancel.IsShowBorder = true;
+            this.Cancel.Location = new System.Drawing.Point(435, 563);
+            this.Cancel.MoveImage = ((System.Drawing.Image)(resources.GetObject("Cancel.MoveImage")));
+            this.Cancel.Name = "Cancel";
+            this.Cancel.NormalImage = ((System.Drawing.Image)(resources.GetObject("Cancel.NormalImage")));
+            this.Cancel.Power = null;
+            this.Cancel.Size = new System.Drawing.Size(80, 35);
+            this.Cancel.TabIndex = 58;
+            this.Cancel.Text = "取消";
+            this.Cancel.UseVisualStyleBackColor = false;
+            this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
+            // 
+            // Save
+            // 
+            this.Save.AllPower = "ifall";
+            this.Save.BackColor = System.Drawing.Color.Transparent;
+            this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
+            this.Save.Image = null;
+            this.Save.IsShowBorder = true;
+            this.Save.Location = new System.Drawing.Point(317, 563);
+            this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
+            this.Save.Name = "Save";
+            this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
+            this.Save.Power = null;
+            this.Save.Size = new System.Drawing.Size(80, 35);
+            this.Save.TabIndex = 57;
+            this.Save.Text = "保存";
+            this.Save.UseVisualStyleBackColor = false;
+            this.Save.Click += new System.EventHandler(this.Save_Click);
             // 
             // groupBoxWithBorder1
             // 
@@ -244,90 +347,16 @@
             this.bg_name_label.TabIndex = 99;
             this.bg_name_label.Text = "不良代码组";
             // 
-            // mbr_dutycode_lsv
-            // 
-            this.mbr_dutycode_lsv.CheckBoxes = true;
-            this.mbr_dutycode_lsv.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader5,
-            this.mbr_dutycode});
-            this.mbr_dutycode_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mbr_dutycode_lsv.Location = new System.Drawing.Point(12, 355);
-            this.mbr_dutycode_lsv.Name = "mbr_dutycode_lsv";
-            this.mbr_dutycode_lsv.Size = new System.Drawing.Size(291, 185);
-            this.mbr_dutycode_lsv.TabIndex = 5;
-            this.mbr_dutycode_lsv.UseCompatibleStateImageBehavior = false;
-            this.mbr_dutycode_lsv.View = System.Windows.Forms.View.Details;
-            this.mbr_dutycode_lsv.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.OnlyCheckOne_ItemChecked);
-            // 
-            // columnHeader5
-            // 
-            this.columnHeader5.Text = "";
-            this.columnHeader5.Width = 30;
-            // 
-            // mbr_dutycode
-            // 
-            this.mbr_dutycode.Text = "责任别";
-            this.mbr_dutycode.Width = 253;
-            // 
-            // mbr_solutioncode_lsv
-            // 
-            this.mbr_solutioncode_lsv.CheckBoxes = true;
-            this.mbr_solutioncode_lsv.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
-            this.columnHeader7,
-            this.mbr_solutioncode});
-            this.mbr_solutioncode_lsv.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mbr_solutioncode_lsv.Location = new System.Drawing.Point(309, 355);
-            this.mbr_solutioncode_lsv.Name = "mbr_solutioncode_lsv";
-            this.mbr_solutioncode_lsv.Size = new System.Drawing.Size(264, 185);
-            this.mbr_solutioncode_lsv.TabIndex = 6;
-            this.mbr_solutioncode_lsv.UseCompatibleStateImageBehavior = false;
-            this.mbr_solutioncode_lsv.View = System.Windows.Forms.View.Details;
-            this.mbr_solutioncode_lsv.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.OnlyCheckOne_ItemChecked);
-            // 
-            // columnHeader7
-            // 
-            this.columnHeader7.Text = "";
-            this.columnHeader7.Width = 30;
-            // 
-            // mbr_solutioncode
-            // 
-            this.mbr_solutioncode.Text = "解决方案";
-            this.mbr_solutioncode.Width = 222;
-            // 
-            // Cancel
-            // 
-            this.Cancel.AllPower = null;
-            this.Cancel.BackColor = System.Drawing.Color.Transparent;
-            this.Cancel.DownImage = ((System.Drawing.Image)(resources.GetObject("Cancel.DownImage")));
-            this.Cancel.Image = null;
-            this.Cancel.IsShowBorder = true;
-            this.Cancel.Location = new System.Drawing.Point(435, 563);
-            this.Cancel.MoveImage = ((System.Drawing.Image)(resources.GetObject("Cancel.MoveImage")));
-            this.Cancel.Name = "Cancel";
-            this.Cancel.NormalImage = ((System.Drawing.Image)(resources.GetObject("Cancel.NormalImage")));
-            this.Cancel.Power = null;
-            this.Cancel.Size = new System.Drawing.Size(80, 35);
-            this.Cancel.TabIndex = 58;
-            this.Cancel.Text = "取消";
-            this.Cancel.UseVisualStyleBackColor = false;
-            this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
-            // 
-            // Save
+            // headBar1
             // 
-            this.Save.AllPower = "ifall";
-            this.Save.BackColor = System.Drawing.Color.Transparent;
-            this.Save.DownImage = ((System.Drawing.Image)(resources.GetObject("Save.DownImage")));
-            this.Save.Image = null;
-            this.Save.IsShowBorder = true;
-            this.Save.Location = new System.Drawing.Point(317, 563);
-            this.Save.MoveImage = ((System.Drawing.Image)(resources.GetObject("Save.MoveImage")));
-            this.Save.Name = "Save";
-            this.Save.NormalImage = ((System.Drawing.Image)(resources.GetObject("Save.NormalImage")));
-            this.Save.Power = null;
-            this.Save.Size = new System.Drawing.Size(80, 35);
-            this.Save.TabIndex = 57;
-            this.Save.Text = "保存";
-            this.Save.UseVisualStyleBackColor = false;
+            this.headBar1.BackColor = System.Drawing.SystemColors.ControlDarkDark;
+            this.headBar1.Dock = System.Windows.Forms.DockStyle.Top;
+            this.headBar1.Location = new System.Drawing.Point(0, 0);
+            this.headBar1.Margin = new System.Windows.Forms.Padding(4);
+            this.headBar1.Name = "headBar1";
+            this.headBar1.Size = new System.Drawing.Size(832, 40);
+            this.headBar1.TabIndex = 0;
+            this.headBar1.Title = "新增维修信息";
             // 
             // Make_NewMatainInf
             // 
@@ -374,11 +403,15 @@
         private System.Windows.Forms.ColumnHeader columnHeader3;
         private System.Windows.Forms.ColumnHeader nrg_name;
         private System.Windows.Forms.ColumnHeader columnHeader5;
-        private System.Windows.Forms.ColumnHeader mbr_dutycode;
+        private System.Windows.Forms.ColumnHeader nd_code;
         private System.Windows.Forms.ColumnHeader columnHeader7;
-        private System.Windows.Forms.ColumnHeader mbr_solutioncode;
+        private System.Windows.Forms.ColumnHeader so_code;
         private System.Windows.Forms.ColumnHeader columnHeader9;
         private System.Windows.Forms.ColumnHeader nr_name;
         private System.Windows.Forms.ColumnHeader nrg_code;
+        private System.Windows.Forms.ColumnHeader nr_code;
+        private System.Windows.Forms.ColumnHeader nr_groupcode;
+        private System.Windows.Forms.ColumnHeader nd_name;
+        private System.Windows.Forms.ColumnHeader so_name;
     }
 }

+ 146 - 4
UAS-MES/FunctionCode/Make/Make_NewMatainInf.cs

@@ -7,6 +7,7 @@ using System.Linq;
 using System.Text;
 using System.Windows.Forms;
 using UAS_MES.DataOperate;
+using UAS_MES.Entity;
 using UAS_MES.PublicMethod;
 
 namespace UAS_MES.Make
@@ -17,19 +18,38 @@ namespace UAS_MES.Make
         /// 序列号
         /// </summary>
         string sncode = "";
-
+        /// <summary>
+        /// 不良组代码
+        /// </summary>
+        string bgcode = "";
+        /// <summary>
+        /// 不良代码
+        /// </summary>
+        string bccode = "";
+        /// <summary>
+        /// MakeSerial表ID
+        /// </summary>
+        string msid = "";
+        /// <summary>
+        /// MakeBad表主键
+        /// </summary>
+        string mbid = "";
         DataHelper dh;
 
         DataTable dt;
 
-        LogStringBuilder sql=new LogStringBuilder();
+        LogStringBuilder sql = new LogStringBuilder();
 
-        public Make_NewMatainInf(string iBgName, string iBcName, string iSnCode)
+        public Make_NewMatainInf(string iBgName, string iBgCode, string iBcName, string iBccode, string iSnCode, string iMsID, string iMbID)
         {
             InitializeComponent();
             bg_name.Text = iBgName;
             bc_name.Text = iBcName;
+            bgcode = iBgCode;
+            bccode = iBccode;
             sncode = iSnCode;
+            msid = iMsID;
+            mbid = iMbID;
         }
 
         private void Make_NewMatainInf_Load(object sender, EventArgs e)
@@ -37,11 +57,43 @@ namespace UAS_MES.Make
             dh = new DataHelper();
             string pr_code = dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_sncode='" + sncode + "'").ToString();
             string pk_code = dh.getFieldDataByCondition("product left join productkind on pk_name=pr_kind", "pk_code", "pr_code='" + pr_code + "'").ToString();
+            //加载不良原因组数据
             sql.Clear();
-            sql.Append("select nrg_name,nrg_code from PRODUCTBADREASONGROUP left join ");
+            sql.Append("select nrg_code,nrg_name from PRODUCTBADREASONGROUP left join ");
             sql.Append("QUA_NGReasonGroup  on  nrg_code=pbr_brgcode where  pbr_kindcode='" + pk_code + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            //未查询到则查询全部数据
+            if (dt.Rows.Count == 0)
+                dt = (DataTable)dh.ExecuteSql("select nrg_code,nrg_name from QUA_NGReasonGroup where nrg_statuscode ='AUDITED'", "select");
             AddDataToListView(nrg_name_lsv, dt);
+            //加载不良原因
+            string nrg_code = "";
+            for (int i = 0; i < dt.Rows.Count; i++)
+            {
+                if (i == dt.Rows.Count - 1)
+                    nrg_code += "'" + dt.Rows[i]["nrg_code"] + "'";
+                else
+                    nrg_code += "'" + dt.Rows[i]["nrg_code"] + "',";
+            }
+            sql.Clear();
+            sql.Append("select nr_code,nr_name,nr_group from QUA_NGReason where ");
+            sql.Append("nr_group in(" + (nrg_code == "" ? "''" : nrg_code) + ")");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            //未查询到查询全部数据
+            if (dt.Rows.Count == 0)
+                dt = (DataTable)dh.ExecuteSql("select nr_code,nr_name,nr_group from QUA_NGReason", "select");
+            AddDataToListView(nr_name_lsv, dt);
+            //加载责任别
+            dt = (DataTable)dh.ExecuteSql("select nd_code,nd_name from ngduty", "select");
+            AddDataToListView(mbr_dutycode_lsv, dt);
+            //加载解决方案
+            sql.Clear();
+            sql.Append("select so_code,so_name from PRODUCTSOLUTION left join solution on ");
+            sql.Append("so_code=ps_socode where ps_kindcode='" + pk_code + "'");
+            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count == 0)
+                dt = (DataTable)dh.ExecuteSql("select so_code,so_name from solution", "select");
+            AddDataToListView(mbr_solutioncode_lsv, dt);
         }
 
         /// <summary>
@@ -81,5 +133,95 @@ namespace UAS_MES.Make
                 }
             }
         }
+
+        private int GetListViewCheckCount(ListView lsv)
+        {
+            int CheckedNum = 0;
+            //已存在在ListView中的Item是不能添加到其他ListView中的,需要调用其克隆的方法
+            for (int i = lsv.Items.Count - 1; i >= 0; i--)
+            {
+                if (lsv.Items[i].Checked)
+                    CheckedNum++;
+            }
+            return CheckedNum;
+        }
+
+        private string GetListViewCheckItemText(ListView lsv)
+        {
+            string Text = "";
+            //已存在在ListView中的Item是不能添加到其他ListView中的,需要调用其克隆的方法
+            for (int i = lsv.Items.Count - 1; i >= 0; i--)
+            {
+                if (lsv.Items[i].Checked)
+                    Text = lsv.Items[i].SubItems[1].Text;
+            }
+            return Text;
+        }
+
+        private void Save_Click(object sender, EventArgs e)
+        {
+            string[] mbc_component = new string[GetListViewCheckCount(mbc_component_lsv)];
+            string[] nrg_name = new string[GetListViewCheckCount(nrg_name_lsv)];
+            string[] nr_name = new string[GetListViewCheckCount(nr_name_lsv)];
+            string[] mbr_dutycode = new string[GetListViewCheckCount(mbr_dutycode_lsv)];
+            string[] mbr_solutioncode = new string[GetListViewCheckCount(mbr_solutioncode_lsv)];
+            string ErrorMessage = "";
+            if (nrg_name.Length == 0)
+                ErrorMessage += " 不良原因组 ";
+            if (nr_name.Length == 0)
+                ErrorMessage += " 不良原因 ";
+            if (mbr_dutycode.Length == 0)
+                ErrorMessage += " 责任别 ";
+            if (mbr_solutioncode.Length == 0)
+                ErrorMessage += " 解决方案 ";
+            if (ErrorMessage == "")
+            {
+                ErrorMessage = "";
+                string mbccomponent = GetListViewCheckItemText(mbc_component_lsv);
+                string nrgname = GetListViewCheckItemText(nrg_name_lsv);
+                string nrname = GetListViewCheckItemText(nr_name_lsv);
+                string mbrdutycode = GetListViewCheckItemText(mbr_dutycode_lsv);
+                string mbrsolutioncode = GetListViewCheckItemText(mbr_solutioncode_lsv);
+                dt = (DataTable)dh.ExecuteSql("select ms_makecode from makeserial where ms_id='" + msid + "' and ms_sncode='" + sncode + "' and ms_status=3", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    string macode = dt.Rows[0]["ms_makecode"].ToString();
+                    if (!dh.CheckExist("makebadreason", "mbr_sncode='" + sncode + "' and mbr_badcode='" + bccode + "' "))
+                    {
+                        string mbr_id = dh.GetSEQ("makebadreason_seq");
+                        sql.Clear();
+                        sql.Append("insert into makebadreason (mbr_mbid,mbr_id,mbr_brcode,mbr_solutioncode,");
+                        sql.Append("mbr_dutycode,mbr_brgcode,mbr_badcode,mbr_sncode,mbr_makecode,mbr_indate,");
+                        sql.Append("mbr_inman) select '" + mbid + "'," + mbr_id + ",'" + nrgname + "',");
+                        sql.Append("'" + mbrsolutioncode + "','" + mbrdutycode + "','" + nrgname + "','" + bccode
+                            + "',");
+                        sql.Append("'" + sncode + "','" + macode + "',sysdate,'" + User.UserCode + "' from dual");
+                        dh.ExecuteSql(sql.GetString(), "insert");
+                    }
+                    else ErrorMessage = "序列号" + sncode + "已存在不良代码" + bccode + "\n";
+                    if (mbccomponent != "" || mbccomponent != null)
+                    {
+                        if (!dh.CheckExist("makebadrscom", "mbc_sncode='" + sncode + "' and mbc_component='" + mbccomponent + "'"))
+                        {
+                            sql.Clear();
+                            sql.Append("insert into makebadrscom (mbc_id,mbc_mbrid,mbc_component,mbc_badcode,");
+                            sql.Append("mbc_brcode,mbc_sncode,mbc_makecode,mbc_indate,mbc_inman ) values ");
+                            sql.Append("(makebadrscom_seq.nextval,'" + mbid + "' ,'" + mbccomponent + "',");
+                            sql.Append("'" + bccode + "','" + nrname + "','" + sncode + "','" + macode + "',sysdate,'" + User.UserCode + "')");
+                            dh.ExecuteSql(sql.GetString(), "insert");
+                        }
+                        else ErrorMessage += "序列号" + sncode + "已存在不良组件" + mbccomponent;
+                    }
+                    if (ErrorMessage != "")
+                        MessageBox.Show(ErrorMessage);
+                    else
+                        Close();
+                }
+                else
+                    MessageBox.Show("序列号错误,不存在或者不处于维修状态");
+            }
+            else
+                MessageBox.Show(ErrorMessage + "未勾选");
+        }
     }
 }

+ 55 - 45
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -55,6 +55,8 @@
             this.BadCodeTree = new System.Windows.Forms.TreeView();
             this.LocationSource = new System.Windows.Forms.BindingSource(this.components);
             this.ComponentSource = new System.Windows.Forms.BindingSource(this.components);
+            this.bc_code = new System.Windows.Forms.Label();
+            this.bg_code = new System.Windows.Forms.Label();
             this.mbp_partdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
             this.mbp_part1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbl_locdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
@@ -64,8 +66,6 @@
             this.NewRepairInf = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.SaveRepairInf = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.DeleteRepairInf = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.ChooseBadPart = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
-            this.mbp_part = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.mbl_loc = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.mbr_solutioncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.mbc_component = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
@@ -87,6 +87,7 @@
             this.SaveBadLocation = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Scrap = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.RepairComplete = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
@@ -103,7 +104,7 @@
             this.panel2.Location = new System.Drawing.Point(0, 0);
             this.panel2.Margin = new System.Windows.Forms.Padding(4);
             this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(1353, 36);
+            this.panel2.Size = new System.Drawing.Size(1327, 36);
             this.panel2.TabIndex = 32;
             // 
             // label1
@@ -364,6 +365,30 @@
             this.BadCodeTree.TabIndex = 118;
             this.BadCodeTree.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.BadCodeTree_NodeMouseClick);
             // 
+            // bc_code
+            // 
+            this.bc_code.AutoSize = true;
+            this.bc_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bc_code.ForeColor = System.Drawing.Color.Black;
+            this.bc_code.Location = new System.Drawing.Point(1264, 93);
+            this.bc_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.bc_code.Name = "bc_code";
+            this.bc_code.Size = new System.Drawing.Size(0, 27);
+            this.bc_code.TabIndex = 122;
+            this.bc_code.Visible = false;
+            // 
+            // bg_code
+            // 
+            this.bg_code.AutoSize = true;
+            this.bg_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.bg_code.ForeColor = System.Drawing.Color.Black;
+            this.bg_code.Location = new System.Drawing.Point(1264, 51);
+            this.bg_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.bg_code.Name = "bg_code";
+            this.bg_code.Size = new System.Drawing.Size(0, 27);
+            this.bg_code.TabIndex = 123;
+            this.bg_code.Visible = false;
+            // 
             // mbp_partdgv
             // 
             this.mbp_partdgv.AllowUserToAddRows = false;
@@ -494,43 +519,6 @@
             this.DeleteRepairInf.UseVisualStyleBackColor = true;
             this.DeleteRepairInf.Click += new System.EventHandler(this.DeleteRepairInf_Click);
             // 
-            // ChooseBadPart
-            // 
-            this.ChooseBadPart.AllPower = "ifall";
-            this.ChooseBadPart.BackColor = System.Drawing.Color.Transparent;
-            this.ChooseBadPart.DownImage = ((System.Drawing.Image)(resources.GetObject("ChooseBadPart.DownImage")));
-            this.ChooseBadPart.Image = ((System.Drawing.Image)(resources.GetObject("ChooseBadPart.Image")));
-            this.ChooseBadPart.IsShowBorder = true;
-            this.ChooseBadPart.Location = new System.Drawing.Point(946, 372);
-            this.ChooseBadPart.Margin = new System.Windows.Forms.Padding(4);
-            this.ChooseBadPart.MoveImage = ((System.Drawing.Image)(resources.GetObject("ChooseBadPart.MoveImage")));
-            this.ChooseBadPart.Name = "ChooseBadPart";
-            this.ChooseBadPart.NormalImage = ((System.Drawing.Image)(resources.GetObject("ChooseBadPart.NormalImage")));
-            this.ChooseBadPart.Power = null;
-            this.ChooseBadPart.Size = new System.Drawing.Size(61, 30);
-            this.ChooseBadPart.TabIndex = 107;
-            this.ChooseBadPart.Tag = "IfWrite";
-            this.ChooseBadPart.Text = "选择";
-            this.ChooseBadPart.UseVisualStyleBackColor = true;
-            // 
-            // mbp_part
-            // 
-            this.mbp_part.AllPower = null;
-            this.mbp_part.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left)));
-            this.mbp_part.BackColor = System.Drawing.Color.White;
-            this.mbp_part.ID = null;
-            this.mbp_part.Location = new System.Drawing.Point(747, 374);
-            this.mbp_part.Margin = new System.Windows.Forms.Padding(4);
-            this.mbp_part.Name = "mbp_part";
-            this.mbp_part.Power = null;
-            this.mbp_part.Size = new System.Drawing.Size(187, 25);
-            this.mbp_part.Str = null;
-            this.mbp_part.Str1 = null;
-            this.mbp_part.Str2 = null;
-            this.mbp_part.TabIndex = 106;
-            this.mbp_part.Tag = "Read";
-            // 
             // mbl_loc
             // 
             this.mbl_loc.AllPower = null;
@@ -548,6 +536,8 @@
             this.mbl_loc.Str2 = null;
             this.mbl_loc.TabIndex = 104;
             this.mbl_loc.Tag = "Read";
+            this.mbl_loc.TextChanged += new System.EventHandler(this.mbl_loc_TextChanged);
+            this.mbl_loc.KeyDown += new System.Windows.Forms.KeyEventHandler(this.mbl_loc_KeyDown);
             // 
             // mbr_solutioncode
             // 
@@ -849,6 +839,7 @@
             this.SaveBadLocation.Tag = "IfWrite";
             this.SaveBadLocation.Text = "保存";
             this.SaveBadLocation.UseVisualStyleBackColor = true;
+            this.SaveBadLocation.Click += new System.EventHandler(this.SaveBadLocation_Click);
             // 
             // Scrap
             // 
@@ -892,11 +883,31 @@
             this.RepairComplete.UseVisualStyleBackColor = true;
             this.RepairComplete.Click += new System.EventHandler(this.RepairComplete_Click);
             // 
+            // prodcode
+            // 
+            this.prodcode.AllPower = null;
+            this.prodcode.Caller = null;
+            this.prodcode.Condition = null;
+            this.prodcode.DBTitle = null;
+            this.prodcode.FormName = null;
+            this.prodcode.Location = new System.Drawing.Point(747, 374);
+            this.prodcode.Name = "prodcode";
+            this.prodcode.Power = null;
+            this.prodcode.SelectField = null;
+            this.prodcode.SetValueField = null;
+            this.prodcode.Size = new System.Drawing.Size(209, 25);
+            this.prodcode.TabIndex = 124;
+            this.prodcode.TableName = null;
+            this.prodcode.TextBoxEnable = false;
+            // 
             // Make_Repair
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1353, 735);
+            this.ClientSize = new System.Drawing.Size(1327, 735);
+            this.Controls.Add(this.prodcode);
+            this.Controls.Add(this.bg_code);
+            this.Controls.Add(this.bc_code);
             this.Controls.Add(this.mbp_partdgv);
             this.Controls.Add(this.mbl_locdgv);
             this.Controls.Add(this.RefreshTreeView);
@@ -909,8 +920,6 @@
             this.Controls.Add(this.SaveRepairInf);
             this.Controls.Add(this.DeleteRepairInf);
             this.Controls.Add(this.panel1);
-            this.Controls.Add(this.ChooseBadPart);
-            this.Controls.Add(this.mbp_part);
             this.Controls.Add(this.mbp_part_label);
             this.Controls.Add(this.mbl_loc);
             this.Controls.Add(this.mbl_loc_label);
@@ -1006,9 +1015,7 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox mbr_solutioncode;
         private System.Windows.Forms.Label mbr_solution_label;
         private System.Windows.Forms.Label mbl_loc_label;
-        private CustomControl.TextBoxWithIcon.EnterTextBox mbp_part;
         private System.Windows.Forms.Label mbp_part_label;
-        private CustomControl.ButtonUtil.NormalButton ChooseBadPart;
         private System.Windows.Forms.Panel panel1;
         private CustomControl.ButtonUtil.NormalButton DeleteRepairInf;
         private CustomControl.ButtonUtil.NormalButton SaveRepairInf;
@@ -1026,5 +1033,8 @@
         private System.Windows.Forms.BindingSource ComponentSource;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbp_part1;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_loc1;
+        private System.Windows.Forms.Label bc_code;
+        private System.Windows.Forms.Label bg_code;
+        private CustomControl.TextBoxWithIcon.SearchTextBox prodcode;
     }
 }

+ 63 - 8
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -29,6 +29,8 @@ namespace UAS_MES.Make
         string insert_makeprocess = "insert into makeprocess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode) select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,mcd_stepcode,mcd_stepname,ma_craftcode,'','维修作业','#',sysdate,'" + User.UserName + "',ma_wccode,ma_linecode,'' from make left join makecraftdetail on mcd_macode=ma_code left join makeserial on ms_makecode=ma_code where ms_sncode=:ms_sncode and ma_code=:ma_code";
         //是否获取过下拉框数据
         bool GetSelectData = false;
+
+        string mb_id = "";
         /// <summary>
         /// 存放父节点信息
         /// </summary>
@@ -48,11 +50,22 @@ namespace UAS_MES.Make
 
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
-        string macode;
+        string macode;   
+
+        string msid = "";
+
+        string dbtable1 = "(select distinct nvl(dsl_prodcode,msl_prodcode)prodcode from ReduceStepRecord left join devsmtlocation on dsl_linecode=rsd_linecode and dsl_makecode=rsd_macode left join makesmtlocation on msl_linecode=rsd_linecode and msl_makecode=rsd_macode where rsd_macode=':macode'  and rsd_sncode=':sncode') left join product on pr_code=prodcode";
+
+        string dbtable2 = "(select distinct nvl(dsl_prodcode,msl_prodcode)prodcode from ReduceStepRecord left join devsmtlocation on dsl_linecode=rsd_linecode and dsl_makecode=rsd_macode left join makesmtlocation on msl_linecode=rsd_linecode and msl_makecode=rsd_macode where rsd_macode=':macode'  and rsd_sncode=':sncode' and ((dsl_location=':msl_location' and dsl_validtime<sysdate and sysdate<dsl_invalidtime) ) or (msl_location=':msl_location' and msl_validtime<sysdate and sysdate<msl_invalidtime)) left join product on pr_code=prodcode";
 
         public Make_Repair()
         {
             InitializeComponent();
+        }
+
+        private void 维修作业_Load(object sender, EventArgs e)
+        {
+            dh = new DataHelper();
             //为DBFind配置Call和Form的名称
             cr_code.FormName = Name;
             cr_code.TableName = "craft";
@@ -64,11 +77,12 @@ namespace UAS_MES.Make
             cd_stepcode.SetValueField = new string[] { "cd_stepcode" };
             cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
             cd_stepcode.Condition = "ST_STATUSCODE='AUDITED' and cr_code='" + cr_code.Text + "'";
-        }
 
-        private void 维修作业_Load(object sender, EventArgs e)
-        {
-            dh = new DataHelper();
+            prodcode.FormName = Name;
+            prodcode.TableName = dbtable1.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text);
+            prodcode.SetValueField = new string[] { "prodcode" };
+            prodcode.SelectField = "prodcode # 不良零件编号,pr_detail # 零件名称";
+
             asc.controllInitializeSize(this);
             GetSNCode.Focus();
         }
@@ -91,12 +105,15 @@ namespace UAS_MES.Make
                     {
                         //验证makeserial或者ms_firstsn表序列号是否存在
                         sql.Clear();
-                        sql.Append("select max(ms_id) from makeserial where ms_makecode ='" + macode + "' and(ms_sncode");
+                        sql.Append("select max(ms_id) ms_id from makeserial where ms_makecode ='" + macode + "' and(ms_sncode");
                         sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation ");
                         sql.Append("where sn='" + GetSNCode.Text + "'))");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
+                        {
+                            msid = dt.Rows[0]["ms_id"].ToString();
                             LoadBadInfTree(sender, e);
+                        }
                         else
                             OperatResult.AppendText(">>序列号" + GetSNCode.Text + "不存在\n", Color.Red);
                     }
@@ -117,9 +134,11 @@ namespace UAS_MES.Make
         {
             if (e.Node.Level == 0)
             {
-                string mb_id = e.Node.Tag.ToString();
+                mb_id = e.Node.Tag.ToString();
                 bc_name.Text = BadInf_1[mb_id]["bc_name"];
+                bc_code.Text = BadInf_1[mb_id]["mb_badcode"];
                 bg_name.Text = BadInf_1[mb_id]["bg_name"];
+                bg_code.Text = BadInf_1[mb_id]["mb_bgcode"];
                 mb_badremark.Text = BadInf_1[mb_id]["mb_badremark"];
             }
             if (e.Node.Level == 1)
@@ -151,6 +170,7 @@ namespace UAS_MES.Make
                 //添加根节点
                 TreeNode tnode_0 = new TreeNode();
                 tnode_0.Text = dt.Rows[i]["mb_bgcode"].ToString();
+                tnode_0.Name = dt.Rows[i]["mb_bgcode"].ToString();
                 //作为Dictionary的主标识
                 string mb_id = dt.Rows[i]["mb_id"].ToString();
                 tnode_0.Tag = mb_id;
@@ -194,6 +214,10 @@ namespace UAS_MES.Make
                     tnode_0.Nodes.Add(tnode_1);
                 }
             }
+            if (bg_code.Text != "")
+            {
+                BadCodeTree.Nodes[bg_code.Text].Expand();
+            }
         }
 
         private void RefreshTreeView_Click(object sender, EventArgs e)
@@ -221,7 +245,8 @@ namespace UAS_MES.Make
 
         private void NewRepairInf_Click(object sender, EventArgs e)
         {
-            Make_NewMatainInf mataininf = new Make_NewMatainInf(bg_name.Text,bc_name.Text,GetSNCode.Text);
+            Make_NewMatainInf mataininf = new Make_NewMatainInf(bg_name.Text, bg_code.Text, bc_name.Text, bc_code.Text, GetSNCode.Text, msid, mb_id);
+            mataininf.FormClosed += LoadBadInfTree;
             BaseUtil.SetFormCenter(mataininf);
             mataininf.ShowDialog();
         }
@@ -235,5 +260,35 @@ namespace UAS_MES.Make
         {
 
         }
+
+        private void mbl_loc_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                sql.Clear();
+                sql.Append("select prodcode,pr_detail from (select distinct nvl(dsl_prodcode,msl_prodcode)");
+                sql.Append("prodcode from ReduceStepRecord left join devsmtlocation on dsl_linecode=rsd_linecode ");
+                sql.Append("and dsl_makecode=rsd_macode left join makesmtlocation on msl_linecode=rsd_linecode  ");
+                sql.Append("and msl_makecode=rsd_macode where rsd_macode='" + macode + "'  and rsd_sncode='" + GetSNCode.Text + "'");
+                sql.Append("and ((dsl_location='" + mbl_loc.Text + "' and dsl_validtime<sysdate and sysdate<dsl_invalidtime) ) or ");
+                sql.Append("(msl_location='" + mbl_loc.Text + "' and msl_validtime<sysdate and sysdate<msl_invalidtime)) left join ");
+                sql.Append("product on pr_code=prodcode");
+                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            }
+        }
+
+        private void SaveBadLocation_Click(object sender, EventArgs e)
+        {
+
+        }
+
+        private void mbl_loc_TextChanged(object sender, EventArgs e)
+        {
+            if (mbl_loc.Text != "")
+            {
+                Console.WriteLine("TextChange");
+                prodcode.TableName = dbtable2.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text).Replace(":msl_location", mbl_loc.Text);
+            }
+        }
     }
 }

+ 0 - 131
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -521,137 +521,6 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
-</value>
-  </data>
-  <data name="ChooseBadPart.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
-        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
-        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
-        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
-        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
-        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
-        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
-</value>
-  </data>
-  <data name="ChooseBadPart.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAABGdBTUEAALGOfPtRkwAAACBjSFJNAACH
-        DwAAjA8AAP1SAACBQAAAfXkAAOmLAAA85QAAGcxzPIV3AAAKOWlDQ1BQaG90b3Nob3AgSUNDIHByb2Zp
-        bGUAAEjHnZZ3VFTXFofPvXd6oc0w0hl6ky4wgPQuIB0EURhmBhjKAMMMTWyIqEBEEREBRZCggAGjoUis
-        iGIhKKhgD0gQUGIwiqioZEbWSnx5ee/l5ffHvd/aZ+9z99l7n7UuACRPHy4vBZYCIJkn4Ad6ONNXhUfQ
-        sf0ABniAAaYAMFnpqb5B7sFAJC83F3q6yAn8i94MAUj8vmXo6U+ng/9P0qxUvgAAyF/E5mxOOkvE+SJO
-        yhSkiu0zIqbGJIoZRomZL0pQxHJijlvkpZ99FtlRzOxkHlvE4pxT2clsMfeIeHuGkCNixEfEBRlcTqaI
-        b4tYM0mYzBXxW3FsMoeZDgCKJLYLOKx4EZuImMQPDnQR8XIAcKS4LzjmCxZwsgTiQ7mkpGbzuXHxArou
-        S49uam3NoHtyMpM4AoGhP5OVyOSz6S4pyalMXjYAi2f+LBlxbemiIluaWltaGpoZmX5RqP+6+Dcl7u0i
-        vQr43DOI1veH7a/8UuoAYMyKarPrD1vMfgA6tgIgd/8Pm+YhACRFfWu/8cV5aOJ5iRcIUm2MjTMzM424
-        HJaRuKC/6386/A198T0j8Xa/l4fuyollCpMEdHHdWClJKUI+PT2VyeLQDf88xP848K/zWBrIieXwOTxR
-        RKhoyri8OFG7eWyugJvCo3N5/6mJ/zDsT1qca5Eo9Z8ANcoISN2gAuTnPoCiEAESeVDc9d/75oMPBeKb
-        F6Y6sTj3nwX9+65wifiRzo37HOcSGExnCfkZi2viawnQgAAkARXIAxWgAXSBITADVsAWOAI3sAL4gWAQ
-        DtYCFogHyYAPMkEu2AwKQBHYBfaCSlAD6kEjaAEnQAc4DS6Ay+A6uAnugAdgBIyD52AGvAHzEARhITJE
-        geQhVUgLMoDMIAZkD7lBPlAgFA5FQ3EQDxJCudAWqAgqhSqhWqgR+hY6BV2ArkID0D1oFJqCfoXewwhM
-        gqmwMqwNG8MM2An2hoPhNXAcnAbnwPnwTrgCroOPwe3wBfg6fAcegZ/DswhAiAgNUUMMEQbigvghEUgs
-        wkc2IIVIOVKHtCBdSC9yCxlBppF3KAyKgqKjDFG2KE9UCIqFSkNtQBWjKlFHUe2oHtQt1ChqBvUJTUYr
-        oQ3QNmgv9Cp0HDoTXYAuRzeg29CX0HfQ4+g3GAyGhtHBWGE8MeGYBMw6TDHmAKYVcx4zgBnDzGKxWHms
-        AdYO64dlYgXYAux+7DHsOewgdhz7FkfEqeLMcO64CBwPl4crxzXhzuIGcRO4ebwUXgtvg/fDs/HZ+BJ8
-        Pb4LfwM/jp8nSBN0CHaEYEICYTOhgtBCuER4SHhFJBLVidbEACKXuIlYQTxOvEIcJb4jyZD0SS6kSJKQ
-        tJN0hHSedI/0ikwma5MdyRFkAXknuZF8kfyY/FaCImEk4SXBltgoUSXRLjEo8UISL6kl6SS5VjJHslzy
-        pOQNyWkpvJS2lIsUU2qDVJXUKalhqVlpirSptJ90snSxdJP0VelJGayMtoybDFsmX+awzEWZMQpC0aC4
-        UFiULZR6yiXKOBVD1aF6UROoRdRvqP3UGVkZ2WWyobJZslWyZ2RHaAhNm+ZFS6KV0E7QhmjvlygvcVrC
-        WbJjScuSwSVzcopyjnIcuUK5Vrk7cu/l6fJu8onyu+U75B8poBT0FQIUMhUOKlxSmFakKtoqshQLFU8o
-        3leClfSVApXWKR1W6lOaVVZR9lBOVd6vfFF5WoWm4qiSoFKmclZlSpWiaq/KVS1TPaf6jC5Ld6In0Svo
-        PfQZNSU1TzWhWq1av9q8uo56iHqeeqv6Iw2CBkMjVqNMo1tjRlNV01czV7NZ874WXouhFa+1T6tXa05b
-        RztMe5t2h/akjpyOl06OTrPOQ12yroNumm6d7m09jB5DL1HvgN5NfVjfQj9ev0r/hgFsYGnANThgMLAU
-        vdR6KW9p3dJhQ5Khk2GGYbPhqBHNyMcoz6jD6IWxpnGE8W7jXuNPJhYmSSb1Jg9MZUxXmOaZdpn+aqZv
-        xjKrMrttTjZ3N99o3mn+cpnBMs6yg8vuWlAsfC22WXRbfLS0suRbtlhOWWlaRVtVWw0zqAx/RjHjijXa
-        2tl6o/Vp63c2ljYCmxM2v9ga2ibaNtlOLtdZzllev3zMTt2OaVdrN2JPt4+2P2Q/4qDmwHSoc3jiqOHI
-        dmxwnHDSc0pwOub0wtnEme/c5jznYuOy3uW8K+Lq4Vro2u8m4xbiVun22F3dPc692X3Gw8Jjncd5T7Sn
-        t+duz2EvZS+WV6PXzAqrFetX9HiTvIO8K72f+Oj78H26fGHfFb57fB+u1FrJW9nhB/y8/Pb4PfLX8U/z
-        /z4AE+AfUBXwNNA0MDewN4gSFBXUFPQm2Dm4JPhBiG6IMKQ7VDI0MrQxdC7MNaw0bGSV8ar1q66HK4Rz
-        wzsjsBGhEQ0Rs6vdVu9dPR5pEVkQObRGZ03WmqtrFdYmrT0TJRnFjDoZjY4Oi26K/sD0Y9YxZ2O8Yqpj
-        ZlgurH2s52xHdhl7imPHKeVMxNrFlsZOxtnF7YmbineIL4+f5rpwK7kvEzwTahLmEv0SjyQuJIUltSbj
-        kqOTT/FkeIm8nhSVlKyUgVSD1ILUkTSbtL1pM3xvfkM6lL4mvVNAFf1M9Ql1hVuFoxn2GVUZbzNDM09m
-        SWfxsvqy9bN3ZE/kuOd8vQ61jrWuO1ctd3Pu6Hqn9bUboA0xG7o3amzM3zi+yWPT0c2EzYmbf8gzySvN
-        e70lbEtXvnL+pvyxrR5bmwskCvgFw9tst9VsR23nbu/fYb5j/45PhezCa0UmReVFH4pZxde+Mv2q4quF
-        nbE7+0ssSw7uwuzi7Rra7bD7aKl0aU7p2B7fPe1l9LLCstd7o/ZeLV9WXrOPsE+4b6TCp6Jzv+b+Xfs/
-        VMZX3qlyrmqtVqreUT13gH1g8KDjwZYa5ZqimveHuIfu1nrUttdp15UfxhzOOPy0PrS+92vG140NCg1F
-        DR+P8I6MHA082tNo1djYpNRU0gw3C5unjkUeu/mN6zedLYYtta201qLj4Ljw+LNvo78dOuF9ovsk42TL
-        d1rfVbdR2grbofbs9pmO+I6RzvDOgVMrTnV32Xa1fW/0/ZHTaqerzsieKTlLOJt/duFczrnZ86nnpy/E
-        XRjrjup+cHHVxds9AT39l7wvXbnsfvlir1PvuSt2V05ftbl66hrjWsd1y+vtfRZ9bT9Y/NDWb9nffsPq
-        RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
-        lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
-        f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALEwAACxMBAJqcGAAACfBJREFUeF7t3dtuFFcC
-        heFc5VWQRsrL5T0iRcrDkJAjJOADNjbdbvD5iE9tu302RIq0Z6+ynWkmS6oZrlys/+KT8FJX3f2bcmPa
-        X5RSAISyI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCD
-        HQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0B
-        ZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSw
-        I4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOA
-        DHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2
-        BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEf5/vsnj6pvqpnqr6oAePDU
-        qppVu49c2+PsWC/8urpZXV0rR8fH5f2HD+XDGH0N4GH47zbVrNpVw2rZNX7voy/qi7+sHvd6C2U0Oi03
-        7z+Um5v35RpAZ6hZtauG1bKaVtvjrd/76Iv6om/7/UG9+PZGV9c3d67L5RWAh06t3nfbHAa1ZTVd2/5m
-        vPV7f/+hvuCr6q8r3UQ3u7wqF9X5xSWAjlG7avi+ZbVd/Ws8fhk/AL5dXl75O/qz84tyenZ+56yMTgE8
-        dGr1vls1fH8YLNW2a+P/eAoYPwAWD4ZH5fT8sozqxSf1Zsejs3J0cgqgY9SuGlbLavrgcKgDYDAev4wf
-        AH+OTmv4o/NyrJscjcqwOhyeAOgYtauG1fJ907Xxs/H4ZfwAqC+sf+Mfn9aLT+qJcVwdlf0DAF2jdtWw
-        WlbTaluN3/d+76MDQC88PDxpbrC7N6wOy7tdAF2jdtWwWlbTarv1ANCJsbc/bG6ws7Nftrb3AHSUGlbL
-        avqwtt16AOzV02Jn96Bs1Qs3t3fLxua7sg6gc9SuGlbLalpttx4AOi10wcbmblnb2Cmr69tlZQ1A16hd
-        NayW1bTabj0AtncObuNf3ykrq1tleWWzLC0D6Bq1q4bVsppW260HwObWbfy6eHFpo7xdXC9v3q4B6Bi1
-        q4bVsppW260HwPr6u3rBVr14owzerJWFwWrpL6wA6Bi1q4bVsppW260HwMrqdnNq6MJef6W87i2X+ddL
-        ADpG7aphtaym1XbrAbBUHxcG9fGht7Bc5l4vllfzb8vs3BsAHaN21bBaVtNqu/UA0PcNenzQhTOv3pSX
-        s4MyPbMAoGPUrhpWy2pabbceAHpceN1bKrOKv95karpfJqd6ADpG7aphtaym1XbrAdAf1L/95xfrhYMy
-        Od0rLyZfl+cT8wA6Ru2qYbWsptV26wHQ6y833z9MvezXG8yXP17Mld+fvwLQMWpXDatlNa22Ww8AvXuo
-        E2Nislf+eD5Xnv3+qjx9NgugY9SuGlbLalpttx4Ac3OLZXp6oTx/MV9vMFt+ezpTfv3tJYCOUbtqWC2r
-        abXdegDMzr2t3zf06yPEXPnt2Uz5pd7o51+nAXSM2lXDallNq+3WA2BmdtC8eaCTQzf46Zep8uPPkwA6
-        Ru2qYbWsptV26wGg7xX0DuLT32eaU0Q3evLTBICOUbtqWC2rabXdegDoBwiev7h9/NcJohv98OMLAB2j
-        dtWwWlbTarv1AJh6udC8c/jr05l6gkzVG02U75+8ANAxalcNq2U1rbbbD4C7NwD1vcOTnyabGz3+4TmA
-        jlG7algtq2m1zQEAhOAAAIJ92gHAewDAZ+GT3gPgXwGAz8Mn/SsAPwcAfB4+6ecA+ElA4POgdtXw//WT
-        gPxfAODzoHbVsFr+n/8vgD44YPrlQn1kqE8Bf7yqN5ht3kQA0C1qVw2rZTWttlsPgPneUvNZYhNTveYD
-        BXSDp/URAkC3qF01rJbVtNpuPQB6CyvlVX1U0DuGE1O3HwemmwDoFrWrhtWymlbbrQfAYLDafHLIzOyb
-        +thw+4GgE5OvAXSM2lXDallNq+3WA+DN4vrtU0D9fqE5BGYGzQ8QAOgWtauG1bKaVtutB8Di8mZZ0EeD
-        95ebC/XOoT5bHEC3qF01rJbVtNpuPQD020TfLq3XC1abC/XGgX6xAIBuUbu38a82Tavt1gNgbf1dWVrZ
-        qo8LG82p0a/fN+jxAUC3qF01rJbVtNpuPQD49eDA5+GTfj349s5B2di8PQT020R18VL93gFAt6hdNayW
-        1bTabj0AdncP6wv3y2a9YH1jp168XVbXAHSN2lXDallN7+4dth8A+wfHd4fAQdna3quPDXvN6QGgW9Su
-        GlbLalpttx4Aw+FJfeFRPS2G5d3uQdl5d9CcHgC6Re2qYbWsptV22wHw59HxqAyPTsrB4XFz0d7+sHl0
-        ANAtalcNq2U1LbXxy/H4ZfwAWNk/GJaT0Vk5Oj6tF4zKYT01dAMA3aJ21bBaVtN7+817AIPx+GX8APhu
-        aXmlnJ1flNHZeXPR8clpOboz1NMBgAftvle1q4bVsppeXGr+M9C34/HL+AHwVfXXxcVVOa/Ozi/L6dlF
-        dV5GpwC6Qs2qXTWsltW02lbj4/HLR1/UF3zX7w/K1fVNuby6LheXt4fBLd3sjm4M4GEYb/OuV7WrhtWy
-        mq5t/+Nvf/noi/qiL6vHvV6/PkKMynW9WDe4uq43qjfTDQE8TGq0abU2q3bVsFpW02p7vPV7/xikvvjr
-        6mZlZbUcHR2Xm/cfxrwH8OD8p1E1q3bVsFp2jd+zo9QLH1XfVHOVbgagG9Ss2n3k2h5nRwAZ7Agggx0B
-        ZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSw
-        I4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOA
-        DHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2
-        BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGOADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQ
-        wY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy2BFABjsCyGBHABnsCCCDHQFksCOADHYEkMGO
-        ADLYEUAGOwLIYEcAGewIIIMdAWSwI4AMdgSQwY4AMtgRQAY7AshgRwAZ7Agggx0BZLAjgAx2BJDBjgAy
-        2BFABjsCSFC++DdnYZod1cA/NQAAAABJRU5ErkJggg==
-</value>
-  </data>
-  <data name="ChooseBadPart.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
-        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
-        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
-        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
-        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
-        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
-        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
-        gg==
-</value>
-  </data>
-  <data name="ChooseBadPart.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
-        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
-        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
-        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
-        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
-        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
-        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
-        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
-        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -104,7 +104,7 @@
             // 
             this.bc_remark_label.AutoSize = true;
             this.bc_remark_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.bc_remark_label.Location = new System.Drawing.Point(447, 206);
+            this.bc_remark_label.Location = new System.Drawing.Point(447, 203);
             this.bc_remark_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.bc_remark_label.Name = "bc_remark_label";
             this.bc_remark_label.Size = new System.Drawing.Size(92, 27);
@@ -378,7 +378,7 @@
             this.bc_code.BackColor = System.Drawing.Color.White;
             this.bc_code.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_code.ID = null;
-            this.bc_code.Location = new System.Drawing.Point(159, 253);
+            this.bc_code.Location = new System.Drawing.Point(148, 253);
             this.bc_code.Margin = new System.Windows.Forms.Padding(4);
             this.bc_code.Name = "bc_code";
             this.bc_code.Power = null;
@@ -386,7 +386,7 @@
             this.bc_code.Str = null;
             this.bc_code.Str1 = null;
             this.bc_code.Str2 = null;
-            this.bc_code.TabIndex = 68;
+            this.bc_code.TabIndex = 70;
             this.bc_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.bc_code_KeyDown);
             // 
             // ma_code
@@ -542,7 +542,7 @@
             // 
             this.bc_groupcode.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.bc_groupcode.FormattingEnabled = true;
-            this.bc_groupcode.Location = new System.Drawing.Point(159, 207);
+            this.bc_groupcode.Location = new System.Drawing.Point(148, 204);
             this.bc_groupcode.Margin = new System.Windows.Forms.Padding(4);
             this.bc_groupcode.Name = "bc_groupcode";
             this.bc_groupcode.Size = new System.Drawing.Size(251, 26);

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -199,7 +199,7 @@ namespace UAS_MES.Make
             if (dt.Rows.Count == 0)
             {
                 sql.Clear();
-                sql.Append("select bg_code from badgroup");
+                sql.Append("select bg_code||':'||bg_name bg_code from badgroup");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 bc_groupcode.DataSource = dt;
                 bc_groupcode.DisplayMember = "bg_code";
@@ -220,7 +220,7 @@ namespace UAS_MES.Make
         private void LoadBadCodeListView()
         {
             sql.Clear();
-            sql.Append("select bg_code,bc_name,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + bc_groupcode.Text + "' and bg_code is not null");
+            sql.Append("select bg_code||':'||bg_name bg_code,bc_name,bc_note from badcode left join badgroup on bc_groupcode=bg_code where bc_groupcode='" + bc_groupcode.Text + "' and bg_code is not null");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             //往listview中添加数据
             WaitRejectList.Items.Clear();

+ 69 - 0
UAS-MES/Properties/app.manifest

@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <!-- UAC 清单选项
+             如果想要更改 Windows 用户帐户控制级别,请使用
+             以下节点之一替换 requestedExecutionLevel 节点。n
+        <requestedExecutionLevel  level="asInvoker" uiAccess="false" />
+        <requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />
+        <requestedExecutionLevel  level="highestAvailable" uiAccess="false" />
+
+            指定 requestedExecutionLevel 元素将禁用文件和注册表虚拟化。
+            如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
+            元素。
+        -->
+        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+      </requestedPrivileges>
+      <applicationRequestMinimum>
+        <defaultAssemblyRequest permissionSetReference="Custom" />
+        <PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
+      </applicationRequestMinimum>
+    </security>
+  </trustInfo>
+  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+    <application>
+      <!-- 设计此应用程序与其一起工作且已针对此应用程序进行测试的
+           Windows 版本的列表。取消评论适当的元素,Windows 将
+           自动选择最兼容的环境。 -->
+      <!-- Windows Vista -->
+      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+      <!-- Windows 7 -->
+      <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+      <!-- Windows 8 -->
+      <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+      <!-- Windows 8.1 -->
+      <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+      <!-- Windows 10 -->
+      <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+    </application>
+  </compatibility>
+  <!-- 指示该应用程序可以感知 DPI 且 Windows 在 DPI 较高时将不会对其进行
+       自动缩放。Windows Presentation Foundation (WPF)应用程序自动感知 DPI,无需
+       选择加入。选择加入此设置的 Windows 窗体应用程序(目标设定为 .NET Framework 4.6 )还应
+       在其 app.config 中将 "EnableWindowsFormsHighDpiAutoResizing" 设置设置为 "true"。-->
+  <!--
+  <application xmlns="urn:schemas-microsoft-com:asm.v3">
+    <windowsSettings>
+      <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+    </windowsSettings>
+  </application>
+  -->
+  <!-- 启用 Windows 公共控件和对话框的主题(Windows XP 和更高版本) -->
+  <!--
+  <dependency>
+    <dependentAssembly>
+      <assemblyIdentity
+          type="win32"
+          name="Microsoft.Windows.Common-Controls"
+          version="6.0.0.0"
+          processorArchitecture="*"
+          publicKeyToken="6595b64144ccf1df"
+          language="*"
+        />
+    </dependentAssembly>
+  </dependency>
+  -->
+</assembly>

+ 70 - 63
UAS-MES/UAS-MES.csproj

@@ -12,7 +12,7 @@
     <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
-    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <IsWebBootstrapper>true</IsWebBootstrapper>
     <TargetFrameworkProfile />
     <SccProjectName>
     </SccProjectName>
@@ -24,7 +24,7 @@
     </SccProvider>
     <PublishUrl>F:\MESRelease\</PublishUrl>
     <Install>true</Install>
-    <InstallFrom>Disk</InstallFrom>
+    <InstallFrom>Web</InstallFrom>
     <UpdateEnabled>true</UpdateEnabled>
     <UpdateMode>Foreground</UpdateMode>
     <UpdateInterval>7</UpdateInterval>
@@ -32,15 +32,17 @@
     <UpdatePeriodically>false</UpdatePeriodically>
     <UpdateRequired>false</UpdateRequired>
     <MapFileExtensions>true</MapFileExtensions>
+    <InstallUrl>http://218.17.158.219:8888/publish.htm/</InstallUrl>
     <UpdateUrl>http://218.17.158.219:8888/publish.htm/</UpdateUrl>
     <TargetCulture>zh</TargetCulture>
     <ProductName>优软MES系统</ProductName>
     <PublisherName>深圳市优软科技有限公司</PublisherName>
     <SuiteName>优软MES系统</SuiteName>
     <MinimumRequiredVersion>1.0.0.59</MinimumRequiredVersion>
+    <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
     <WebPage>publish.htm</WebPage>
     <OpenBrowserOnPublish>false</OpenBrowserOnPublish>
-    <ApplicationRevision>191</ApplicationRevision>
+    <ApplicationRevision>201</ApplicationRevision>
     <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
     <UseApplicationTrust>true</UseApplicationTrust>
     <CreateDesktopShortcut>true</CreateDesktopShortcut>
@@ -69,10 +71,11 @@
     <WarningLevel>4</WarningLevel>
   </PropertyGroup>
   <PropertyGroup>
-    <ManifestCertificateThumbprint>0702B5BD480611CA32663309A8FD3717B722E307</ManifestCertificateThumbprint>
+    <ManifestCertificateThumbprint>4FA99E585616700DE7B55D9E1B52AECEA80A31C9</ManifestCertificateThumbprint>
   </PropertyGroup>
   <PropertyGroup>
-    <ManifestKeyFile>Cert\深圳市优软科技有限公司.pfx</ManifestKeyFile>
+    <ManifestKeyFile>
+    </ManifestKeyFile>
   </PropertyGroup>
   <PropertyGroup>
     <GenerateManifests>true</GenerateManifests>
@@ -98,6 +101,9 @@
   <PropertyGroup />
   <PropertyGroup />
   <PropertyGroup />
+  <PropertyGroup />
+  <PropertyGroup />
+  <PropertyGroup />
   <PropertyGroup>
     <NoWin32Manifest>true</NoWin32Manifest>
   </PropertyGroup>
@@ -1015,6 +1021,7 @@
       <DependentUpon>SystemSetting_ScaleTest.cs</DependentUpon>
     </EmbeddedResource>
     <None Include="Cert\深圳市优软科技有限公司.pfx" />
+    <None Include="Properties\app.manifest" />
     <None Include="Properties\Settings.settings">
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@@ -1145,292 +1152,292 @@
   <ItemGroup>
     <PublishFile Include="BtSystem.Client">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Client.Reader">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Interfaces">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Network">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Reprint.Support">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Strings">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.Support">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="BtSystem.UI">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevComponents.DotNetBar2">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Data.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Printing.v11.1.Core">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Utils.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.Xpo.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraBars.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraEditors.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraGrid.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="DevExpress.XtraLayout.v11.1">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Interop.BarTender">
       <Visible>False</Visible>
+      <PublishState>Include</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Include</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Interop.DriverAutomationLibrary">
       <Visible>False</Visible>
+      <PublishState>Include</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Include</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Interop.NetFwTypeLib">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Maestro.Interface">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Maestro.Library">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Framework">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Framework.Interop">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Interop">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Librarian.Core">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Security">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.Security.Interop">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
     <PublishFile Include="Seagull.XpoDataAccess">
       <Visible>False</Visible>
+      <PublishState>Exclude</PublishState>
+      <IncludeHash>True</IncludeHash>
       <Group>
       </Group>
       <TargetPath>
       </TargetPath>
-      <PublishState>Exclude</PublishState>
-      <IncludeHash>True</IncludeHash>
       <FileType>Assembly</FileType>
     </PublishFile>
   </ItemGroup>