|
|
@@ -9,6 +9,7 @@ using System.Drawing; |
|
|
|
using System.IO; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Windows.Forms; |
|
|
|
using System.Xml.Linq; |
|
|
|
using System.Xml.Serialization; |
|
|
@@ -27,7 +28,7 @@ namespace CNAS_DBSync |
|
|
|
private string strMode = ""; |
|
|
|
private string strTableInfoMode = ""; //获取所有表信息的方式;0为自动获取,1为手动输入 |
|
|
|
|
|
|
|
public frmSyncParams(SyncInstrumentItemInfo syncInstrumentItem=null) |
|
|
|
public frmSyncParams(SyncInstrumentItemInfo syncInstrumentItem = null) |
|
|
|
{ |
|
|
|
InitializeComponent(); |
|
|
|
|
|
|
@@ -42,7 +43,7 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
dgvMapping.AutoGenerateColumns = false; |
|
|
|
dgvMapping.RowHeadersVisible = false; |
|
|
|
|
|
|
|
|
|
|
|
if (syncInstrumentItem != null) |
|
|
|
{ |
|
|
|
strMode = "Reference"; |
|
|
@@ -52,7 +53,7 @@ namespace CNAS_DBSync |
|
|
|
this.btnDel.Visible = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private void frmSyncParams_Load(object sender, EventArgs e) |
|
|
@@ -65,10 +66,10 @@ namespace CNAS_DBSync |
|
|
|
{ |
|
|
|
lstSyncInstrument = new List<SyncInstrumentItemInfo>() { syncInstrumentItem }; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//绑定数据源,填写相关内容 |
|
|
|
if(lstSyncInstrument.Count!=0) |
|
|
|
dgvInstrument.DataSource = new BindingList<SyncInstrumentItemInfo>(lstSyncInstrument); |
|
|
|
if (lstSyncInstrument.Count != 0) |
|
|
|
dgvInstrument.DataSource = new BindingList<SyncInstrumentItemInfo>(lstSyncInstrument); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -107,7 +108,7 @@ namespace CNAS_DBSync |
|
|
|
lstDB.Add(currentSyncItem); |
|
|
|
} |
|
|
|
//重新保存信息 |
|
|
|
bIfSaveSuccess=FileOperation.SaveLocalSyncInStrumentData(lstDB); |
|
|
|
bIfSaveSuccess = FileOperation.SaveLocalSyncInStrumentData(lstDB); |
|
|
|
//委托发送参数 |
|
|
|
this.ParamsChangedDelegate(syncInstrumentItem); |
|
|
|
} |
|
|
@@ -123,16 +124,16 @@ namespace CNAS_DBSync |
|
|
|
MessageBox.Show("关键字段不允许为空!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
bIfSaveSuccess =FileOperation.SaveLocalSyncInStrumentData(lstSyncInstrument); |
|
|
|
bIfSaveSuccess = FileOperation.SaveLocalSyncInStrumentData(lstSyncInstrument); |
|
|
|
} |
|
|
|
if(bIfSaveSuccess) |
|
|
|
if (bIfSaveSuccess) |
|
|
|
MessageBox.Show("保存成功!"); |
|
|
|
else |
|
|
|
MessageBox.Show("保存失败!"); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
MessageBox.Show("保存失败!错误信息为:"+ex.Message.ToString()); |
|
|
|
MessageBox.Show("保存失败!错误信息为:" + ex.Message.ToString()); |
|
|
|
AppLog.Error(ex.Message); |
|
|
|
} |
|
|
|
} |
|
|
@@ -142,7 +143,7 @@ namespace CNAS_DBSync |
|
|
|
foreach (var item in lstSyncInstrument) |
|
|
|
{ |
|
|
|
if (item.LstSyncPramas == null) continue; |
|
|
|
if (item.LstSyncPramas.Count <=0) continue; |
|
|
|
if (item.LstSyncPramas.Count <= 0) continue; |
|
|
|
if (item.LstSyncPramas.Where(s => s.IfDateField == true).Count() != 1) |
|
|
|
{ |
|
|
|
bIfHave = false; |
|
|
@@ -176,7 +177,7 @@ namespace CNAS_DBSync |
|
|
|
frmSystemSetting frmSetting = new frmSystemSetting(lstSyncInstrument); |
|
|
|
|
|
|
|
frmInstrumentCode frmCode = new frmInstrumentCode(lstSyncInstrument); |
|
|
|
frmSetting.InstrumentDelegate = delegate(SyncInstrumentItemInfo Instrumentitem) |
|
|
|
frmSetting.InstrumentDelegate = delegate (SyncInstrumentItemInfo Instrumentitem) |
|
|
|
{ |
|
|
|
lstSyncInstrument.Add(Instrumentitem); |
|
|
|
|
|
|
@@ -186,7 +187,7 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
dgvInstrument_SelectionChanged(null, null); |
|
|
|
}; |
|
|
|
frmSetting.ShowDialog(); |
|
|
|
frmSetting.ShowDialog(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -239,7 +240,7 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
private void dgvInstrument_SelectionChanged(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
if (dgvInstrument.Rows.Count <= 0|| dgvInstrument.Rows[dgvInstrument.CurrentRow.Index].Cells[0].Value == null) |
|
|
|
if (dgvInstrument.Rows.Count <= 0 || dgvInstrument.Rows[dgvInstrument.CurrentRow.Index].Cells[0].Value == null) |
|
|
|
{ |
|
|
|
currentSyncItem = new SyncInstrumentItemInfo(); |
|
|
|
return; |
|
|
@@ -263,20 +264,20 @@ namespace CNAS_DBSync |
|
|
|
else |
|
|
|
txtInstrumentColumn.Text = ""; |
|
|
|
|
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo != null&& currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType!=DataSourceType.None) |
|
|
|
{ |
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo != null && currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType != DataSourceType.None) |
|
|
|
{ |
|
|
|
dgvMapping.DataSource = new BindingList<SyncParamasInfo>(currentSyncItem.LstSyncPramas); |
|
|
|
if(currentSyncItem.SyncInstrumentDSInfo.ServerName!="") |
|
|
|
btnLoadDBData_Click(sender, e); |
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo.ServerName != "") |
|
|
|
btnLoadDBData_Click(sender, e); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
dgvMapping.DataSource = new BindingList<SyncParamasInfo>(); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
dgvMapping.DataSource =new BindingList<SyncParamasInfo>(); |
|
|
|
dgvMapping.DataSource = new BindingList<SyncParamasInfo>(); |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary> |
|
|
@@ -294,11 +295,29 @@ namespace CNAS_DBSync |
|
|
|
InstrumentData instrumentData = InstrumentDataFact.CreateInstrumentDataSource(currentSyncItem.SyncInstrumentDSInfo, new object[] { "", "", "" }); |
|
|
|
//dictInstruTables = instrumentData.GetInstrumentData(); |
|
|
|
//dictInstruTables = |
|
|
|
DataTable dtTableType = null; |
|
|
|
string strTableName_Instru = cbxInstrument.Text.ToString(); |
|
|
|
DataTable dtTableType = CnasDataOperationFact.CnasDataOperation().GetCNASTableTypeLenth(strTableName_Instru, currentSyncItem.SyncTargetDBInfo); |
|
|
|
|
|
|
|
//string strTableName_Instru = cbxInstrument.Text.ToString(); |
|
|
|
|
|
|
|
switch (currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType) |
|
|
|
{ |
|
|
|
case DataSourceType.MySQL: |
|
|
|
dtTableType = SelectTableType.MySqlsec(strTableName_Instru); |
|
|
|
break; |
|
|
|
case DataSourceType.Dm: |
|
|
|
dtTableType = SelectTableType.DmSql(strTableName_Instru); |
|
|
|
break; |
|
|
|
case DataSourceType.Oracle: |
|
|
|
dtTableType = SelectTableType.OrcSql(strTableName_Instru, currentSyncItem); |
|
|
|
break; |
|
|
|
case DataSourceType.PostgreSQL: |
|
|
|
dtTableType = SelectTableType.PostgreSql(strTableName_Instru); |
|
|
|
break; |
|
|
|
case DataSourceType.SQL: |
|
|
|
dtTableType = SelectTableType.Sqlserversec(strTableName_Instru, currentSyncItem); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
DataTable dtInstruShow = new DataTable(); |
|
|
|
dtInstruShow.Columns.Add("InstruFieldName"); |
|
|
|
dtInstruShow.Columns.Add("InstruDataType"); |
|
|
@@ -309,23 +328,7 @@ namespace CNAS_DBSync |
|
|
|
} |
|
|
|
|
|
|
|
dgvInstruDS.DataSource = dtInstruShow; |
|
|
|
//if (dictInstruTables.ContainsKey(strTableName_Instru)) |
|
|
|
//{ |
|
|
|
// DataTable dt = dictInstruTables[strTableName_Instru]; |
|
|
|
// if (dt != null) |
|
|
|
// { |
|
|
|
// DataTable 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}); |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// } |
|
|
|
//} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -339,26 +342,12 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
string strTableName_Cnas = cbxCnas.Text.ToString(); |
|
|
|
|
|
|
|
//if (currentSyncItem.CnasInstrumentColumn != null && currentSyncItem.CnasInstrumentColumn != "") |
|
|
|
//{ |
|
|
|
// DialogResult dr = MessageBox.Show("已存在配置完成的CNAS仪器对应列,切换表将导致该配置失效,是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1); |
|
|
|
// if (dr == DialogResult.No) |
|
|
|
// { |
|
|
|
// return; |
|
|
|
// } |
|
|
|
//} |
|
|
|
|
|
|
|
DataTable dtTableStruct = CnasDataOperationFact.CnasDataOperation().GetCNASTableTypeLenth(strTableName_Cnas, currentSyncItem.SyncTargetDBInfo); |
|
|
|
|
|
|
|
//从数据库中加载数据表结构 |
|
|
|
//DataTable dtTableStruct = CnasDataOperationFact.CnasDataOperation().GetCNASTablesStruct(strTableName_Cnas,currentSyncItem.SyncTargetDBInfo); |
|
|
|
if (dtTableStruct != null) |
|
|
|
{ |
|
|
|
|
|
|
|
//DataTable dtTableType = CnasDataOperationFact.CnasDataOperation().GetCNASTableTypeLenth(strTableName_Instru, currentSyncItem.SyncTargetDBInfo); |
|
|
|
|
|
|
|
//string strTableName_Instru = cbxInstrument.Text.ToString(); |
|
|
|
|
|
|
|
DataTable dtCnasShow = new DataTable(); |
|
|
|
dtCnasShow.Columns.Add("CnasFieldName"); |
|
|
|
dtCnasShow.Columns.Add("CnasDataType"); |
|
|
@@ -378,7 +367,7 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
if (dtTableStruct.Columns.Count > 0) |
|
|
|
{ |
|
|
|
if (!string.IsNullOrWhiteSpace(currentSyncItem.CnasInstrumentColumn)&&dtTableStruct.Columns.Contains(currentSyncItem.CnasInstrumentColumn)) |
|
|
|
if (!string.IsNullOrWhiteSpace(currentSyncItem.CnasInstrumentColumn) && dtTableStruct.Columns.Contains(currentSyncItem.CnasInstrumentColumn)) |
|
|
|
{ |
|
|
|
cbxCNASColumn.Text = this.txtInstrumentColumn.Text = currentSyncItem.CnasInstrumentColumn; |
|
|
|
} |
|
|
@@ -400,7 +389,7 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
SyncParamasInfo syncParamas = new SyncParamasInfo(); |
|
|
|
if (currentSyncItem.LstSyncPramas == null) currentSyncItem.LstSyncPramas = new List<SyncParamasInfo>(); |
|
|
|
|
|
|
|
|
|
|
|
if (dgvCnas.Rows[dgvCnas.CurrentCell.RowIndex].Cells[0].Value.ToString().ToUpper() == "ID") |
|
|
|
{ |
|
|
|
MessageBox.Show("该字段为CNAS数据库保留字段,不允许插入数据,请重新选择!"); |
|
|
@@ -440,9 +429,9 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
//绑定数据 |
|
|
|
currentSyncItem.LstSyncPramas.Add(syncParamas); |
|
|
|
dgvMapping.DataSource= new BindingList<SyncParamasInfo>(currentSyncItem.LstSyncPramas); |
|
|
|
dgvMapping.DataSource = new BindingList<SyncParamasInfo>(currentSyncItem.LstSyncPramas); |
|
|
|
//选中最后一行 |
|
|
|
dgvMapping.CurrentCell = dgvMapping.Rows[dgvMapping.Rows.Count-1].Cells[0]; |
|
|
|
dgvMapping.CurrentCell = dgvMapping.Rows[dgvMapping.Rows.Count - 1].Cells[0]; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
@@ -478,7 +467,7 @@ namespace CNAS_DBSync |
|
|
|
frmDatabaseParams frmDatabase = new frmDatabaseParams(currentSyncItem); |
|
|
|
frmDatabase.InstrumentDelegate = delegate (SyncInstrumentItemInfo Instrumentitem) |
|
|
|
{ |
|
|
|
this.currentSyncItem = Instrumentitem; |
|
|
|
this.currentSyncItem = Instrumentitem; |
|
|
|
}; |
|
|
|
frmDatabase.InstrumentItemData = delegate (Dictionary<string, DataTable> dict) |
|
|
|
{ |
|
|
@@ -487,14 +476,12 @@ namespace CNAS_DBSync |
|
|
|
frmDatabase.ShowDialog(); |
|
|
|
|
|
|
|
//加载数据 |
|
|
|
if ((currentSyncItem.SyncInstrumentDSInfo.Host!=null&& currentSyncItem.SyncInstrumentDSInfo.Host.Length>0) || (currentSyncItem.SyncInstrumentDSInfo.Path!=null&& currentSyncItem.SyncInstrumentDSInfo.Path.Length>0)) |
|
|
|
if ((currentSyncItem.SyncInstrumentDSInfo.Host != null && currentSyncItem.SyncInstrumentDSInfo.Host.Length > 0) || (currentSyncItem.SyncInstrumentDSInfo.Path != null && currentSyncItem.SyncInstrumentDSInfo.Path.Length > 0)) |
|
|
|
btnLoadDBData_Click(null, null); |
|
|
|
} |
|
|
|
|
|
|
|
private void btnLoadDBData_Click(object sender, EventArgs e) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string strInstrumentCode = this.dgvInstrument.Rows[this.dgvInstrument.CurrentRow.Index].Cells[0].Value.ToString(); |
|
|
|
|
|
|
|
strTableInfoMode = FileOperation.GetSystemFormatConfigData(strInstrumentCode).TableInfoMode; |
|
|
@@ -504,10 +491,10 @@ namespace CNAS_DBSync |
|
|
|
//cbxCnas.DropDownStyle = ComboBoxStyle.DropDown; |
|
|
|
} |
|
|
|
int iReturn = 0; |
|
|
|
if (strTableInfoMode=="0") |
|
|
|
iReturn=LoadSourceAndTargetData(true); |
|
|
|
if (strTableInfoMode == "0") |
|
|
|
iReturn = LoadSourceAndTargetData(true); |
|
|
|
else |
|
|
|
iReturn= LoadSourceAndTargetData(); |
|
|
|
iReturn = LoadSourceAndTargetData(); |
|
|
|
switch (iReturn) |
|
|
|
{ |
|
|
|
case -1: |
|
|
@@ -546,7 +533,7 @@ namespace CNAS_DBSync |
|
|
|
/// </summary> |
|
|
|
/// <param name="bIfLoading"></param> |
|
|
|
/// <returns></returns> |
|
|
|
public int LoadSourceAndTargetData(bool bIfLoading=false) |
|
|
|
public int LoadSourceAndTargetData(bool bIfLoading = false) |
|
|
|
{ |
|
|
|
//检查配置信息 |
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo == null) return -1; |
|
|
@@ -585,7 +572,7 @@ namespace CNAS_DBSync |
|
|
|
{ |
|
|
|
List<string> lstCnasTables = new List<string>(); |
|
|
|
foreach (DataRow dr in dtCNAS.Rows) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (dtCNAS.Columns.Contains("TABNAME")) |
|
|
|
lstCnasTables.Add(dr["TABNAME"].ToString()); |
|
|
|
else if (dtCNAS.Columns.Contains("table_name")) |
|
|
@@ -625,19 +612,63 @@ namespace CNAS_DBSync |
|
|
|
{ |
|
|
|
if (currentSyncItem.SyncInstrumentDSInfo == null) return -1; |
|
|
|
if (currentSyncItem.SyncTargetDBInfo == null) return -2; |
|
|
|
SqlServerFormatConfig SqlServerFormat = FileOperation.GetFormatConfigData<SqlServerFormatConfig>("SqlServerFormatConfig.xml"); |
|
|
|
|
|
|
|
string sql = SqlServerFormat.AutoSql.SqlServerViewSql; |
|
|
|
|
|
|
|
cbxInstrument.Text = ExtractTableNames(sql); |
|
|
|
if (cbxInstrument.Text == "") return -6; |
|
|
|
|
|
|
|
int returnValue = 1; |
|
|
|
|
|
|
|
//根据手动输入来源库的表名加载字段 |
|
|
|
InstrumentData instrumentData = InstrumentDataFact.CreateInstrumentDataSource(currentSyncItem.SyncInstrumentDSInfo, new object[] { cbxInstrument.Text, "", "" }); |
|
|
|
DataTable dataTableStruct = instrumentData.GetInstrumentDataStruct(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InstrumentData instrumentData = InstrumentDataFact.CreateInstrumentDataSource(currentSyncItem.SyncInstrumentDSInfo, new object[] { "", "", "" }); |
|
|
|
//dictInstruTables = instrumentData.GetInstrumentData(); |
|
|
|
//dictInstruTables = |
|
|
|
DataTable dataTableStruct = null; |
|
|
|
string strTableName_Instru = cbxInstrument.Text.ToString(); |
|
|
|
|
|
|
|
switch (currentSyncItem.SyncInstrumentDSInfo.InstrumentDataSourceType) |
|
|
|
{ |
|
|
|
case DataSourceType.MySQL: |
|
|
|
dataTableStruct = SelectTableType.MySqlsec(cbxInstrument.Text); |
|
|
|
break; |
|
|
|
case DataSourceType.Dm: |
|
|
|
dataTableStruct = SelectTableType.DmSql(cbxInstrument.Text); |
|
|
|
break; |
|
|
|
case DataSourceType.Oracle: |
|
|
|
dataTableStruct = SelectTableType.OrcSql(cbxInstrument.Text, currentSyncItem); |
|
|
|
break; |
|
|
|
case DataSourceType.PostgreSQL: |
|
|
|
dataTableStruct = SelectTableType.PostgreSql(cbxInstrument.Text); |
|
|
|
break; |
|
|
|
case DataSourceType.SQL: |
|
|
|
dataTableStruct = SelectTableType.Sqlserversec(cbxInstrument.Text, currentSyncItem); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
DataTable dtInstruShow = new DataTable(); |
|
|
|
dtInstruShow.Columns.Add("InstruFieldName"); |
|
|
|
dtInstruShow.Columns.Add("InstruDataType"); |
|
|
|
dtInstruShow.Columns.Add("remark"); |
|
|
|
if (dataTableStruct != null) |
|
|
|
{ |
|
|
|
for (int i = 0; i < dataTableStruct.Rows.Count; i++) |
|
|
|
{ |
|
|
|
dtInstruShow.Rows.Add(new object[] { dataTableStruct.Rows[i]["ColumnName"], dataTableStruct.Rows[i]["DataType"], dataTableStruct.Rows[i]["remark"] }); |
|
|
|
} |
|
|
|
} |
|
|
|
dgvInstruDS.DataSource = dtInstruShow; |
|
|
|
|
|
|
|
|
|
|
|
if (dataTableStruct != null && dataTableStruct.Columns.Count > 0) |
|
|
|
{ |
|
|
|
dictInstruTables.Clear(); |
|
|
|
dictInstruTables.Add(cbxInstrument.Text, dataTableStruct); |
|
|
|
cbxInstrument_SelectedIndexChanged(null, null); |
|
|
|
|
|
|
|
//return 1; |
|
|
|
} |
|
|
|
else |
|
|
@@ -676,6 +707,37 @@ namespace CNAS_DBSync |
|
|
|
return returnValue; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public string ExtractTableNames(string sql) |
|
|
|
{ |
|
|
|
// 预处理:去除注释、统一空格 |
|
|
|
sql = Regex.Replace(sql, @"(--.*)|(\/\*[\s\S]*?\*\/)", "", RegexOptions.Multiline); |
|
|
|
sql = Regex.Replace(sql, @"\s+", " "); |
|
|
|
|
|
|
|
// 定义匹配模式 |
|
|
|
var patterns = new Dictionary<string, string> |
|
|
|
{ |
|
|
|
{ "SELECT", @"(?:FROM|JOIN)\s+([\w\.]+)(?:\s+AS\s+\w+)?" }, |
|
|
|
{ "INSERT", @"INSERT\s+INTO\s+([\w\.]+)" }, |
|
|
|
{ "UPDATE", @"UPDATE\s+([\w\.]+)" }, |
|
|
|
{ "DELETE", @"DELETE\s+FROM\s+([\w\.]+)" } |
|
|
|
}; |
|
|
|
|
|
|
|
var tables = new HashSet<string>(); |
|
|
|
foreach (var pattern in patterns.Values) |
|
|
|
{ |
|
|
|
var matches = Regex.Matches(sql, pattern, RegexOptions.IgnoreCase); |
|
|
|
foreach (Match match in matches) |
|
|
|
{ |
|
|
|
if (match.Groups[1].Success) |
|
|
|
tables.Add(match.Groups[1].Value.Trim()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (tables.Count == 0) |
|
|
|
return ""; |
|
|
|
else |
|
|
|
return tables.ToList()[0]; |
|
|
|
} |
|
|
|
private void dgvMapping_CellValueChanged(object sender, DataGridViewCellEventArgs e) |
|
|
|
{ |
|
|
|
if (dgvMapping.CurrentCell == null) return; |
|
|
@@ -756,7 +818,7 @@ namespace CNAS_DBSync |
|
|
|
MessageBox.Show("请先指定至少一个映射字段。"); |
|
|
|
return; |
|
|
|
} |
|
|
|
frmSourceFilter frm = new frmSourceFilter(currentSyncItem,strTableInfoMode); |
|
|
|
frmSourceFilter frm = new frmSourceFilter(currentSyncItem, strTableInfoMode); |
|
|
|
frm.sourceDataFilterHandler = delegate (SourceDataFilter dataFilter) |
|
|
|
{ |
|
|
|
currentSyncItem.SourceFilter = dataFilter; |
|
|
@@ -805,7 +867,7 @@ namespace CNAS_DBSync |
|
|
|
cbxCNASColumn.Top = txtInstrumentColumn.Top; |
|
|
|
cbxCNASColumn.Height = txtInstrumentColumn.Height; |
|
|
|
cbxCNASColumn.Width = txtInstrumentColumn.Width; |
|
|
|
cbxCNASColumn.Location= txtInstrumentColumn.Location; |
|
|
|
cbxCNASColumn.Location = txtInstrumentColumn.Location; |
|
|
|
|
|
|
|
cbxCNASColumn.Visible = true; |
|
|
|
} |
|
|
@@ -850,7 +912,7 @@ namespace CNAS_DBSync |
|
|
|
|
|
|
|
private void tsmHelper_Click(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
string strHelpFilePath = FileHelper.getBasePath()+ @"\Helper.CHM"; |
|
|
|
string strHelpFilePath = FileHelper.getBasePath() + @"\Helper.CHM"; |
|
|
|
//Help.ShowHelp(null, strHelpFilePath, HelpNavigator.TopicId, "1"); |
|
|
|
//Help.ShowHelpIndex(this, strHelpFilePath); |
|
|
|
System.Diagnostics.Process.Start(strHelpFilePath); |
|
|
|