Browse Source

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

Hcsy 8 years ago
parent
commit
e9572d4c6b

+ 120 - 0
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxNumOnly.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 26 - 3
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithPlaceHolder.Designer.cs

@@ -28,16 +28,39 @@
         /// </summary>
         /// </summary>
         private void InitializeComponent()
         private void InitializeComponent()
         {
         {
+            this.TextBox = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
+            // TextBox
+            // 
+            this.TextBox.AllPower = null;
+            this.TextBox.BackColor = System.Drawing.Color.White;
+            this.TextBox.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.TextBox.ID = null;
+            this.TextBox.Location = new System.Drawing.Point(0, 0);
+            this.TextBox.Name = "TextBox";
+            this.TextBox.Power = null;
+            this.TextBox.Size = new System.Drawing.Size(241, 25);
+            this.TextBox.Str = null;
+            this.TextBox.Str1 = null;
+            this.TextBox.Str2 = null;
+            this.TextBox.TabIndex = 0;
+            this.TextBox.TextChanged += new System.EventHandler(this.TextBox_TextChanged);
+            this.TextBox.Enter += new System.EventHandler(this.TextBox_Enter);
+            this.TextBox.Leave += new System.EventHandler(this.TextBox_Leave);
+            // 
             // TextBoxWithPlaceHolder
             // TextBoxWithPlaceHolder
             // 
             // 
-            this.Size = new System.Drawing.Size(241, 21);
-            this.Enter += new System.EventHandler(this.TextBoxWithPlaceHolder_Enter);
-            this.Leave += new System.EventHandler(this.TextBoxWithPlaceHolder_Leave);
+            this.BackColor = System.Drawing.Color.Transparent;
+            this.Controls.Add(this.TextBox);
+            this.Name = "TextBoxWithPlaceHolder";
+            this.Size = new System.Drawing.Size(241, 28);
             this.ResumeLayout(false);
             this.ResumeLayout(false);
+            this.PerformLayout();
 
 
         }
         }
         #endregion
         #endregion
+
+        private EnterTextBox TextBox;
     }
     }
 }
 }

+ 42 - 23
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithPlaceHolder.cs

@@ -1,9 +1,10 @@
-using System.Drawing;
+using System;
+using System.Drawing;
 using System.Windows.Forms;
 using System.Windows.Forms;
 
 
 namespace UAS_MES.CustomControl.TextBoxWithIcon
 namespace UAS_MES.CustomControl.TextBoxWithIcon
 {
 {
-    public partial class TextBoxWithPlaceHolder : EnterTextBox
+    public partial class TextBoxWithPlaceHolder : UserControl
     {
     {
         //记录一个PlaceHolder,第一次对这个文本框赋的值
         //记录一个PlaceHolder,第一次对这个文本框赋的值
         string PlaceHolder1;
         string PlaceHolder1;
@@ -21,45 +22,63 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
             }
             }
         }
         }
 
 
+        public override string Text
+        {
+            get
+            {
+                if (TextBox.Text == PlaceHolder1)
+                {
+                    return "";
+                }
+                return TextBox.Text;
+            }
+
+            set
+            {
+                TextBox.Text = value;
+            }
+        }
+
+        public delegate void OnTextChange(object sender, EventArgs e);
+
+        public event OnTextChange UserControlTextChanged;
+
         public TextBoxWithPlaceHolder()
         public TextBoxWithPlaceHolder()
         {
         {
             InitializeComponent();
             InitializeComponent();
-            this.GotFocus += TextBoxWithPlaceHolder_GetFocus;
+            Load += TextBoxWithPlaceHolder_Load;
         }
         }
 
 
-        private void TextBoxWithPlaceHolder_GetFocus(object sender, System.EventArgs e) {
-
+        private void TextBoxWithPlaceHolder_Load(object sender, System.EventArgs e)
+        {
+            TextBox.Text = PlaceHolder1;
+            TextBox.ForeColor = Color.Silver;
         }
         }
 
 
