Browse Source

Merge branch 'master' of repos.ubtob.net:usoft/mes-client

callm 1 year ago
parent
commit
6115588eb4
1 changed files with 40 additions and 23 deletions
  1. 40 23
      UAS-MES/CustomControl/TextBoxWithIcon/SnCollectionBox.cs

+ 40 - 23
UAS-MES/CustomControl/TextBoxWithIcon/SnCollectionBox.cs

@@ -24,34 +24,33 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         {
             get
             {
-                if (SystemInf.GetRelation&&base.Text!="")
-                {
-
-                   string sn = dh.getFieldDataByCondition("SNRELATION_VIEW", "sr_sn", "content like '%"+base.Text+"%'").ToString();
-                   int count = int.Parse(dh.getFieldDataByCondition("SNRELATION_VIEW", "count(1) cn", "content like '%" + base.Text + "%'").ToString());
-                    if (sn == ""||count>1)
-                    {
-                        MessageBox.Show("SN:" + base.Text + "未找到关联信息");
-                        return "";
-                    }
-                    else
-                    {
-
-                        if (SystemInf.UpperCollection)
-                            return sn.ToUpper();
-                        else
-                            return sn;
-                    }
-                }
-                else
-                {
+ //               if (SystemInf.GetRelation&&base.Text!="")
+ //               {
+ //                   string sn = dh.getFieldDataByCondition("SNRELATION_VIEW", "sr_sn", "content like '%"+base.Text+"%'").ToString();
+ //                  int count = int.Parse(dh.getFieldDataByCondition("SNRELATION_VIEW", "count(1) cn", "content like '%" + base.Text + "%'").ToString());
+ //                   if (sn == ""||count>1)
+ //                   {
+ //                       MessageBox.Show("SN:" + base.Text + "未找到关联信息");
+ //                       return "";
+ //                   }
+ //                   else
+ //                   {
+ ////                       base.Text = sn;
+ //                       if (SystemInf.UpperCollection)
+ //                           return sn.ToUpper();
+ //                       else
+ //                           return sn;
+ //                   }
+ //               }
+ //               else
+ //               {
                     if (SystemInf.UpperCollection)
                         return base.Text.ToUpper();
                     else
                         return base.Text;
-                }
+ //              }
             }
-
+            
             set
             {
                 base.Text = value;
@@ -62,6 +61,24 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         {
             if (e.KeyCode == Keys.Enter)
             {
+                if (SystemInf.GetRelation && base.Text != "")
+                {
+                    string sn = dh.getFieldDataByCondition("SNRELATION_VIEW", "sr_sn", "content like '%" + base.Text + "%'").ToString();
+                    int count = int.Parse(dh.getFieldDataByCondition("SNRELATION_VIEW", "count(1) cn", "content like '%" + base.Text + "%'").ToString());
+                    if (sn == "" || count > 1)
+                    {
+                        MessageBox.Show("SN:" + base.Text + "未找到关联信息");
+                        return ;
+                    }
+                    else
+                    {
+                        
+                        if (SystemInf.UpperCollection)
+                            base.Text =  sn.ToUpper();
+                        else
+                            base.Text = sn;
+                    }
+                }
                 this.SelectAll();
             }
         }