Hcsy 8 年之前
父节点
当前提交
92b39b908c

+ 2 - 4
UAS-MES/CustomControl/TextBoxWithIcon/MaCodeSearchTextBox.cs

@@ -264,12 +264,10 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         public void GetData()
         {
-            if (TextBox.Text != "")
-            {
                 DataHelper dh = new DataHelper();
                 string sql;
                 //将查询到的结果返回界面
-                if (TextBox.Text != null) { 
+                if (TextBox.Text != "") { 
                  sql = "select " + BaseUtil.AddField(setValueField) + " from " + tableName + " where " + Name + "='" + TextBox.Text + "'";
                 }
                 else { 
@@ -290,7 +288,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
                 }  
                 //不允许工单号为空的情况
                 LockCheckBox.Checked = true;
-            }
+            
         }
 
         private void fillControl(int i, Control ct)

+ 2 - 5
UAS-MES/CustomControl/TextBoxWithIcon/SearchTextBox.cs

@@ -321,12 +321,10 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
 
         public void GetData()
         {
-            if (TextBox.Text != "")
-            {
                 DataHelper dh = new DataHelper();
                 string sql;
                 //将查询到的结果返回界面
-                if (TextBox.Text != null)
+                if (TextBox.Text != "")
                 {
                      sql = "select " + BaseUtil.AddField(setValueField) + " from " + tableName + " where " + Name + "='" + TextBox.Text + "'";
                 }
@@ -345,8 +343,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
                 }
                 catch(Exception e){
                     LogManager.DoLog(e.Message);
-                }     
-            }
+                }                 
         }
     }
 }