-        private void TextBoxWithPlaceHolder_Leave(object sender, System.EventArgs e)
+        private void TextBox_Leave(object sender, System.EventArgs e)
         {
         {
             //失去焦点的时候如果文本框存在内容就把文字变色
             //失去焦点的时候如果文本框存在内容就把文字变色
-            BackColor = Color.White;
-            if (Text == "")
+            TextBox.BackColor = Color.White;
+            if (TextBox.Text == "")
             {
             {
-                ForeColor = Color.Silver;
-                Text = PlaceHolder1;
+                TextBox.ForeColor = Color.Silver;
+                TextBox.Text = PlaceHolder1;
             }
             }
         }
         }
 
 
-        private void TextBoxWithPlaceHolder_Enter(object sender, System.EventArgs e)
+        private void TextBox_Enter(object sender, System.EventArgs e)
         {
         {
-            BackColor = Color.GreenYellow;
-            ForeColor = Color.Black;
-            //如果文本框的内容等与PlaceHolder就将文本框清空
-            if (Text == PlaceHolder1)
+            TextBox.ForeColor = Color.Black;
+            if (TextBox.Text == PlaceHolder1)
             {
             {
-                Clear();
+                TextBox.Text = "";
             }
             }
+            else TextBox.ForeColor = Color.Black;
         }
         }
 
 
-        private void textBox1_TextChanged(object sender, System.EventArgs e)
+        private void TextBox_TextChanged(object sender, EventArgs e)
         {
         {
-            //由于PlaceHolder可能是在加载完窗体之后赋值,所以在TextChanged中再次判断
-            if (PlaceHolder1 == "")
-            {
-                PlaceHolder1 = Text;
-            }
+            UserControlTextChanged?.Invoke(sender, new EventArgs());
         }
         }
     }
     }
-}
+}

+ 0 - 3
UAS-MES/CustomControl/TextBoxWithIcon/TextBoxWithPlaceHolder.resx

@@ -117,7 +117,4 @@
   <resheader name="writer">
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   </resheader>
-  <metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>False</value>
-  </metadata>
 </root>
 </root>

+ 24 - 8
UAS-MES/Form1.Designer.cs

@@ -33,6 +33,7 @@
             this.button3 = new System.Windows.Forms.Button();
             this.button3 = new System.Windows.Forms.Button();
             this.button4 = new System.Windows.Forms.Button();
             this.button4 = new System.Windows.Forms.Button();
             this.progressBar1 = new System.Windows.Forms.ProgressBar();
             this.progressBar1 = new System.Windows.Forms.ProgressBar();
+            this.textBoxWithPlaceHolder1 = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.SuspendLayout();
             this.SuspendLayout();
             // 
             // 
             // button1
             // button1
@@ -57,9 +58,10 @@
             // 
             // 
             // button3
             // button3
             // 
             // 
-            this.button3.Location = new System.Drawing.Point(305, 158);
+            this.button3.Location = new System.Drawing.Point(407, 198);
+            this.button3.Margin = new System.Windows.Forms.Padding(4);
             this.button3.Name = "button3";
             this.button3.Name = "button3";
-            this.button3.Size = new System.Drawing.Size(75, 23);
+            this.button3.Size = new System.Drawing.Size(100, 29);
             this.button3.TabIndex = 0;
             this.button3.TabIndex = 0;
             this.button3.Text = "button3";
             this.button3.Text = "button3";
             this.button3.UseVisualStyleBackColor = true;
             this.button3.UseVisualStyleBackColor = true;
@@ -67,9 +69,10 @@
             // 
             // 
             // button4
             // button4
             // 
             // 
-            this.button4.Location = new System.Drawing.Point(410, 158);
+            this.button4.Location = new System.Drawing.Point(547, 198);
+            this.button4.Margin = new System.Windows.Forms.Padding(4);
             this.button4.Name = "button4";
             this.button4.Name = "button4";
