|
|
@@ -287,14 +287,10 @@ namespace CNAS_DBSync |
|
|
|
/// <param name="e"></param> |
|
|
|
private void cbxInstrument_SelectedIndexChanged(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (cbxInstrument.Text == null) return; |
|
|
|
|
|
|
|
InstrumentData instrumentData = InstrumentDataFact.CreateInstrumentDataSource(currentSyncItem.SyncInstrumentDSInfo, new object[] { "", "", "" }); |
|
|
|
//dictInstruTables = instrumentData.GetInstrumentData(); |
|
|
|
//dictInstruTables = |
|
|
|
|
|
|
|
DataTable dtTableType = null; |
|
|
|
string strTableName_Instru = cbxInstrument.Text.ToString(); |
|
|
|
|
|
|
@@ -604,6 +600,17 @@ namespace CNAS_DBSync |
|
|
|
return 1; |
|
|
|
} |
|
|
|
|
|
|
|
public AccessFormatConfig AccessFormat { get; set; } |
|
|
|
public ExcelFormatConfig ExcelFormat { get; set; } |
|
|
|
public FoxProFormatConfig FoxProFormat { get; set; } |
|
|
|
public SqliteFormatConfig SqliteFormat { get; set; } |
|
|
|
public SqlServerFormatConfig SqlServerFormat { get; set; } |
|
|
|
public OracleFormatConfig OracleFormat { get; set; } |
|
|
|
public MySqlFormatConfig MySqlFormat { get; set; } |
|
|
|
public NormalFileFormatConfig NormalFileFormat { get; set; } |
|
|
|
public PostgreSqlFormatConfig PostgreSqlFormat { get; set; } |
|
|
|
public KingbaseFormatConfig KingbaseFormat { get; set; } |
|
|
|
public DmFormatConfig DmFormat { get; set; } |
|
|
|
/// <summary> |
|
|
|
/// 手动输入表名时,获取该表的表信息 |
|
|
|
/// </summary> |
|
|
@@ -612,9 +619,42 @@ namespace CNAS_DBSync |
|
|
|
{ |
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo == null) return -1; |
|
|
|
if (currentSyncItem.SyncTargetDBInfo == null) return -2; |
|
|
|
SqlServerFormatConfig SqlServerFormat = FileOperation.GetFormatConfigData<SqlServerFormatConfig>("SqlServerFormatConfig.xml"); |
|
|
|
string sql = ""; |
|
|
|
ExcelFormat = FileOperation.GetFormatConfigData<ExcelFormatConfig>("ExcelFormatConfig.xml"); |
|
|
|
AccessFormat = FileOperation.GetFormatConfigData<AccessFormatConfig>("AccessFormatConfig.xml"); |
|
|
|
FoxProFormat = FileOperation.GetFormatConfigData<FoxProFormatConfig>("FoxProFormatConfig.xml"); |
|
|
|
SqliteFormat = FileOperation.GetFormatConfigData<SqliteFormatConfig>("SqliteFormatConfig.xml"); |
|
|
|
SqlServerFormat = FileOperation.GetFormatConfigData<SqlServerFormatConfig>("SqlServerFormatConfig.xml"); |
|
|
|
OracleFormat = FileOperation.GetFormatConfigData<OracleFormatConfig>("OracleFormatConfig.xml"); |
|
|
|
NormalFileFormat = FileOperation.GetFormatConfigData<NormalFileFormatConfig>("NormalFileFormatConfig.xml"); |
|
|
|
KingbaseFormat = FileOperation.GetFormatConfigData<KingbaseFormatConfig>("KingbaseFormatConfig.xml"); |
|
|
|
|
|
|
|
switch (currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType) |
|
|
|
{ |
|
|
|
case DataSourceType.MySQL: |
|
|
|
MySqlFormat = FileOperation.GetFormatConfigData<MySqlFormatConfig>("MySqlFormatConfig.xml"); |
|
|
|
sql = MySqlFormat.AutoSql.MySqlViewSql; |
|
|
|
break; |
|
|
|
case DataSourceType.Dm: |
|
|
|
DmFormat = FileOperation.GetFormatConfigData<DmFormatConfig>("DmFormatConfig.xml"); |
|
|
|
sql = DmFormat.AutoSql.DmViewSql; |
|
|
|
break; |
|
|
|
case DataSourceType.Oracle: |
|
|
|
OracleFormat = FileOperation.GetFormatConfigData<OracleFormatConfig>("OracleFormatConfig.xml"); |
|
|
|
sql = OracleFormat.AutoSql.OracleViewSql; |
|
|
|
break; |
|
|
|
case DataSourceType.PostgreSQL: |
|
|
|
PostgreSqlFormat = FileOperation.GetFormatConfigData<PostgreSqlFormatConfig>("PostgreSqlFormatConfig.xml"); |
|
|
|
sql = PostgreSqlFormat.AutoSql.PostgreSqlViewSql; |
|
|
|
break; |
|
|
|
case DataSourceType.SQL: |
|
|
|
SqlServerFormat = FileOperation.GetFormatConfigData<SqlServerFormatConfig>("SqlServerFormatConfig.xml"); |
|
|
|
sql = SqlServerFormat.AutoSql.SqlServerViewSql; |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
string sql = SqlServerFormat.AutoSql.SqlServerViewSql; |
|
|
|
|
|
|
|
cbxInstrument.Text = ExtractTableNames(sql); |
|
|
|
if (cbxInstrument.Text == "") return -6; |
|
|
|