|
|
@@ -266,9 +266,12 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo != null && currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType != DataSourceType.None) |
|
|
|
{ |
|
|
|
dgvMapping.DataSource = new BindingList<SyncParamasInfo>(currentSyncItem.LstSyncPramas); |
|
|
|
|
|
|
|
if (currentSyncItem.LstSyncPramas != null) |
|
|
|
dgvMapping.DataSource = new BindingList<SyncParamasInfo>(currentSyncItem.LstSyncPramas); |
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo.ServerName != "") |
|
|
|
btnLoadDBData_Click(sender, e); |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -288,13 +291,17 @@ namespace CNAS_DBSync |
|
|
|
private void cbxInstrument_SelectedIndexChanged(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
if (cbxInstrument.Text == null) return; |
|
|
|
string strInstrumentCode = this.dgvInstrument.Rows[this.dgvInstrument.CurrentRow.Index].Cells[0].Value.ToString(); |
|
|
|
|
|
|
|
// 使用LINQ查找匹配的数据 |
|
|
|
SyncInstrumentItemInfo matchedInstrument = lstSyncInstrument.FirstOrDefault(x => x.Code == strInstrumentCode); |
|
|
|
|
|
|
|
InstrumentData instrumentData = InstrumentDataFact.CreateInstrumentDataSource(currentSyncItem.SyncInstrumentDSInfo, new object[] { "", "", "" }); |
|
|
|
|
|
|
|
DataTable dtTableType = null; |
|
|
|
string strTableName_Instru = cbxInstrument.Text.ToString(); |
|
|
|
|
|
|
|
switch (currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType) |
|
|
|
|
|
|
|
switch (matchedInstrument.SyncInstrumentDSInfo.InstrumentDataSourceType) |
|
|
|
{ |
|
|
|
case DataSourceType.MySQL: |
|
|
|
dtTableType = SelectTableType.MySqlsec(strTableName_Instru); |
|
|
@@ -315,6 +322,7 @@ namespace CNAS_DBSync |
|
|
|
dtTableType = SelectTableType.KingSql(strTableName_Instru); |
|
|
|
break; |
|
|
|
default: |
|
|
|
strTableName_Instru= matchedInstrument.SyncInstrumentDSInfo.InstrumentDataSourceType.ToString(); |
|
|
|
if (dictInstruTables.ContainsKey(strTableName_Instru)) |
|
|
|
{ |
|
|
|
dtTableType = dictInstruTables[strTableName_Instru]; |
|
|
@@ -657,7 +665,7 @@ namespace CNAS_DBSync |
|
|
|
SqlServerFormat = FileOperation.GetFormatConfigData<SqlServerFormatConfig>("SqlServerFormatConfig.xml"); |
|
|
|
OracleFormat = FileOperation.GetFormatConfigData<OracleFormatConfig>("OracleFormatConfig.xml"); |
|
|
|
NormalFileFormat = FileOperation.GetFormatConfigData<NormalFileFormatConfig>("NormalFileFormatConfig.xml"); |
|
|
|
|
|
|
|
|
|
|
|
switch (currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType) |
|
|
|
{ |
|
|
|
case DataSourceType.MySQL: |
|
|
@@ -729,9 +737,9 @@ namespace CNAS_DBSync |
|
|
|
dataTableStruct = SelectTableType.SqlserversecSD(sql, currentSyncItem); |
|
|
|
break; |
|
|
|
case DataSourceType.Kingbase: |
|
|
|
if(cbxInstrument.Text.Contains('.')) |
|
|
|
if (cbxInstrument.Text.Contains('.')) |
|
|
|
cbxInstrument.Text = cbxInstrument.Text.Split('.')[1]; |
|
|
|
|
|
|
|
|
|
|
|
dataTableStruct = SelectTableType.KingSql(sql); |
|
|
|
break; |
|
|
|
default: |
|
|
|