-            this.button4.Size = new System.Drawing.Size(75, 23);
+            this.button4.Size = new System.Drawing.Size(100, 29);
             this.button4.TabIndex = 2;
             this.button4.TabIndex = 2;
             this.button4.Text = "button4";
             this.button4.Text = "button4";
             this.button4.UseVisualStyleBackColor = true;
             this.button4.UseVisualStyleBackColor = true;
@@ -78,19 +81,31 @@
             // progressBar1
             // progressBar1
             // 
             // 
             this.progressBar1.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
             this.progressBar1.ForeColor = System.Drawing.SystemColors.ControlDarkDark;
-            this.progressBar1.Location = new System.Drawing.Point(216, 90);
+            this.progressBar1.Location = new System.Drawing.Point(288, 112);
+            this.progressBar1.Margin = new System.Windows.Forms.Padding(4);
             this.progressBar1.Name = "progressBar1";
             this.progressBar1.Name = "progressBar1";
-            this.progressBar1.Size = new System.Drawing.Size(336, 23);
+            this.progressBar1.Size = new System.Drawing.Size(448, 29);
             this.progressBar1.TabIndex = 3;
             this.progressBar1.TabIndex = 3;
             // 
             // 
+            // textBoxWithPlaceHolder1
+            // 
+            this.textBoxWithPlaceHolder1.BackColor = System.Drawing.Color.White;
+            this.textBoxWithPlaceHolder1.Location = new System.Drawing.Point(747, 292);
+            this.textBoxWithPlaceHolder1.Name = "textBoxWithPlaceHolder1";
+            this.textBoxWithPlaceHolder1.PlaceHolder = "123123";
+            this.textBoxWithPlaceHolder1.Size = new System.Drawing.Size(241, 25);
+            this.textBoxWithPlaceHolder1.TabIndex = 4;
+            // 
             // Form1
             // Form1
             // 
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(929, 590);
+            this.ClientSize = new System.Drawing.Size(1239, 738);
+            this.Controls.Add(this.textBoxWithPlaceHolder1);
             this.Controls.Add(this.progressBar1);
             this.Controls.Add(this.progressBar1);
             this.Controls.Add(this.button4);
             this.Controls.Add(this.button4);
             this.Controls.Add(this.button3);
             this.Controls.Add(this.button3);
+            this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "Form1";
             this.Name = "Form1";
             this.Tag = "123123";
             this.Tag = "123123";
             this.Text = "Form1";
             this.Text = "Form1";
@@ -109,5 +124,6 @@
         private System.Windows.Forms.Button button3;
         private System.Windows.Forms.Button button3;
         private System.Windows.Forms.Button button4;
         private System.Windows.Forms.Button button4;
         private System.Windows.Forms.ProgressBar progressBar1;
         private System.Windows.Forms.ProgressBar progressBar1;
+        private CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder textBoxWithPlaceHolder1;
     }
     }
 }
 }

+ 3 - 5
UAS-MES/Form1.cs

@@ -102,7 +102,8 @@ namespace UAS_MES
                 this.progressBar1.Value = e.ProgressPercentage;
                 this.progressBar1.Value = e.ProgressPercentage;
                 //this.label1.Text = e.ProgressPercentage + "%";
                 //this.label1.Text = e.ProgressPercentage + "%";
             };
             };
