|
|
@@ -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;
|
|
|
}
|