Bläddra i källkod

DBFind放大镜赋值方式修改

Hcsy 8 år sedan
förälder
incheckning
0459a1ab40

+ 12 - 3
UAS-MES/CustomControl/TextBoxWithIcon/SearchTextBox.cs

@@ -58,6 +58,7 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         /// </summary>
         private string selectField;
         DataTable dt = new DataTable();
+        DbFind db;
 
         private DataTable returnData;
 
@@ -259,12 +260,13 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
         private void Search_Icon_Click(object sender, EventArgs e)
         {
             SearchIconClick?.Invoke(sender, new EventArgs());
-            DbFind db = new DbFind(Name, tableName, selectField, setValueField, caller, formName, condition);
+            db = new DbFind(Name, tableName, selectField, setValueField, caller, formName, condition);
             db.Text = DBTitle1;
             LogManager.DoLog("DbFind查询,发起窗口【" + formName + "】,查询表【" + tableName + "】,字段" + selectField + ",条件" + condition);
             if (db.IsAbleDbFind1)
             {
                 db.ShowDialog();
+                GetData();
             }
             else
             {
@@ -330,9 +332,16 @@ namespace UAS_MES.CustomControl.TextBoxWithIcon
                     if (i % 2 == 0)
                         fields.Add(field[i]);
                 }
+                string sql;
                 //将查询到的结果返回界面
-                string sql = "select " + BaseUtil.AddField(fields.ToArray()) + " from " + tableName + " where " + Name + "='" + TextBox.Text + "'";
-                if (condition != null)
+                if (TextBox.Text != null)
+                {
+                     sql = "select " + BaseUtil.AddField(fields.ToArray()) + " from " + tableName + " where " + Name + "='" + TextBox.Text + "'";
+                }
+                else {
+                    sql = "select " + BaseUtil.AddField(fields.ToArray()) + " from " + tableName + " where " + Name + "='" + db.TextBoxValue1 + "'";
+                }
+                    if (condition != null)
                 {
                     sql += " and " + condition;
                 }

+ 1 - 1
UAS-MES/DbFind.cs

@@ -226,7 +226,7 @@ namespace UAS_MES
                 }
                 else
                 {
-                    if ((SetValueField[j] == dt.Columns[i].Caption || SetValueField[j] == dt.Columns[i].ColumnName || SetValueField[j].Contains(dt.Columns[i].Caption) || (ct != null && ct.Tag != null && ct.Tag.ToString() == dt.Columns[i].Caption)) && ct.Name.ToString() == SetValueField[j])
+                    if ((SetValueField[j] == dt.Columns[i].Caption || SetValueField[j] == dt.Columns[i].ColumnName || SetValueField[j].Contains(dt.Columns[i].Caption) || (ct != null && ct.Tag != null && ct.Tag.ToString() == dt.Columns[i].Caption)) && ct.Name.ToString().ToUpper() == SetValueField[j].ToUpper())
                         ct.Text = DbFindGridView.Rows[e.RowIndex].Cells[dt.Columns[i].ColumnName].Value.ToString();
                     if (ct.Name == MainField)
                     {

+ 5 - 0
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -608,6 +608,11 @@ namespace UAS_MES.Make
         {
             if (ma_code.Text.Length > 4)
             {
+                mcd_remainqty.Text = "";
+                mcd_inqty.Text = "";
+                ob_batchqty.Text = "";
+                ob_nowcheckqty.Text = "";
+                ob_sendqty.Text = "";
                 LoadCollectedNum();
                 LoadCheckQTY();
             }

+ 3 - 3
UAS-MES/FunctionCode/OQC/OQC_PlanMaintain.cs

@@ -30,14 +30,14 @@ namespace UAS_MES.OQC
 
             pr_code.TableName = "QUA_Project";
             pr_code.SelectField = "pr_code # 方案编号,pr_name # 方案名称,pr_class # 检验单类型,pr_standard # 方案标准,pr_startdate # 生效日期,pr_enddate #失效日期 ,pr_status # 状态";
-            pr_code.SetValueField = new string[] { "ob_projectcode" };
+            pr_code.SetValueField = new string[] { "pr_code" };
             pr_code.FormName = Name;
             pr_code.DbChange += Pr_code_DbChange;
 
             al_code.TableName = "QUA_AQL";
             al_code.DBTitle = "抽样标准查询";
-            al_code.SelectField = "AL_CODE  # 流水编号,AL_NAME # 检验标准名称";
-            al_code.SetValueField = new string[] { "ob_aqlcode" };
+            al_code.SelectField = "al_code  # 流水编号,AL_NAME # 检验标准名称";
+            al_code.SetValueField = new string[] { "al_code" };
             al_code.FormName = Name;
             al_code.Condition = "al_statuscode='AUDITED'";
             al_code.DbChange += Al_code_DbChange;