-            if (e.ProgressPercentage == 100) {
+            if (e.ProgressPercentage == 100)
+            {
                 ZipHelper.UnZip(@"H:\UAS_WinForm\UAS-MES\bin\Debug\icsharpcode-SharpZipLib-4ad264b.zip", @"D:\");
                 ZipHelper.UnZip(@"H:\UAS_WinForm\UAS-MES\bin\Debug\icsharpcode-SharpZipLib-4ad264b.zip", @"D:\");
             }
             }
             this.Invoke(act);
             this.Invoke(act);
@@ -125,10 +126,7 @@ namespace UAS_MES
 
 
         private void button4_Click(object sender, EventArgs e)
         private void button4_Click(object sender, EventArgs e)
         {
         {
-            WebClient wc = new WebClient();
-            wc.DownloadProgressChanged += Wc_DownloadProgressChanged;
-            wc.DownloadFileAsync(new Uri("http://218.17.158.219:8888/UAS_WinForm.zip"), "UAS_WinForm.zip");
-          
+            MessageBox.Show(textBoxWithPlaceHolder1.Text);
         }
         }
     }
     }
 
 

+ 13 - 20
UAS-MES/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -88,9 +88,9 @@
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.SNCodeEnterTextBox();
             this.ms_sncode = new UAS_MES.CustomControl.TextBoxWithIcon.SNCodeEnterTextBox();
             this.ma_softversion = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ma_softversion = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ma_softversion_label = new System.Windows.Forms.Label();
             this.ma_softversion_label = new System.Windows.Forms.Label();
-            this.Filter = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.BadInfSource = new System.Windows.Forms.BindingSource(this.components);
             this.BadInfSource = new System.Windows.Forms.BindingSource(this.components);
             this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.NoteForChange = new System.Windows.Forms.CheckBox();
+            this.Filter = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder();
             this.panel2.SuspendLayout();
             this.panel2.SuspendLayout();
             this.panel1.SuspendLayout();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.BadInfSource)).BeginInit();
@@ -793,23 +793,6 @@
             this.ma_softversion_label.TabIndex = 72;
             this.ma_softversion_label.TabIndex = 72;
             this.ma_softversion_label.Text = "软件版本";
             this.ma_softversion_label.Text = "软件版本";
             // 
             // 
-            // Filter
-            // 
-            this.Filter.AllPower = null;
-            this.Filter.BackColor = System.Drawing.Color.White;
-            this.Filter.Font = new System.Drawing.Font("宋体", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Filter.ID = null;
-            this.Filter.Location = new System.Drawing.Point(124, 355);
-            this.Filter.Margin = new System.Windows.Forms.Padding(4);
-            this.Filter.Name = "Filter";
-            this.Filter.Power = null;
-            this.Filter.Size = new System.Drawing.Size(233, 28);
-            this.Filter.Str = null;
-            this.Filter.Str1 = null;
-            this.Filter.Str2 = null;
-            this.Filter.TabIndex = 74;
-            this.Filter.TextChanged += new System.EventHandler(this.Filter_TextChanged);
-            // 
             // NoteForChange
             // NoteForChange
             // 
             // 
             this.NoteForChange.AutoSize = true;
             this.NoteForChange.AutoSize = true;
@@ -824,14 +807,24 @@
             this.NoteForChange.Text = "切换工单提示";
             this.NoteForChange.Text = "切换工单提示";
             this.NoteForChange.UseVisualStyleBackColor = true;
             this.NoteForChange.UseVisualStyleBackColor = true;
             // 
             // 
+            // Filter
+            // 
+            this.Filter.Font = new System.Drawing.Font("宋体", 10.8F);
+            this.Filter.Location = new System.Drawing.Point(124, 357);
+            this.Filter.Name = "Filter";
+            this.Filter.PlaceHolder = "查询不良";
+            this.Filter.Size = new System.Drawing.Size(234, 28);
+            this.Filter.TabIndex = 76;
+            this.Filter.UserControlTextChanged += new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder.OnTextChange(this.Filter_UserControlTextChanged);
+            // 
             // Make_TestCollection
             // Make_TestCollection
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.BackColor = System.Drawing.SystemColors.Control;
             this.ClientSize = new System.Drawing.Size(1149, 700);
             this.ClientSize = new System.Drawing.Size(1149, 700);
-            this.Controls.Add(this.NoteForChange);
             this.Controls.Add(this.Filter);
             this.Controls.Add(this.Filter);
+            this.Controls.Add(this.NoteForChange);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.ma_softversion);
             this.Controls.Add(this.ma_softversion_label);
             this.Controls.Add(this.ma_softversion_label);
             this.Controls.Add(this.panel1);
             this.Controls.Add(this.panel1);
