|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057 |
- using CnasSynchronusClient;
- using CnasSynchrousModel;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Xml.Serialization;
-
- namespace CNAS_DBSync
- {
- public delegate void InstrumentItemDataHanlder(Dictionary<string,DataTable> dictInstrument);
-
- public partial class frmDatabaseParams : Form
- {
- public SyncInstrumentItemInfo syncInstrumentItem = new SyncInstrumentItemInfo(); //仪器信息项
- public Dictionary<string, DataTable> dictInstrument = new Dictionary<string, DataTable>();
- public InstumentCodeHanlder InstrumentDelegate; //传递仪器编码委托
- public InstrumentItemDataHanlder InstrumentItemData; //传递仪器项委托
- private string strReadExcelMode = ""; //读取Excel数据模式
- private string strReadFoxproMode = ""; //读取Foxpro数据模式
- private string strReadTxtMode = "";//读取Txt数据模式
- private string strReadSqliteMode = ""; //读取sqlite数据模式
- private string strReadAccessMode = ""; //读取Access数据模式
- public DataBaseInfo targetDataBaseInfo = new DataBaseInfo(); //数据库
-
- public SqlServerFormatConfig sqlServerFormat { get; set; }
-
- public frmDatabaseParams(SyncInstrumentItemInfo syncInstrumentItem)
- {
- InitializeComponent();
- this.syncInstrumentItem = syncInstrumentItem;
-
- //读取Excel和FoxPro的模式
- strReadExcelMode = FileOperation.GetFormatConfigData<ExcelFormatConfig>("ExcelFormatConfig.xml").ReadExcelFileMode;
- strReadFoxproMode = FileOperation.GetFormatConfigData<FoxProFormatConfig>("FoxProFormatConfig.xml").ReadFoxProFileMode;
- strReadTxtMode = FileOperation.GetFormatConfigData<NormalFileFormatConfig>("NormalFileFormatConfig.xml").ReadNormalFileMode;
- strReadSqliteMode = FileOperation.GetFormatConfigData<SqliteFormatConfig>("SqliteFormatConfig.xml").ReadSqliteFileMode;
- strReadAccessMode = FileOperation.GetFormatConfigData<AccessFormatConfig>("AccessFormatConfig.xml").ReadAccessFileMode;
-
- sqlServerFormat = FileOperation.GetFormatConfigData<SqlServerFormatConfig>("SqlServerFormatConfig.xml");
-
- if (GlobalCommonOperation.strStartWebApi == "1")
- {
- this.txtDBHost.Enabled = false;
- this.txtDBName.Enabled = false;
- this.txtDBUser.Enabled = false;
- this.txtDBPwd.Enabled = false;
- this.txtPort.Enabled = false;
- btnCNASTestLink.Enabled = false;
- }
- }
-
- private void frmDatabaseParams_Load(object sender, EventArgs e)
- {
- tabExcel.Text = strReadExcelMode == "0" ? "Excel(文件)" : "Excel(文件夹)";
- tabFoxPro.Text = strReadFoxproMode == "0" ? "Foxpro(文件)" : "Foxpro(文件夹)";
- tabTxt.Text = strReadTxtMode == "0" ? "TXT(文件)" : "TXT(文件夹)";
- tabSQLite.Text = strReadSqliteMode == "0" ? "Sqlite(文件)" : "Sqlite(文件夹)";
- tabAccess.Text = strReadAccessMode == "0" ? "Access(文件)" : "Access(文件夹)";
-
- //if(sqlServerFormat)
-
- if (syncInstrumentItem.SyncInstrumentDSInfo == null)
- syncInstrumentItem.SyncInstrumentDSInfo = new InstrumentDataSourceInfo();
-
- //如果有旧值,加载旧的值
- switch (syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType)
- {
- case DataSourceType.Excel:
- this.tabcDS.SelectedIndex = 0;
- this.txtInportExcel.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path;
-
- this.cbxExcelRemote.Checked= syncInstrumentItem.SyncInstrumentDSInfo.DsPathType == PathType.Local ? false : true;
- this.txtRemoteExcelUser.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser;
- this.txtRemoteExcelPwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd;
- break;
- case DataSourceType.FoxPro:
- this.tabcDS.SelectedIndex = 1;
- this.txtFoxProFolder.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path;
- this.txtFoxProUserId.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserId;
- this.txtFoxProPwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserPwd;
-
- this.cbxFoxProRemote.Checked = syncInstrumentItem.SyncInstrumentDSInfo.DsPathType == PathType.Local ? false : true;
- this.txtRemoteFoxProUserId.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser;
- this.txtRemoteFoxProPwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd;
- break;
- case DataSourceType.Access:
- this.tabcDS.SelectedIndex = 2;
- this.txtAccessPath.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path;
- this.txtAccessUser.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserId;
- this.txtAceessPwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserPwd;
-
- this.cbxAccessRemote.Checked = syncInstrumentItem.SyncInstrumentDSInfo.DsPathType == PathType.Local ? false : true;
- this.txtAccessRemoteUser.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser;
- this.txtAccessRemotePwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd;
- break;
- case DataSourceType.SQLLite:
- this.tabcDS.SelectedIndex = 3;
- this.txtSqlitePath.Text= syncInstrumentItem.SyncInstrumentDSInfo.Path;
- this.txtSqliteUser.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserId;
- this.txtSqlitePwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserPwd;
-
- this.cbxSqliteRemote.Checked = syncInstrumentItem.SyncInstrumentDSInfo.DsPathType == PathType.Local ? false : true;
- this.txtSqliteRemoteUser.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser;
- this.txtSqliteRemotePwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd;
- break;
- case DataSourceType.SQL:
- this.tabcDS.SelectedIndex = 4;
- this.txtSqlServerHost.Text = syncInstrumentItem.SyncInstrumentDSInfo.Host;
- this.txtSqlServerName.Text = syncInstrumentItem.SyncInstrumentDSInfo.ServerName;
- this.txtSqlServerUser.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserId;
- this.txtSqlServerPwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserPwd;
-
- //this.txtSqlServerConnect.Text = sqlServerFormat.SqlServerConnection;
- break;
- case DataSourceType.MySQL:
- this.tabcDS.SelectedIndex = 5;
- this.txtMySqlHost.Text= syncInstrumentItem.SyncInstrumentDSInfo.Host;
- this.txtMySqlServer.Text = syncInstrumentItem.SyncInstrumentDSInfo.ServerName;
- this.txtMySqlUser.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserId;
- this.txtMySqlPwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserPwd;
- this.txtMySqlPort.Text = syncInstrumentItem.SyncInstrumentDSInfo.Port ;
- break;
- case DataSourceType.Oracle:
- this.tabcDS.SelectedIndex = 6;
-
- this.txtOracleHost.Text = syncInstrumentItem.SyncInstrumentDSInfo.Host ;
- this.txtOracleSource.Text = syncInstrumentItem.SyncInstrumentDSInfo.ServerName;
- this.txtOracleUserId.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserId;
- this.txtOraclePwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.UserPwd;
- this.txtOraclePort.Text = syncInstrumentItem.SyncInstrumentDSInfo.Port;
- break;
- case DataSourceType.TXT:
- this.tabcDS.SelectedIndex = 7;
- this.txtInportTxt.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path;
-
- this.cbxRemoteTxt.Checked = syncInstrumentItem.SyncInstrumentDSInfo.DsPathType == PathType.Local ? false : true;
- this.txtRemoteTxtUserId.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser;
- this.txtRemoteTxtPwd.Text = syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd;
- break;
- default:
- break;
- }
-
- //加载旧的CNAS数据库信息
- if (syncInstrumentItem.SyncTargetDBInfo != null)
- {
- targetDataBaseInfo = syncInstrumentItem.SyncTargetDBInfo;
- }
- else
- syncInstrumentItem.SyncTargetDBInfo = new DataBaseInfo();
-
- this.txtDBHost.Text = targetDataBaseInfo.DBHost;
- this.txtDBName.Text = targetDataBaseInfo.DBName;
- this.txtDBUser.Text = targetDataBaseInfo.DBUser;
- this.txtDBPwd.Text = targetDataBaseInfo.DBPwd;
- this.txtPort.Text= targetDataBaseInfo.DBPort;
-
-
- }
-
- private void btnOK_Click(object sender, EventArgs e)
- {
- //点击确定按钮
- //InstrumentData instrumentData = null;
-
- switch (syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType)
- {
- case DataSourceType.Access:
- syncInstrumentItem.SyncInstrumentDSInfo.Path = this.txtAccessPath.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.Host = "";
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = this.txtAccessUser.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = this.txtAceessPwd.Text.Trim();
-
- syncInstrumentItem.SyncInstrumentDSInfo.DsPathType = this.cbxAccessRemote.Checked ? PathType.Remote : PathType.Local;
- syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser = this.txtAccessRemoteUser.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd = this.txtAccessRemotePwd.Text.Trim();
- break;
- case DataSourceType.SQLLite:
- syncInstrumentItem.SyncInstrumentDSInfo.Path = this.txtSqlitePath.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.Host = "";
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = this.txtSqliteUser.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = this.txtSqlitePwd.Text.Trim();
-
- syncInstrumentItem.SyncInstrumentDSInfo.DsPathType = this.cbxSqliteRemote.Checked ? PathType.Remote : PathType.Local;
- syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser = this.txtSqliteRemoteUser.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd = this.txtSqliteRemotePwd.Text.Trim();
- break;
- case DataSourceType.SQL:
- syncInstrumentItem.SyncInstrumentDSInfo.Host = this.txtSqlServerHost.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = this.txtSqlServerName.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = this.txtSqlServerUser.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = this.txtSqlServerPwd.Text.Trim();
- break;
- case DataSourceType.MySQL:
- syncInstrumentItem.SyncInstrumentDSInfo.Host = this.txtMySqlHost.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = this.txtMySqlServer.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = this.txtMySqlUser.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = this.txtMySqlPwd.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.Port = this.txtMySqlPort.Text.Trim();
- break;
- case DataSourceType.Oracle:
- syncInstrumentItem.SyncInstrumentDSInfo.Host = this.txtOracleHost.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = this.txtOracleSource.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = this.txtOracleUserId.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = this.txtOraclePwd.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.Port = this.txtOraclePort.Text.Trim();
- break;
- case DataSourceType.FoxPro:
- syncInstrumentItem.SyncInstrumentDSInfo.Path = this.txtFoxProFolder.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.Host = "";
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = this.txtFoxProUserId.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = this.txtFoxProPwd.Text.Trim();
-
- syncInstrumentItem.SyncInstrumentDSInfo.DsPathType = this.cbxFoxProRemote.Checked ? PathType.Remote : PathType.Local;
- syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser = this.txtRemoteFoxProUserId.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd = this.txtRemoteFoxProPwd.Text.Trim();
- break;
- case DataSourceType.TXT:
- syncInstrumentItem.SyncInstrumentDSInfo.Path = this.txtInportTxt.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.Host = "";
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = "";
-
- syncInstrumentItem.SyncInstrumentDSInfo.DsPathType = this.cbxRemoteTxt.Checked ? PathType.Remote : PathType.Local;
- syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser = this.txtRemoteTxtUserId.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd = this.txtRemoteTxtPwd.Text.Trim();
- break;
- case DataSourceType.Excel:
- default:
- syncInstrumentItem.SyncInstrumentDSInfo.Path = this.txtInportExcel.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.Host = "";
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = "";
-
- syncInstrumentItem.SyncInstrumentDSInfo.DsPathType = this.cbxExcelRemote.Checked ? PathType.Remote : PathType.Local;
- syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser = this.txtRemoteExcelUser.Text.Trim();
- syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd = this.txtRemoteExcelPwd.Text.Trim();
- break;
- }
- object[] obj = new object[] { "", "", "" };
- //instrumentData = InstrumentDataFact.CreateInstrumentDataSource(syncInstrumentItem.SyncInstrumentDSInfo, obj);
- //dictInstrument = instrumentData.GetInstrumentData();
-
- //目标库的信息
- if (GlobalCommonOperation.strStartWebApi != "1")
- {
- syncInstrumentItem.SyncTargetDBInfo.DBHost = this.txtDBHost.Text.Trim();
- syncInstrumentItem.SyncTargetDBInfo.DBName = this.txtDBName.Text.Trim();
- syncInstrumentItem.SyncTargetDBInfo.DBUser = this.txtDBUser.Text.Trim();
- syncInstrumentItem.SyncTargetDBInfo.DBPwd = this.txtDBPwd.Text.Trim();
- syncInstrumentItem.SyncTargetDBInfo.DBPort = this.txtPort.Text.Trim();
- }
- else
- syncInstrumentItem.SyncTargetDBInfo = targetDataBaseInfo;
-
- this.InstrumentDelegate(syncInstrumentItem);
- //this.InstrumentItemData(dictInstrument);
-
- this.Close();
- }
-
- private void btnOpenFileExcel_Click(object sender, EventArgs e)
- {
- if (syncInstrumentItem.Code == null) return;
-
- if (syncInstrumentItem.SyncInstrumentDSInfo == null)
- syncInstrumentItem.SyncInstrumentDSInfo = new InstrumentDataSourceInfo();
-
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.Excel;
-
- if (strReadExcelMode == "0")
- {
- OpenFileDialog openFile = new OpenFileDialog
- {
- Filter = "Excel(*.xlsx)|*.xlsx|Excel(*.xls)|*.xls",
- InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
- Multiselect = false
- };
-
- if (openFile.ShowDialog() == DialogResult.Cancel) return;
- this.txtInportExcel.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = openFile.FileName;
- string fileType = System.IO.Path.GetExtension(openFile.FileName);
- if (string.IsNullOrEmpty(fileType)) return;
- }
- else
- {
- FolderBrowserDialog dialog = new FolderBrowserDialog();
- dialog.Description = "请选择文件路径";
-
- if (dialog.ShowDialog() == DialogResult.Cancel) return;
- this.txtInportExcel.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = dialog.SelectedPath;
- }
- }
-
- private void tabcDS_Selected(object sender, TabControlEventArgs e)
- {
- //切换的时候,检查其他类型数据源是否有值,如果有值,将提示删除旧值才能配置新值
- if (e.TabPage == tabExcel)
- {
- //检查tabAccess页面是否为空 //检查tabSQLite页面是否为空
- if (!CheckAccessControl() || !CheckSQLiteControl()|| !CheckSQLServerControl()||!CheckMySqlControl() || !CheckOracleControl()||!CheckFoxproControl()||!CheckTxtControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearAccessControl();
- ClearSqliteControl();
- ClearSQLServerControl();
- ClearMySQLControl();
- ClearOracleControl();
- ClearFoxproControl();
- ClearTxtControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.Excel;
- }
- if (e.TabPage == tabAccess)
- {
- //检查tabAccess页面是否为空 //检查tabSQLite页面是否为空
- if (!CheckExcelControl() || !CheckSQLiteControl() || !CheckSQLServerControl() || !CheckMySqlControl() || !CheckOracleControl() || !CheckFoxproControl() || !CheckTxtControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearExcelControl();
- ClearSqliteControl();
- ClearSQLServerControl();
- ClearMySQLControl();
- ClearOracleControl();
- ClearFoxproControl();
- ClearTxtControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.Access;
- }
- if (e.TabPage == tabSQLite)
- {
- //检查tabAccess页面是否为空 //检查tabSQLite页面是否为空
- if (!CheckExcelControl() || !CheckAccessControl() || !CheckSQLServerControl() || !CheckMySqlControl() || !CheckOracleControl() || !CheckFoxproControl() || !CheckTxtControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearAccessControl();
- ClearExcelControl();
- ClearSQLServerControl();
- ClearMySQLControl();
- ClearOracleControl();
- ClearFoxproControl();
- ClearTxtControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.SQLLite;
- }
- if (e.TabPage == tabSQLServer)
- {
- //检查tabAccess页面是否为空 //检查tabSQLite页面是否为空
- if (!CheckExcelControl() || !CheckAccessControl() || !CheckSQLiteControl() || !CheckMySqlControl() || !CheckOracleControl() || !CheckFoxproControl() || !CheckTxtControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearAccessControl();
- ClearExcelControl();
- ClearSqliteControl();
- ClearMySQLControl();
- ClearOracleControl();
- ClearFoxproControl();
- ClearTxtControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.SQL;
- }
- if (e.TabPage == tabMySql)
- {
- //检查tabAccess页面是否为空 //检查tabSQLite页面是否为空
- if (!CheckExcelControl() || !CheckAccessControl() || !CheckSQLiteControl() || !CheckSQLServerControl()||!CheckOracleControl() || !CheckFoxproControl() || !CheckTxtControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearAccessControl();
- ClearExcelControl();
- ClearSqliteControl();
- ClearSQLServerControl();
- ClearOracleControl();
- ClearFoxproControl();
- ClearTxtControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.MySQL;
- }
- if (e.TabPage == tabOracle)
- {
- //检查tabAccess页面是否为空 //检查tabSQLite页面是否为空
- if (!CheckExcelControl() || !CheckAccessControl() || !CheckSQLiteControl() || !CheckSQLServerControl()||!CheckMySqlControl() || !CheckFoxproControl() || !CheckTxtControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearAccessControl();
- ClearExcelControl();
- ClearSqliteControl();
- ClearSQLServerControl();
- ClearMySQLControl();
- ClearFoxproControl();
- ClearTxtControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.Oracle;
- }
- if (e.TabPage == tabFoxPro)
- {
- if (!CheckExcelControl() || !CheckAccessControl() || !CheckSQLiteControl() || !CheckSQLServerControl() || !CheckMySqlControl() || !CheckOracleControl() || !CheckTxtControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearAccessControl();
- ClearExcelControl();
- ClearSqliteControl();
- ClearSQLServerControl();
- ClearMySQLControl();
- ClearOracleControl();
- ClearTxtControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.FoxPro;
- }
- if (e.TabPage == tabTxt)
- {
- if (!CheckExcelControl() || !CheckAccessControl() || !CheckSQLiteControl() || !CheckSQLServerControl() || !CheckMySqlControl() || !CheckOracleControl() || !CheckFoxproControl())
- {
- if (MessageBox.Show("其他数据源存在已保存数据,继续将删除这些值,是否继续", "提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
- {
- ClearAccessControl();
- ClearExcelControl();
- ClearSqliteControl();
- ClearSQLServerControl();
- ClearMySQLControl();
- ClearOracleControl();
- ClearFoxproControl();
-
- ClearObjectValue();
- }
- else
- {
- ChangeSelectTabPageByType();
- return;
- }
- }
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.TXT;
- }
- }
-
- //根据数据源类型切换Tab页
- private void ChangeSelectTabPageByType()
- {
- switch (syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType)
- {
- case DataSourceType.SQLLite:
- tabcDS.SelectedTab = tabSQLite;
- break;
- case DataSourceType.Access:
- tabcDS.SelectedTab = tabAccess;
- break;
- case DataSourceType.SQL:
- tabcDS.SelectedTab = tabSQLServer;
- break;
- case DataSourceType.Oracle:
- tabcDS.SelectedTab=tabOracle;
- break;
- case DataSourceType.FoxPro:
- tabcDS.SelectedTab = tabFoxPro;
- break;
- case DataSourceType.TXT:
- tabcDS.SelectedTab = tabTxt;
- break;
- case DataSourceType.Excel:
- default:
- tabcDS.SelectedTab = tabExcel;
- break;
- }
- }
-
-
- private bool CheckExcelControl()
- {
- if (this.txtInportExcel.Text != "")
- return false;
- else
- return true;
- }
-
- private bool CheckAccessControl()
- {
- if (this.txtAccessPath.Text != "" || this.txtAccessUser.Text != "" || this.txtAceessPwd.Text != "")
- return false;
- else
- return true;
- }
-
- private bool CheckSQLiteControl()
- {
- if (this.txtSqlitePath.Text != "" || this.txtSqliteUser.Text != "" || this.txtSqlitePwd.Text != "")
- return false;
- else
- return true;
- }
- private bool CheckSQLServerControl()
- {
- if (this.txtSqlServerHost.Text.Trim() != "" || this.txtSqlServerName.Text.Trim() != "" || this.txtSqlServerPwd.Text.Trim() != "" || this.txtSqlServerUser.Text.Trim() != "")
- return false;
- else
- return true;
- }
-
- private bool CheckMySqlControl()
- {
- if (this.txtMySqlHost.Text.Trim() != "" || this.txtMySqlServer.Text.Trim() != "" || this.txtMySqlUser.Text.Trim() != "" || this.txtMySqlPwd.Text.Trim() != ""|| this.txtMySqlPort.Text.Trim()!="")
- return false;
- else
- return true;
- }
-
- private bool CheckOracleControl()
- {
- if (this.txtOraclePort.Text.Trim() != "" || this.txtOraclePwd.Text.Trim() != ""||this.txtOracleHost.Text.Trim()!="" || this.txtOracleSource.Text.Trim() != "" || this.txtOracleUserId.Text.Trim() != "")
- return false;
- else
- return true;
- }
-
- private bool CheckFoxproControl()
- {
- if (this.txtFoxProFolder.Text.Trim() != "" || this.txtFoxProUserId.Text.Trim() != "" || this.txtFoxProPwd.Text.Trim() != "" || this.txtRemoteFoxProUserId.Text.Trim() != "" || this.txtRemoteFoxProPwd.Text.Trim() != "")
- {
- return false;
- }
- else
- return true;
- }
-
- private bool CheckTxtControl()
- {
- if (this.txtInportTxt.Text.Trim() != "" || this.txtRemoteTxtUserId.Text.Trim() != "" || this.txtRemoteTxtPwd.Text.Trim() != "")
- return false;
- else
- return true;
- }
-
- private void btnCNASTestLink_Click(object sender, EventArgs e)
- {
- //this.txtDBHost.Text.Trim(), this.txtDBName.Text.Trim(), this.txtDBUser.Text.Trim(), this.txtDBPwd.Text.Trim(),this.txtPort.Text.Trim()
- if (CnasDataOperationFact.CnasDataOperation().TestConnect(new DataBaseInfo()
- {
- DBHost= this.txtDBHost.Text.Trim(),
- DBName= this.txtDBName.Text.Trim(),
- DBUser= this.txtDBUser.Text.Trim(),
- DBPwd= this.txtDBPwd.Text.Trim(),
- DBPort= this.txtPort.Text.Trim()
- }))
- MessageBox.Show("连接成功!");
- else
- MessageBox.Show("连接失败!");
- }
-
- private void ClearExcelControl()
- {
- this.txtInportExcel.Text = "";
- this.txtRemoteExcelUser.Text = "";
- this.txtRemoteExcelPwd.Text = "";
- }
-
- private void ClearAccessControl()
- {
- this.txtAccessPath.Text = "";
- this.txtAccessUser.Text = "";
- this.txtAceessPwd.Text = "";
- this.txtAccessRemoteUser.Text = "";
- this.txtAccessRemotePwd.Text = "";
- }
-
- private void ClearSqliteControl()
- {
- this.txtSqliteUser.Text = "";
- this.txtSqlitePath.Text = "";
- this.txtSqlitePwd.Text = "";
- this.txtSqliteRemoteUser.Text = "";
- this.txtSqliteRemotePwd.Text = "";
- }
-
- private void ClearSQLServerControl()
- {
- this.txtSqlServerHost.Text = "";
- this.txtSqlServerName.Text = "";
- this.txtSqlServerUser.Text = "";
- this.txtSqlServerPwd.Text = "";
- }
-
- private void ClearMySQLControl()
- {
- this.txtMySqlHost.Text = "";
- this.txtMySqlServer.Text = "";
- this.txtMySqlUser.Text = "";
- this.txtMySqlPwd.Text = "";
- this.txtMySqlPort.Text = "";
- }
-
- private void ClearOracleControl()
- {
- this.txtOracleHost.Text = "";
- this.txtOracleSource.Text = "";
- this.txtOracleUserId.Text = "";
- this.txtOraclePwd.Text = "";
- this.txtOraclePort.Text = "";
- }
-
- private void ClearFoxproControl()
- {
- this.txtFoxProFolder.Text = "";
- this.txtFoxProUserId.Text = "";
- this.txtFoxProPwd.Text = "";
- this.txtRemoteFoxProUserId.Text = "";
- this.txtRemoteFoxProPwd.Text = "";
- }
-
- private void ClearTxtControl()
- {
- this.txtInportTxt.Text = "";
- this.txtRemoteTxtUserId.Text = "";
- this.txtRemoteTxtPwd.Text = "";
- }
- /// <summary>
- /// 清空对象中存储的值
- /// </summary>
- private void ClearObjectValue()
- {
- syncInstrumentItem.SyncInstrumentDSInfo.Host = "";
- syncInstrumentItem.SyncInstrumentDSInfo.ServerName = "";
- syncInstrumentItem.SyncInstrumentDSInfo.Path = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserId = "";
- syncInstrumentItem.SyncInstrumentDSInfo.UserPwd = "";
- syncInstrumentItem.SyncInstrumentDSInfo.Port = "";
-
- syncInstrumentItem.SyncInstrumentDSInfo.DsPathType = PathType.Local;
- syncInstrumentItem.SyncInstrumentDSInfo.RemoteUser = "";
- syncInstrumentItem.SyncInstrumentDSInfo.RemotePwd = "";
- }
-
- private void btnOpenFileAccess_Click(object sender, EventArgs e)
- {
- if (syncInstrumentItem.Code == null) return;
-
- if (syncInstrumentItem.SyncInstrumentDSInfo == null)
- syncInstrumentItem.SyncInstrumentDSInfo = new InstrumentDataSourceInfo();
-
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.Access;
-
- if (strReadAccessMode == "0")
- {
- OpenFileDialog openFile = new OpenFileDialog
- {
- Filter = "Microsoft Access(*.mdb)|*.mdb|Microsoft Access(*.accdb)|*.accdb",
- InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
- Multiselect = false
- };
-
- if (openFile.ShowDialog() == DialogResult.Cancel) return;
- this.txtAccessPath.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = openFile.FileName;
- string fileType = System.IO.Path.GetExtension(openFile.FileName);
- if (string.IsNullOrEmpty(fileType)) return;
- }
- else
- {
- FolderBrowserDialog dialog = new FolderBrowserDialog();
- dialog.Description = "请选择文件路径";
-
- if (dialog.ShowDialog() == DialogResult.Cancel) return;
- this.txtAccessPath.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = dialog.SelectedPath;
- }
- }
-
- private void btnOpenFileSQLite_Click(object sender, EventArgs e)
- {
- if (syncInstrumentItem.Code == null) return;
-
- if (syncInstrumentItem.SyncInstrumentDSInfo == null)
- syncInstrumentItem.SyncInstrumentDSInfo = new InstrumentDataSourceInfo();
-
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.SQLLite;
-
- if (strReadSqliteMode == "0")
- {
- OpenFileDialog openFile = new OpenFileDialog
- {
- Filter = "SQLite(*.db)|*.db",
- InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
- Multiselect = false
- };
-
- if (openFile.ShowDialog() == DialogResult.Cancel) return;
- this.txtSqlitePath.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = openFile.FileName;
- string fileType = System.IO.Path.GetExtension(openFile.FileName);
- if (string.IsNullOrEmpty(fileType)) return;
- }
- else
- {
- FolderBrowserDialog dialog = new FolderBrowserDialog();
- dialog.Description = "请选择文件路径";
-
- if (dialog.ShowDialog() == DialogResult.Cancel) return;
- this.txtSqlitePath.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = dialog.SelectedPath;
- }
- }
-
- private void btnTestSQLLink_Click(object sender, EventArgs e)
- {
- if (this.txtSqlServerHost.Text.Trim() == "" || this.txtSqlServerName.Text.Trim() == "" || this.txtSqlServerUser.Text.Trim() == "")
- {
- MessageBox.Show("请填写相关连接信息。");
- return;
- }
-
- InstrumentDataSourceInfo dbinfo = new InstrumentDataSourceInfo();
- dbinfo.Host = this.txtSqlServerHost.Text.Trim();
- dbinfo.ServerName = this.txtSqlServerName.Text.Trim();
- dbinfo.UserId = this.txtSqlServerUser.Text.Trim();
- dbinfo.UserPwd = this.txtSqlServerPwd.Text.Trim();
- dbinfo.Port = this.txtSqlServerPort.Text.Trim();
- if (new SQLServerInstrumentData(dbinfo, new object[] {
- "",
- "",
- ""
- }).TestSQLServerLink())
- MessageBox.Show("连接成功!");
- else
- MessageBox.Show("连接失败!");
- }
-
- private void cbxExcelRemote_CheckedChanged(object sender, EventArgs e)
- {
- if (!cbxExcelRemote.Checked)
- {
- this.btnOpenFileExcel.Visible = true;
-
- lblExcelRemotePwd.Visible = false;
- lblExcelRemoteUser.Visible = false;
- txtRemoteExcelUser.Visible = false;
- txtRemoteExcelPwd.Visible = false;
- }
- else
- {
- this.btnOpenFileExcel.Visible = false;
-
- lblExcelRemotePwd.Visible = true;
- lblExcelRemoteUser.Visible = true;
- txtRemoteExcelUser.Visible = true;
- txtRemoteExcelPwd.Visible = true;
- }
- }
-
- private void cbxAccessRemote_CheckedChanged(object sender, EventArgs e)
- {
- if (cbxAccessRemote.Checked)
- {
- btnOpenFileAccess.Visible = false;
-
- lblAccessRemoteUser.Visible = true;
- lblAccessRemotePwd.Visible = true;
- txtAccessRemoteUser.Visible = true;
- txtAccessRemotePwd.Visible = true;
- }
- else
- {
- btnOpenFileAccess.Visible = true;
-
- lblAccessRemoteUser.Visible = false;
- lblAccessRemotePwd.Visible = false;
- txtAccessRemoteUser.Visible = false;
- txtAccessRemotePwd.Visible = false;
- }
- }
-
- private void cbxSqliteRemote_CheckedChanged(object sender, EventArgs e)
- {
- if (cbxSqliteRemote.Checked)
- {
- btnOpenFileSQLite.Visible = false;
-
- lblSqliteRemoteUser.Visible = true;
- lblSqliteRemotePwd.Visible = true;
- txtSqliteRemoteUser.Visible = true;
- txtSqliteRemotePwd.Visible = true;
- }
- else
- {
- btnOpenFileSQLite.Visible = true;
-
- lblSqliteRemoteUser.Visible = false;
- lblSqliteRemotePwd.Visible = false;
- txtSqliteRemoteUser.Visible = false;
- txtSqliteRemotePwd.Visible = false;
- }
- }
-
- private void btnMySqlTest_Click(object sender, EventArgs e)
- {
-
- if (CnasDataOperationFact.CnasDataOperation().TestConnect(new DataBaseInfo()
- {
- DBHost = this.txtMySqlHost.Text.Trim(),
- DBName = this.txtMySqlServer.Text.Trim(),
- DBUser = this.txtMySqlUser.Text.Trim(),
- DBPwd = this.txtMySqlPwd.Text.Trim(),
- DBPort = this.txtMySqlPort.Text.Trim()
- }))
- MessageBox.Show("连接成功!");
- else
- MessageBox.Show("连接失败!");
- }
-
- private void btnOracleTestLink_Click(object sender, EventArgs e)
- {
- if (this.txtOracleHost.Text.Trim()==""||this.txtOracleSource.Text.Trim() == "" || this.txtOracleUserId.Text.Trim() == ""|| this.txtOraclePort.Text.Trim() == "")
- {
- MessageBox.Show("请填写相关连接信息。");
- return;
- }
-
- InstrumentDataSourceInfo dbinfo = new InstrumentDataSourceInfo();
- dbinfo.Host = this.txtOracleHost.Text.Trim();
- dbinfo.ServerName = this.txtOracleSource.Text.Trim();
- dbinfo.UserId = this.txtOracleUserId.Text.Trim();
- dbinfo.UserPwd = this.txtOraclePwd.Text.Trim();
- dbinfo.Port = this.txtOraclePort.Text.Trim();
- if (new OracleInstrumentData(dbinfo, new object[] {
- "",
- "",
- ""
- }).TestSQLServerLink())
- MessageBox.Show("连接成功!");
- else
- MessageBox.Show("连接失败!");
- }
-
- private void txtFileOpenFoxPro_Click(object sender, EventArgs e)
- {
- if (syncInstrumentItem.Code == null) return;
-
- if (syncInstrumentItem.SyncInstrumentDSInfo == null)
- syncInstrumentItem.SyncInstrumentDSInfo = new InstrumentDataSourceInfo();
-
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.FoxPro;
-
- if (strReadFoxproMode == "0")
- {
- OpenFileDialog openFile = new OpenFileDialog
- {
- Filter = "Foxpro文件(*.dbf)|*.dbf",
- InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
- Multiselect = false
- };
-
- if (openFile.ShowDialog() == DialogResult.Cancel) return;
- this.txtFoxProFolder.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = openFile.FileName;
- string fileType = System.IO.Path.GetExtension(openFile.FileName);
- if (string.IsNullOrEmpty(fileType)) return;
- }
- else
- {
- FolderBrowserDialog dialog = new FolderBrowserDialog();
- dialog.Description = "请选择文件路径";
-
- if (dialog.ShowDialog() == DialogResult.Cancel) return;
- this.txtFoxProFolder.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = dialog.SelectedPath;
- }
- }
-
- private void cbxFoxProRemote_CheckedChanged(object sender, EventArgs e)
- {
- if (!cbxFoxProRemote.Checked)
- {
- this.btnFileOpenFoxPro.Visible = true;
-
- lblFoxproRemoteUserId.Visible = false;
- lblFoxproRemotePwd.Visible = false;
- txtRemoteFoxProUserId.Visible = false;
- txtRemoteFoxProPwd.Visible = false;
- }
- else
- {
- this.btnFileOpenFoxPro.Visible = false;
-
- lblFoxproRemoteUserId.Visible = true;
- lblFoxproRemotePwd.Visible = true;
- txtRemoteFoxProUserId.Visible = true;
- txtRemoteFoxProPwd.Visible = true;
- }
- }
-
- private void btnOpenFileTxt_Click(object sender, EventArgs e)
- {
- if (syncInstrumentItem.Code == null) return;
-
- if (syncInstrumentItem.SyncInstrumentDSInfo == null)
- syncInstrumentItem.SyncInstrumentDSInfo = new InstrumentDataSourceInfo();
-
- syncInstrumentItem.SyncInstrumentDSInfo.InstrumentDataSourceType = DataSourceType.TXT;
-
- if (strReadTxtMode == "0")
- {
- OpenFileDialog openFile = new OpenFileDialog
- {
- Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*",
- InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
- Multiselect = false
- };
-
- if (openFile.ShowDialog() == DialogResult.Cancel) return;
- this.txtInportTxt.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = openFile.FileName;
- string fileType = System.IO.Path.GetExtension(openFile.FileName);
- if (string.IsNullOrEmpty(fileType)) return;
- }
- else
- {
- FolderBrowserDialog dialog = new FolderBrowserDialog();
- dialog.Description = "请选择文件路径";
-
- if (dialog.ShowDialog() == DialogResult.Cancel) return;
- this.txtInportTxt.Text = syncInstrumentItem.SyncInstrumentDSInfo.Path = dialog.SelectedPath;
- }
- }
-
- private void cbxRemoteTxt_CheckedChanged(object sender, EventArgs e)
- {
- if (!cbxRemoteTxt.Checked)
- {
- this.btnOpenFileTxt.Visible = true;
-
- lblTxtRemoteUserId.Visible = false;
- lblTxtRemoteUserPwd.Visible = false;
- txtRemoteTxtUserId.Visible = false;
- txtRemoteTxtPwd.Visible = false;
- }
- else
- {
- this.btnOpenFileTxt.Visible = false;
-
- lblTxtRemoteUserId.Visible = true;
- lblTxtRemoteUserPwd.Visible = true;
- txtRemoteTxtUserId.Visible = true;
- txtRemoteTxtPwd.Visible = true;
- }
- }
-
- private void cbxTargetDBSelect_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (cbxTargetDBSelect.SelectedIndex == 0)
- {
- if (GlobalCommonOperation.strStartWebApi == "1")
- {
- targetDataBaseInfo = new DataBaseInfo() {
- DataBaseCode = "cnas"
- };
- }
- else
- {
- DataBaseInfo CNASDataBase = FileOperation.GetLocalCnasDB();
- if (CNASDataBase != null)
- {
- this.txtDBHost.Text = CNASDataBase.DBHost;
- this.txtDBName.Text = CNASDataBase.DBName;
- this.txtDBUser.Text = CNASDataBase.DBUser;
- this.txtDBPwd.Text = CNASDataBase.DBPwd;
- this.txtPort.Text = CNASDataBase.DBPort;
- }
- }
- }
- else if (cbxTargetDBSelect.SelectedIndex == 1)
- {
- if (GlobalCommonOperation.strStartWebApi == "1")
- {
- targetDataBaseInfo = new DataBaseInfo()
- {
- DataBaseCode = "platform"
- };
- }
- else
- {
- DataBaseInfo PlatDataBase = FileOperation.GetLocalPlatFormDB();
- if (PlatDataBase != null)
- {
- this.txtDBHost.Text = PlatDataBase.DBHost;
- this.txtDBName.Text = PlatDataBase.DBName;
- this.txtDBUser.Text = PlatDataBase.DBUser;
- this.txtDBPwd.Text = PlatDataBase.DBPwd;
- this.txtPort.Text = PlatDataBase.DBPort;
- }
- }
- }
- }
- }
- }
|