|
|
@@ -119,29 +119,39 @@ namespace CNAS_RunSync |
|
|
|
AddDatagridColumn(dgvSyncData, "GridGuid", "GridGuid", 50, false); |
|
|
|
|
|
|
|
//2.2获取数据源数据 |
|
|
|
this.RefreshData(); |
|
|
|
try |
|
|
|
{ |
|
|
|
this.RefreshData(); |
|
|
|
} |
|
|
|
catch (Exception exception) |
|
|
|
{ |
|
|
|
MessageBox.Show($"查询数据时发生异常:{exception.Message}"); |
|
|
|
} |
|
|
|
|
|
|
|
//3.初始化查询相关内容 |
|
|
|
//3.1 绑定Combobox数据源 |
|
|
|
foreach (DataColumn dc in dtSource.Columns) |
|
|
|
if (0 < dtSource?.Columns?.Count) |
|
|
|
{ |
|
|
|
if (syncInstrumentItem.LstSyncPramas.Where(s => s.SourceField.ToUpper() == dc.ColumnName.ToUpper()).LongCount<SyncParamasInfo>() > 0) |
|
|
|
foreach (DataColumn dc in dtSource.Columns) |
|
|
|
{ |
|
|
|
string strColumnName = dc.ColumnName; |
|
|
|
if (DictField.ContainsKey(strColumnName)) |
|
|
|
strColumnName = DictField[strColumnName]; |
|
|
|
DictComboBox.Add(strColumnName, dc.DataType); |
|
|
|
if (syncInstrumentItem.LstSyncPramas.Where(s => s.SourceField.ToUpper() == dc.ColumnName.ToUpper()).LongCount<SyncParamasInfo>() > 0) |
|
|
|
{ |
|
|
|
string strColumnName = dc.ColumnName; |
|
|
|
if (DictField.ContainsKey(strColumnName)) |
|
|
|
strColumnName = DictField[strColumnName]; |
|
|
|
DictComboBox.Add(strColumnName, dc.DataType); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (DictComboBox.Count > 0) |
|
|
|
{ |
|
|
|
BindingSource bsComboBox = new BindingSource |
|
|
|
if (DictComboBox.Count > 0) |
|
|
|
{ |
|
|
|
DataSource = DictComboBox |
|
|
|
}; |
|
|
|
cmbColumns.DataSource = bsComboBox; |
|
|
|
cmbColumns.ValueMember = "Key"; |
|
|
|
cmbColumns.DisplayMember = "Key"; |
|
|
|
BindingSource bsComboBox = new BindingSource |
|
|
|
{ |
|
|
|
DataSource = DictComboBox |
|
|
|
}; |
|
|
|
cmbColumns.DataSource = bsComboBox; |
|
|
|
cmbColumns.ValueMember = "Key"; |
|
|
|
cmbColumns.DisplayMember = "Key"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -178,7 +188,7 @@ namespace CNAS_RunSync |
|
|
|
} |
|
|
|
catch |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
dtSource = dv.ToTable(); |
|
|
|
} |
|
|
@@ -574,7 +584,16 @@ namespace CNAS_RunSync |
|
|
|
} |
|
|
|
|
|
|
|
//0.获取数据源数据 |
|
|
|
this.RefreshData(); |
|
|
|
try |
|
|
|
{ |
|
|
|
|
|
|
|
this.RefreshData(); |
|
|
|
} |
|
|
|
catch (Exception exception) |
|
|
|
{ |
|
|
|
MessageBox.Show($"查询数据时发生异常:{exception.Message}"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
//1.合法性检测 |
|
|
|
if (DictComboBox[cmbColumns.SelectedValue.ToString()].ToString().Equals("System.DateTime")) |
|
|
@@ -730,6 +749,8 @@ namespace CNAS_RunSync |
|
|
|
} |
|
|
|
private void btnCancelFind_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
this.txtFind.Text = string.Empty; |
|
|
|
|
|
|
|
foreach (DataGridViewRow dgvrow in dgvSyncData.Rows) |
|
|
|
{ |
|
|
|
if (dgvrow.Cells[0].Value != null && dgvrow.Cells[0].Value.ToString() == "True") |
|
|
|