|
|
@@ -13,6 +13,7 @@ using System.Text.RegularExpressions; |
|
|
|
using System.Windows.Forms; |
|
|
|
using System.Xml.Linq; |
|
|
|
using System.Xml.Serialization; |
|
|
|
using static System.Runtime.CompilerServices.RuntimeHelpers; |
|
|
|
|
|
|
|
namespace CNAS_DBSync |
|
|
|
{ |
|
|
@@ -67,13 +68,19 @@ namespace CNAS_DBSync |
|
|
|
frmSystemSetting frmSetting = new frmSystemSetting(lstSyncInstrument, strInstrumentCode); |
|
|
|
frmSetting.InstrumentDelegate = delegate (SyncInstrumentItemInfo Instrumentitem) |
|
|
|
{ |
|
|
|
lstSyncInstrument.Add(Instrumentitem); |
|
|
|
var lstInstrument = lstSyncInstrument.Where(s => s.Code == strInstrumentCode).ToList<SyncInstrumentItemInfo>(); |
|
|
|
if (lstInstrument.Count == 1) |
|
|
|
{ |
|
|
|
lstInstrument[0].Code = Instrumentitem.Code; |
|
|
|
lstInstrument[0].InstruType = Instrumentitem.InstruType; |
|
|
|
} |
|
|
|
}; |
|
|
|
if (frmSetting.ShowDialog() == DialogResult.OK) |
|
|
|
{ |
|
|
|
//绑定数据 |
|
|
|
dgvInstrument.DataSource = new BindingList<SyncInstrumentItemInfo>(lstSyncInstrument); |
|
|
|
dgvInstrument.CurrentCell = dgvInstrument.Rows[dgvInstrument.Rows.Count - 1].Cells[0]; |
|
|
|
dgvInstrument_SelectionChanged(null, null); |
|
|
|
}; |
|
|
|
frmSetting.ShowDialog(); |
|
|
|
} |
|
|
|
//frmSetting.ShowDialog(); |
|
|
|
} |
|
|
|
|
|
|
|
private void Option2_Click(object sender, EventArgs e) |
|
|
@@ -401,6 +408,25 @@ namespace CNAS_DBSync |
|
|
|
} |
|
|
|
break; |
|
|
|
case DataSourceType.Oracle: |
|
|
|
strTableName_Instru = cbxInstrument.Text.ToString(); |
|
|
|
if (dictInstruTables.ContainsKey(strTableName_Instru)) |
|
|
|
{ |
|
|
|
DataTable dt = dictInstruTables[strTableName_Instru]; |
|
|
|
if (dt != null) |
|
|
|
{ |
|
|
|
dtInstruShow = new DataTable(); |
|
|
|
dtInstruShow.Columns.Add("InstruFieldName"); |
|
|
|
dtInstruShow.Columns.Add("InstruDataType"); |
|
|
|
|
|
|
|
foreach (DataColumn dc in dt.Columns) |
|
|
|
{ |
|
|
|
dtInstruShow.Rows.Add(new object[] { dc.ColumnName, dc.DataType }); |
|
|
|
} |
|
|
|
|
|
|
|
dgvInstruDS.DataSource = dtInstruShow; |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
default: |
|
|
|
foreach (DataColumn dc in dtTableType.Columns) |
|
|
|
{ |
|
|
@@ -976,20 +1002,20 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
private void dgvInstrument_CellDoubleClick(object sender, DataGridViewCellEventArgs e) |
|
|
|
{ |
|
|
|
//if (dgvInstrument.Rows.Count <= 0) return; |
|
|
|
////当前选中单元格 |
|
|
|
//string strInstrumentCode = this.dgvInstrument.Rows[this.dgvInstrument.CurrentRow.Index].Cells[0].Value.ToString(); |
|
|
|
if (dgvInstrument.Rows.Count <= 0) return; |
|
|
|
//当前选中单元格 |
|
|
|
string strInstrumentCode = this.dgvInstrument.Rows[this.dgvInstrument.CurrentRow.Index].Cells[0].Value.ToString(); |
|
|
|
|
|
|
|
//frmSystemSetting frmSetting = new frmSystemSetting(lstSyncInstrument, strInstrumentCode); |
|
|
|
//frmSetting.InstrumentDelegate = delegate (SyncInstrumentItemInfo Instrumentitem) |
|
|
|
//{ |
|
|
|
// lstSyncInstrument.Add(Instrumentitem); |
|
|
|
// //绑定数据 |
|
|
|
// dgvInstrument.DataSource = new BindingList<SyncInstrumentItemInfo>(lstSyncInstrument); |
|
|
|
// dgvInstrument.CurrentCell = dgvInstrument.Rows[dgvInstrument.Rows.Count - 1].Cells[0]; |
|
|
|
// dgvInstrument_SelectionChanged(null, null); |
|
|
|
//}; |
|
|
|
//frmSetting.ShowDialog(); |
|
|
|
frmSystemSetting frmSetting = new frmSystemSetting(lstSyncInstrument, strInstrumentCode); |
|
|
|
frmSetting.InstrumentDelegate = delegate (SyncInstrumentItemInfo Instrumentitem) |
|
|
|
{ |
|
|
|
lstSyncInstrument.Add(Instrumentitem); |
|
|
|
//绑定数据 |
|
|
|
dgvInstrument.DataSource = new BindingList<SyncInstrumentItemInfo>(lstSyncInstrument); |
|
|
|
dgvInstrument.CurrentCell = dgvInstrument.Rows[dgvInstrument.Rows.Count - 1].Cells[0]; |
|
|
|
dgvInstrument_SelectionChanged(null, null); |
|
|
|
}; |
|
|
|
frmSetting.ShowDialog(); |
|
|
|
} |
|
|
|
|
|
|
|
private void cbxCNASColumn_SelectedIndexChanged(object sender, EventArgs e) |
|
|
|