@@ -945,8 +938,8 @@
         private System.Windows.Forms.Label ma_softversion_label;
         private System.Windows.Forms.Label ma_softversion_label;
         private System.Windows.Forms.ColumnHeader columnHeader9;
         private System.Windows.Forms.ColumnHeader columnHeader9;
         private System.Windows.Forms.ColumnHeader columnHeader10;
         private System.Windows.Forms.ColumnHeader columnHeader10;
-        private CustomControl.TextBoxWithIcon.EnterTextBox Filter;
         private System.Windows.Forms.BindingSource BadInfSource;
         private System.Windows.Forms.BindingSource BadInfSource;
         private System.Windows.Forms.CheckBox NoteForChange;
         private System.Windows.Forms.CheckBox NoteForChange;
+        private CustomControl.TextBoxWithIcon.TextBoxWithPlaceHolder Filter;
     }
     }
 }
 }

+ 26 - 19
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -677,30 +677,37 @@ namespace UAS_MES.Make
             LoadBadGroupData();
             LoadBadGroupData();
         }
         }
 
 
-        private void Filter_TextChanged(object sender, EventArgs e)
+        private void Filter_UserControlTextChanged(object sender, EventArgs e)
         {
         {
-            DataRow[] dr = (BadInfSource.DataSource as DataTable).Select("bc_code like '%" + Filter.Text + "%'");
-            DataTable dt = (BadInfSource.DataSource as DataTable).Clone();
-            for (int i = 0; i < dr.Length; i++)
+            try
             {
             {
-                dt.Rows.Add(dr[i].ItemArray);
-            }
-            WaitRejectList.Items.Clear();
-            WaitRejectList.BeginUpdate();
-            for (int i = 0; i < dt.Rows.Count; i++)
-            {
-                if (!ChoosedList.Contains(dt.Rows[i]["bc_code"].ToString()))
+                DataRow[] dr = (BadInfSource.DataSource as DataTable).Select("bc_code like '%" + Filter.Text + "%' or bc_name like '%" + Filter.Text + "%'");
+                DataTable dt = (BadInfSource.DataSource as DataTable).Clone();
+                for (int i = 0; i < dr.Length; i++)
                 {
                 {
-                    ListViewItem lvi = new ListViewItem();
-                    //第一列是勾选列,设置列头文本为空
-                    lvi.Text = "";
-                    WaitList.Add(dt.Rows[i]["bc_code"].ToString());
-                    for (int j = 0; j < dt.Columns.Count; j++)
-                        lvi.SubItems.Add(dt.Rows[i][j].ToString());
-                    WaitRejectList.Items.Add(lvi);
+                    dt.Rows.Add(dr[i].ItemArray);
+                }
+                WaitRejectList.Items.Clear();
+                WaitRejectList.BeginUpdate();
+                for (int i = 0; i < dt.Rows.Count; i++)
+                {
+                    if (!ChoosedList.Contains(dt.Rows[i]["bc_code"].ToString()))
+                    {
+                        ListViewItem lvi = new ListViewItem();
+                        //第一列是勾选列,设置列头文本为空
+                        lvi.Text = "";
+                        WaitList.Add(dt.Rows[i]["bc_code"].ToString());
+                        for (int j = 0; j < dt.Columns.Count; j++)
+                            lvi.SubItems.Add(dt.Rows[i][j].ToString());
+                        WaitRejectList.Items.Add(lvi);
+                    }
                 }
                 }
+                WaitRejectList.EndUpdate();
+            }
+            catch (Exception)
+            {
+
             }
             }
-            WaitRejectList.EndUpdate();
         }
         }
     }
     }
 }
 }