|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217 |
- using CnasSynchronusClient;
- using CnasSynchrousModel;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
-
- namespace CNAS_DBSync
- {
- public partial class frmSourceSetting : Form
- {
- 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; }
-
- //用来记录tablepage是否加载过,如果没有加载过,存储时不做处理
- private List<string> lstLoadingSource = new List<string>();
-
-
- public frmSourceSetting()
- {
- InitializeComponent();
- }
-
- private void frmSourceSetting_Load(object sender, EventArgs e)
- {
- //获取已经存储的数据,初始化各种类型的参数类
-
- 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");
- MySqlFormat = FileOperation.GetFormatConfigData<MySqlFormatConfig>("MySqlFormatConfig.xml");
- NormalFileFormat = FileOperation.GetFormatConfigData<NormalFileFormatConfig>("NormalFileFormatConfig.xml");
- PostgreSqlFormat = FileOperation.GetFormatConfigData<PostgreSqlFormatConfig>("PostgreSqlFormatConfig.xml");
- KingbaseFormat = FileOperation.GetFormatConfigData<KingbaseFormatConfig>("KingbaseFormatConfig.xml");
- DmFormat = FileOperation.GetFormatConfigData<DmFormatConfig>("DmFormatConfig.xml");
-
- //默认加载第一个tablepage
- LoadExcelControlData();
- }
-
- private void tabcDS_Selected(object sender, TabControlEventArgs e)
- {
- switch (e.TabPageIndex)
- {
- case 0:
- //切换到Excel时的操作
- LoadExcelControlData();
- break;
- case 1:
- //切换到FoxPro时的操作
- LoadFoxProControlData();
- break;
- case 2:
- //切换到Access时的操作
- LoadAccessControlData();
- break;
- case 3:
- //切换到Sqlite时的操作
- LoadSqliteControlData();
- break;
- case 4:
- //切换到SQLServer时的操作
- LoadSqlServerData();
- break;
- case 5:
- //切换到MySQL时的操作
- LoadMySqlControlData();
- break;
- case 6:
- //切换到Oracle时的操作
- LoadOracleControlData();
- break;
- case 7:
- //切换到Txt时的操作
- LoadNormalFileControlData();
- break;
- case 8:
- //切换到PostgreSQL时的操作
- LoadPostgreSqlControlData();
- break;
- case 9:
- //切换到Kingbase时的操作
- LoadKingbaseControlData();
- break;
- case 10:
- //切换到Dm时的操作
- LoadDmControlData();
- break;
- }
- }
-
- private void LoadNormalFileControlData()
- {
- this.cbxNormalFileReadFile.Checked = NormalFileFormat.ReadNormalFileMode == "0" ? true : false;
- this.cbxNormalFileReadFolder.Checked = !this.cbxNormalFileReadFile.Checked;
-
- this.txtNormalFileSpecialDateColumnFormat.Text = NormalFileFormat.NormalFileDateColumnFormat ?? "";
- this.txtNormalFileNameFormat.Text = NormalFileFormat.NormalFileNameFormat ?? "";
-
- this.txtNormalFileReadDataMode.Text = NormalFileFormat.NormalFileDataMode ?? "";
- this.txtNormalFileSuffix.Text = NormalFileFormat.NormalFileSuffix ?? "";
-
- this.txtNormalFileReadSplitMode.Text = NormalFileFormat.NormalFileSplitType ?? "";
-
- //显示数字
- int showValue = 1;
- if (NormalFileFormat.NormalFileStartLineIndex != null)
- {
- Int32.TryParse(NormalFileFormat.NormalFileStartLineIndex, out showValue);
- }
- this.numNormalFileStartIndex.Value = showValue;
-
- this.cbxNormalFileCustomDate.Checked = NormalFileFormat.IfCustomCreateDateColumn == "0" ? true : false;
- this.cbxNormalFileNoCustomDate.Checked = !this.cbxNormalFileCustomDate.Checked;
-
- DefaultTextBoxShowLeaveValue(txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible);
- DefaultTextBoxShowLeaveValue(txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible);
- DefaultTextBoxShowLeaveValue(txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible);
-
- if (!lstLoadingSource.Contains("NormalFileFormat")) lstLoadingSource.Add("NormalFileFormat");
- }
-
- private void LoadOracleControlData()
- {
- this.txtOracleSpecialDateColumnFormat.Text = OracleFormat.OracleFileDateColumnFormat ?? "";
-
- this.txtOracleAutoSqlName.Text = OracleFormat.AutoSql != null ? OracleFormat.AutoSql.OracleViewName : "";
- this.txtOracleAutoSql.Text = OracleFormat.AutoSql != null ? OracleFormat.AutoSql.OracleViewSql : "";
-
- DefaultTextBoxShowLeaveValue(txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("OracleFormat")) lstLoadingSource.Add("OracleFormat");
- }
-
- private void LoadMySqlControlData()
- {
- this.txtMySqlSpecialDateColumnFormat.Text = MySqlFormat.MySqlFileDateColumnFormat ?? "";
-
- this.txtMySqlAutoSqlName.Text = MySqlFormat.AutoSql != null ? MySqlFormat.AutoSql.MySqlViewName : "";
- this.txtMySqlAutoSql.Text = MySqlFormat.AutoSql != null ? MySqlFormat.AutoSql.MySqlViewSql : "";
-
- DefaultTextBoxShowLeaveValue(txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("MySqlFormat")) lstLoadingSource.Add("MySqlFormat");
- }
-
- private void LoadSqlServerData()
- {
- this.txtSqlServerSpecialDateColumnFormat.Text = SqlServerFormat.SqlServerFileDateColumnFormat ??"";
- this.txtSqlServerConnection.Text = SqlServerFormat.SqlServerConnection ?? "";
-
- this.txtSqlServerAutoSqlName.Text = SqlServerFormat.AutoSql != null ? SqlServerFormat.AutoSql.SqlServerViewName : "";
- this.txtSqlServerAutoSql.Text = SqlServerFormat.AutoSql != null ? SqlServerFormat.AutoSql.SqlServerViewSql : "";
-
- DefaultTextBoxShowLeaveValue(txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible);
- DefaultTextBoxShowLeaveValue(txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("SqlServerFormat")) lstLoadingSource.Add("SqlServerFormat");
- }
-
- private void LoadSqliteControlData()
- {
- this.cbxSqliteReadFile.Checked = SqliteFormat.ReadSqliteFileMode == "0" ? true : false;
- this.cbxSqliteReadFolder.Checked = !this.cbxSqliteReadFile.Checked;
-
- this.txtSqliteSpecialDateColumnFormat.Text = SqliteFormat.SqliteFileDateColumnFormat ?? "";
- this.txtSqliteFileNameFormat.Text = SqliteFormat.SqliteFileNameFormat ?? "";
-
- this.txtSqliteAutoSqlName.Text = SqliteFormat.AutoSql != null ? SqliteFormat.AutoSql.SqliteViewName : "";
- this.txtSqliteAutoSql.Text = SqliteFormat.AutoSql != null ? SqliteFormat.AutoSql.SqliteViewSql : "";
-
- DefaultTextBoxShowLeaveValue(txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("SqliteFormat")) lstLoadingSource.Add("SqliteFormat");
- }
-
- private void LoadAccessControlData()
- {
- this.cbxAccessOldVersion.Checked = AccessFormat.AccessFileVersion == "0" ? true : false;
- this.cbxAccessNewVersion.Checked = !this.cbxAccessOldVersion.Checked;
-
- this.txtAccessSuffix.Text = this.AccessFormat.AccessSuffix ?? "";
- this.txtAccessSpecialDateColumnFormat.Text = this.AccessFormat.AccessFileDateColumnFormat ?? "";
- this.txtAccessFileName.Text = this.AccessFormat.AccessFileNameFormat ?? "";
-
- this.cbxAccessReadFile.Checked=AccessFormat.ReadAccessFileMode=="0"?true:false;
- this.cbxAccessReadFolder.Checked = !cbxAccessReadFile.Checked;
-
- this.txtAccessAutoSqlName.Text = AccessFormat.AutoSql != null ? AccessFormat.AutoSql.AccessViewName : "";
- this.txtAccessAutoSql.Text = AccessFormat.AutoSql != null ? AccessFormat.AutoSql.AccessViewSql : "";
-
- DefaultTextBoxShowLeaveValue(txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible);
- DefaultTextBoxShowLeaveValue(txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible);
- DefaultTextBoxShowLeaveValue(txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("AccessFormat")) lstLoadingSource.Add("AccessFormat");
- }
-
- private void LoadFoxProControlData()
- {
- this.cbxFoxProReadFile.Checked = FoxProFormat.ReadFoxProFileMode == "0" ? true : false;
- this.cbxFoxProReadFolder.Checked = !cbxFoxProReadFile.Checked;
-
- this.txtFoxProSpecialDateColumnFormat.Text = FoxProFormat.FoxProFileDateColumnFormat ?? "";
- this.txtFoxProFileNameFormat.Text = FoxProFormat.FoxProFileNameFormat ?? "";
-
- this.txtFoxProAutoSqlName.Text = FoxProFormat.AutoSql != null ? FoxProFormat.AutoSql.FoxProViewName : "";
- this.txtFoxProAutoSql.Text = FoxProFormat.AutoSql != null ? FoxProFormat.AutoSql.FoxProViewSql : "";
-
- this.txtFoxProSpecialMethodName.Text = FoxProFormat.SpecialDtOpera != null ? FoxProFormat.SpecialDtOpera.Method : "";
- this.txtFoxProSpecialMethod.Text= FoxProFormat.SpecialDtOpera != null ? FoxProFormat.SpecialDtOpera.Value : "";
-
- DefaultTextBoxShowLeaveValue(txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible);
- DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible);
- DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible);
-
- if (!lstLoadingSource.Contains("FoxProFormat")) lstLoadingSource.Add("FoxProFormat");
- }
-
- private void LoadExcelControlData()
- {
- this.cbxExcelOldVersion.Checked = ExcelFormat.ExcelFileVersion == "0" ? true : false;
- this.cbxExcelNewVersion.Checked = !cbxExcelOldVersion.Checked;
-
- this.txtExcelSpecialDateColumnFormat.Text = ExcelFormat.ExcelFileDateColumnFormat ?? "";
- this.txtExcelFileNameFormat.Text = ExcelFormat.ExcelFileNameFormat ?? "";
-
- this.cbxExcelReadFile.Checked = ExcelFormat.ReadExcelFileMode == "0" ? true : false;
- this.cbxExcelReadFolder.Checked = !cbxExcelReadFile.Checked;
-
- this.txtExcelAutoSqlName.Text = ExcelFormat.AutoSql != null ? ExcelFormat.AutoSql.ExcelViewName:"";
- this.txtExcelAutoSql.Text= ExcelFormat.AutoSql != null ? ExcelFormat.AutoSql.ExcelViewSql : "";
-
- DefaultTextBoxShowLeaveValue(txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("ExcelFormat")) lstLoadingSource.Add("ExcelFormat");
- }
-
- private void LoadPostgreSqlControlData()
- {
- this.txtPostgreSqlSpecialDateColumnFormat.Text = PostgreSqlFormat.PostgreSqlFileDateColumnFormat ?? "";
- this.txtPostgreSqlAutoSqlName.Text = PostgreSqlFormat.AutoSql != null ? PostgreSqlFormat.AutoSql.PostgreSqlViewName : "";
- this.txtPostgreSqlAutoSql.Text = PostgreSqlFormat.AutoSql != null ? PostgreSqlFormat.AutoSql.PostgreSqlViewSql : "";
-
- DefaultTextBoxShowLeaveValue(txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("PostgreSqlFormat")) lstLoadingSource.Add("PostgreSqlFormat");
- }
-
- private void LoadKingbaseControlData()
- {
- if(KingbaseFormat!=null)
- {
- this.txtKingbaseSpecialDateColumnFormat.Text = KingbaseFormat.KingbaseFileDateColumnFormat ?? "";
- this.txtKingbaseAutoSqlName.Text = KingbaseFormat.AutoSql != null ? KingbaseFormat.AutoSql.KingbaseViewName : "";
- this.txtKingbaseAutoSql.Text = KingbaseFormat.AutoSql != null ? KingbaseFormat.AutoSql.KingbaseViewSql : "";
- }
-
- DefaultTextBoxShowLeaveValue(txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("KingbaseFormat")) lstLoadingSource.Add("KingbaseFormat");
- }
-
- private void LoadDmControlData()
- {
- if(DmFormat != null)
- {
- this.txtDmSpecialDateColumnFormat.Text = DmFormat.DmFileDateColumnFormat ?? "";
- this.txtDmAutoSqlName.Text = DmFormat.AutoSql != null ? DmFormat.AutoSql.DmViewName : "";
- this.txtDmAutoSql.Text = DmFormat.AutoSql != null ? DmFormat.AutoSql.DmViewSql : "";
- }
-
- DefaultTextBoxShowLeaveValue(txtDmSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtDmSpecialDateColumnFormat_Decrible);
- DefaultTextBoxShowLeaveValue(txtDmAutoSqlName, SourceSettingTextBoxDecrible.txtDmAutoSqlName_Decrible);
- DefaultTextBoxShowLeaveValue(txtDmAutoSql, SourceSettingTextBoxDecrible.txtDmAutoSql_Decrible);
-
- if (!lstLoadingSource.Contains("DmFormat")) lstLoadingSource.Add("DmFormat");
- }
-
- private void DefaultTextBoxShowLeaveValue(TextBox textBox, string strValue)
- {
- if (textBox.Text.Length == 0)
- {
- textBox.Text = strValue;
- textBox.ForeColor = Color.Gray;
- }
- }
-
- private void DefaultTextBoxShowEnterValue(TextBox textBox, string strValue)
- {
- if (textBox.Text == strValue)
- {
- textBox.Text = "";
- textBox.ForeColor = Color.Black;
- }
- }
-
- private void btnOK_Click(object sender, EventArgs e)
- {
- bool bSaveSuccess = true;
- int count = 0;
- //判断类型内容是否发生了修改,如果发生了修改,进行存储
- if (ExcelFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(ExcelFormat, "ExcelFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (FoxProFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(FoxProFormat, "FoxProFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (AccessFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(AccessFormat, "AccessFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (SqliteFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(SqliteFormat, "SqliteFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (SqlServerFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(SqlServerFormat, "SqlServerFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (MySqlFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(MySqlFormat, "MySqlFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (OracleFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(OracleFormat, "OracleFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (NormalFileFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(NormalFileFormat, "NormalFileFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (PostgreSqlFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(PostgreSqlFormat, "PostgreSqlFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (KingbaseFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(KingbaseFormat, "KingbaseFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
- if (DmFormatChanged())
- {
- bSaveSuccess = FileOperation.SaveFormatConfigData(DmFormat, "DmFormatConfig.xml");
- count = bSaveSuccess ? count : count + 1;
- }
-
- MessageBox.Show(count == 0 ? "保存成功" : "保存失败!");
- }
-
- private bool NormalFileFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("NormalFileFormat")) return bIfChanged;
-
- if (this.cbxNormalFileReadFile.Checked != (NormalFileFormat.ReadNormalFileMode == "0" ? true : false))
- {
- NormalFileFormat.ReadNormalFileMode = this.cbxNormalFileReadFile.Checked ? "0" : "1";
- bIfChanged = true;
- }
-
- if (NormalFileFormat.IfCustomCreateDateColumn==null||(this.cbxNormalFileCustomDate.Checked != (NormalFileFormat.IfCustomCreateDateColumn == "0" ? true : false)))
- {
- NormalFileFormat.IfCustomCreateDateColumn= this.cbxNormalFileCustomDate.Checked ? "0" : "1";
- bIfChanged = true;
- }
-
- //数字
- int oldValue = 0;
- if (NormalFileFormat.NormalFileStartLineIndex != null)
- {
- Int32.TryParse(NormalFileFormat.NormalFileStartLineIndex, out oldValue);
- }
- if (this.numNormalFileStartIndex.Value != oldValue)
- {
- NormalFileFormat.NormalFileStartLineIndex = this.numNormalFileStartIndex.Value.ToString();
- bIfChanged = true;
- }
-
- NormalFileFormat.NormalFileDateColumnFormat=TextBoxChangedValue(NormalFileFormat.NormalFileDateColumnFormat, txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible,ref bIfChanged);
- NormalFileFormat.NormalFileNameFormat=TextBoxChangedValue(NormalFileFormat.NormalFileNameFormat, txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible,ref bIfChanged);
- NormalFileFormat.NormalFileDataMode=TextBoxChangedValue(NormalFileFormat.NormalFileDataMode, txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible,ref bIfChanged);
- NormalFileFormat.NormalFileSuffix=TextBoxChangedValue(NormalFileFormat.NormalFileSuffix, txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible,ref bIfChanged);
- NormalFileFormat.NormalFileSplitType = TextBoxChangedValue(NormalFileFormat.NormalFileSplitType,txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible, ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool OracleFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("OracleFormat")) return bIfChanged;
-
- OracleFormat.OracleFileDateColumnFormat=TextBoxChangedValue(OracleFormat.OracleFileDateColumnFormat, txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible,ref bIfChanged);
- OracleFormat.AutoSql.OracleViewName=TextBoxChangedValue(OracleFormat.AutoSql.OracleViewName, txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible,ref bIfChanged);
- OracleFormat.AutoSql.OracleViewSql=TextBoxChangedValue(OracleFormat.AutoSql.OracleViewSql, txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible,ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool MySqlFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("MySqlFormat")) return bIfChanged;
-
- MySqlFormat.MySqlFileDateColumnFormat=TextBoxChangedValue(MySqlFormat.MySqlFileDateColumnFormat, txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible,ref bIfChanged);
- MySqlFormat.AutoSql.MySqlViewName=TextBoxChangedValue(MySqlFormat.AutoSql.MySqlViewName, txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible,ref bIfChanged);
- MySqlFormat.AutoSql.MySqlViewSql=TextBoxChangedValue(MySqlFormat.AutoSql.MySqlViewSql, txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible,ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool SqlServerFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("SqlServerFormat")) return bIfChanged;
-
- SqlServerFormat.SqlServerFileDateColumnFormat=TextBoxChangedValue(SqlServerFormat.SqlServerFileDateColumnFormat, txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible,ref bIfChanged);
- SqlServerFormat.SqlServerConnection=TextBoxChangedValue(SqlServerFormat.SqlServerConnection, txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible,ref bIfChanged);
- SqlServerFormat.AutoSql.SqlServerViewName=TextBoxChangedValue(SqlServerFormat.AutoSql.SqlServerViewName, txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible,ref bIfChanged);
- SqlServerFormat.AutoSql.SqlServerViewSql=TextBoxChangedValue(SqlServerFormat.AutoSql.SqlServerViewSql, txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible,ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool SqliteFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("SqliteFormat")) return bIfChanged;
-
- if (this.cbxSqliteReadFile.Checked != (SqliteFormat.ReadSqliteFileMode == "0" ? true : false))
- {
- SqliteFormat.ReadSqliteFileMode = this.cbxSqliteReadFile.Checked ? "0" : "1";
- bIfChanged = true;
- }
- SqliteFormat.SqliteFileDateColumnFormat=TextBoxChangedValue(SqliteFormat.SqliteFileDateColumnFormat, txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible,ref bIfChanged);
- SqliteFormat.SqliteFileNameFormat=TextBoxChangedValue(SqliteFormat.SqliteFileNameFormat, txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible, ref bIfChanged);
- SqliteFormat.AutoSql.SqliteViewName=TextBoxChangedValue(SqliteFormat.AutoSql.SqliteViewName, txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible, ref bIfChanged);
- SqliteFormat.AutoSql.SqliteViewSql=TextBoxChangedValue(SqliteFormat.AutoSql.SqliteViewSql, txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible,ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool AccessFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("AccessFormat")) return bIfChanged;
-
- if (this.cbxAccessOldVersion.Checked != (AccessFormat.AccessFileVersion == "0" ? true : false))
- {
- AccessFormat.AccessFileVersion = this.cbxAccessOldVersion.Checked ? "0" : "1";
- bIfChanged = true;
- }
- this.AccessFormat.AccessSuffix=TextBoxChangedValue(this.AccessFormat.AccessSuffix, txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible,ref bIfChanged);
- this.AccessFormat.AccessFileDateColumnFormat=TextBoxChangedValue(AccessFormat.AccessFileDateColumnFormat, txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible,ref bIfChanged);
- this.AccessFormat.AccessFileNameFormat=TextBoxChangedValue(this.AccessFormat.AccessFileNameFormat, txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible, ref bIfChanged);
- if (this.cbxAccessReadFile.Checked != (AccessFormat.ReadAccessFileMode == "0" ? true : false))
- {
- AccessFormat.ReadAccessFileMode = this.cbxAccessReadFile.Checked ? "0" : "1";
- bIfChanged = true;
- }
- AccessFormat.AutoSql.AccessViewName=TextBoxChangedValue(AccessFormat.AutoSql.AccessViewName, txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible,ref bIfChanged);
- AccessFormat.AutoSql.AccessViewSql=TextBoxChangedValue(AccessFormat.AutoSql.AccessViewSql, txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible,ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool FoxProFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("FoxProFormat")) return bIfChanged;
-
- if (this.cbxFoxProReadFile.Checked != (FoxProFormat.ReadFoxProFileMode == "0" ? true : false))
- {
- FoxProFormat.ReadFoxProFileMode = this.cbxFoxProReadFile.Checked ? "0" : "1";
- bIfChanged = true;
- }
-
- FoxProFormat.FoxProFileDateColumnFormat = TextBoxChangedValue(FoxProFormat.FoxProFileDateColumnFormat,txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible, ref bIfChanged);
- FoxProFormat.FoxProFileNameFormat=TextBoxChangedValue(FoxProFormat.FoxProFileNameFormat, txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible, ref bIfChanged);
- FoxProFormat.AutoSql.FoxProViewName=TextBoxChangedValue(FoxProFormat.AutoSql.FoxProViewName, txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible, ref bIfChanged);
- FoxProFormat.AutoSql.FoxProViewSql=TextBoxChangedValue(FoxProFormat.AutoSql.FoxProViewSql, txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible, ref bIfChanged);
- FoxProFormat.SpecialDtOpera.Method=TextBoxChangedValue(FoxProFormat.SpecialDtOpera.Method, txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible, ref bIfChanged);
- FoxProFormat.SpecialDtOpera.Value=TextBoxChangedValue(FoxProFormat.SpecialDtOpera.Value, txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible, ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool PostgreSqlFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("PostgreSqlFormat")) return bIfChanged;
-
- PostgreSqlFormat.PostgreSqlFileDateColumnFormat = TextBoxChangedValue(PostgreSqlFormat.PostgreSqlFileDateColumnFormat, txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible, ref bIfChanged);
- PostgreSqlFormat.AutoSql.PostgreSqlViewName = TextBoxChangedValue(PostgreSqlFormat.AutoSql.PostgreSqlViewName, txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible, ref bIfChanged);
- PostgreSqlFormat.AutoSql.PostgreSqlViewSql = TextBoxChangedValue(PostgreSqlFormat.AutoSql.PostgreSqlViewSql, txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible, ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool KingbaseFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("KingbaseFormat")) return bIfChanged;
-
- KingbaseFormat.KingbaseFileDateColumnFormat = TextBoxChangedValue(KingbaseFormat.KingbaseFileDateColumnFormat, txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible, ref bIfChanged);
- KingbaseFormat.AutoSql.KingbaseViewName = TextBoxChangedValue(KingbaseFormat.AutoSql.KingbaseViewName, txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible, ref bIfChanged);
- KingbaseFormat.AutoSql.KingbaseViewSql = TextBoxChangedValue(KingbaseFormat.AutoSql.KingbaseViewSql, txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible, ref bIfChanged);
-
- return bIfChanged;
- }
-
- private bool ExcelFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("ExcelFormat")) return bIfChanged;
-
- if (this.cbxExcelOldVersion.Checked != (ExcelFormat.ExcelFileVersion == "0" ? true : false))
- {
- ExcelFormat.ExcelFileVersion = this.cbxExcelOldVersion.Checked ? "0" : "1";
- bIfChanged = true;
- }
-
- ExcelFormat.ExcelFileDateColumnFormat = TextBoxChangedValue(ExcelFormat.ExcelFileDateColumnFormat, txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible, ref bIfChanged);
- ExcelFormat.ExcelFileNameFormat = TextBoxChangedValue(ExcelFormat.ExcelFileNameFormat, txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible, ref bIfChanged);
- if (cbxExcelReadFile.Checked != (ExcelFormat.ReadExcelFileMode == "0" ? true : false))
- {
- ExcelFormat.ReadExcelFileMode = cbxExcelReadFile.Checked ? "0" : "1";
- bIfChanged = true;
- }
- ExcelFormat.AutoSql.ExcelViewName = TextBoxChangedValue(ExcelFormat.AutoSql.ExcelViewName, txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible, ref bIfChanged);
- ExcelFormat.AutoSql.ExcelViewSql = TextBoxChangedValue(ExcelFormat.AutoSql.ExcelViewSql, txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible, ref bIfChanged);
-
- return bIfChanged;
- }
-
-
-
- private bool DmFormatChanged()
- {
- bool bIfChanged = false;
-
- if (!lstLoadingSource.Contains("DmFormat")) return bIfChanged;
-
- DmFormat.DmFileDateColumnFormat = TextBoxChangedValue(DmFormat.DmFileDateColumnFormat, txtDmSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtDmSpecialDateColumnFormat_Decrible, ref bIfChanged);
-
- if(DmFormat.AutoSql == null)
- {
- DmFormat.AutoSql = new DmAutoSql();
- }
-
- DmFormat.AutoSql.DmViewName = TextBoxChangedValue(DmFormat.AutoSql.DmViewName, txtDmAutoSqlName, SourceSettingTextBoxDecrible.txtDmAutoSqlName_Decrible, ref bIfChanged);
- DmFormat.AutoSql.DmViewSql = TextBoxChangedValue(DmFormat.AutoSql.DmViewSql, txtDmAutoSql, SourceSettingTextBoxDecrible.txtDmAutoSql_Decrible, ref bIfChanged);
-
- return bIfChanged;
- }
-
- private string TextBoxChangedValue(string strClassValue,TextBox textBox,string strDetailValue,ref bool bIfChanged)
- {
- string strNewValue = "";
-
- if (textBox.Text != "" && textBox.Text != strDetailValue)
- strNewValue = textBox.Text;
-
- if (strNewValue != strClassValue)
- {
- strClassValue = strNewValue;
- bIfChanged = true;
- }
- return strClassValue;
- }
-
- //private void bTextBoxChanged(string strClassValue, TextBox textBox, string strDetailValue, ref bool bIfChanged)
- //{
-
- // string strNewValue = "";
-
- // if (textBox.Text != "" && textBox.Text != strDetailValue)
- // strNewValue = textBox.Text;
-
- // if (strNewValue != strClassValue)
- // {
- // strClassValue = strNewValue;
- // bIfChanged = true;
- // }
- //}
-
- #region Excel界面事件
- private void txtExcelSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible);
- }
-
- private void txtExcelSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible);
- }
-
- private void txtExcelFileNameFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible);
- }
-
- private void txtExcelFileNameFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible);
- }
-
- private void txtExcelAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible);
- }
-
- private void txtExcelAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible);
- }
-
- private void txtExcelAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible);
- }
-
- private void txtExcelAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible);
- }
-
-
- private void cbxExcelOldVersion_CheckedChanged(object sender, EventArgs e)
- {
- cbxExcelNewVersion.Checked = !cbxExcelOldVersion.Checked;
- }
-
- private void cbxExcelNewVersion_CheckedChanged(object sender, EventArgs e)
- {
- cbxExcelOldVersion.Checked = !cbxExcelNewVersion.Checked;
- }
-
- private void cbxExcelReadFile_CheckedChanged(object sender, EventArgs e)
- {
- cbxExcelReadFolder.Checked = !cbxExcelReadFile.Checked;
- }
-
- private void cbxExcelReadFolder_CheckedChanged(object sender, EventArgs e)
- {
- cbxExcelReadFile.Checked = !cbxExcelReadFolder.Checked;
- }
-
- #endregion
-
- #region FoxPro界面事件
-
- private void cbxFoxProReadFile_CheckedChanged(object sender, EventArgs e)
- {
- cbxFoxProReadFolder.Checked = !cbxFoxProReadFile.Checked;
- }
-
- private void cbxFoxProReadFolder_CheckedChanged(object sender, EventArgs e)
- {
- cbxFoxProReadFile.Checked = !cbxFoxProReadFolder.Checked;
- }
-
- private void txtFoxProSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible);
- }
-
- private void txtFoxProSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible);
- }
-
- private void txtFoxProFileNameFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible);
- }
-
- private void txtFoxProFileNameFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible);
- }
-
- private void txtFoxProAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible);
- }
-
- private void txtFoxProAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible);
- }
-
- private void txtFoxProAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible);
- }
-
- private void txtFoxProAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible);
- }
-
- private void txtFoxProSpecialMethodName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible);
- }
-
- private void txtFoxProSpecialMethodName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible);
- }
-
- private void txtFoxProSpecialMethod_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible);
- }
-
- private void txtFoxProSpecialMethod_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible);
- }
-
- #endregion
-
- #region Access界面事件
- private void cbxAccessOldVersion_CheckedChanged(object sender, EventArgs e)
- {
- cbxAccessNewVersion.Checked = !cbxAccessOldVersion.Checked;
- }
-
- private void cbxAccessNewVersion_CheckedChanged(object sender, EventArgs e)
- {
- cbxAccessOldVersion.Checked = !cbxAccessNewVersion.Checked;
- }
-
- private void cbxAccessReadFile_CheckedChanged(object sender, EventArgs e)
- {
- cbxAccessReadFolder.Checked = !cbxAccessReadFile.Checked;
- }
-
- private void cbxAccessReadFolder_CheckedChanged(object sender, EventArgs e)
- {
- cbxAccessReadFile.Checked = !cbxAccessReadFolder.Checked;
- }
- private void txtAccessSuffix_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible);
- }
-
- private void txtAccessSuffix_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible);
- }
-
- private void txtAccessSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible);
- }
-
- private void txtAccessSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible);
- }
-
- private void txtAccessFileName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible);
- }
-
- private void txtAccessFileName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible);
- }
-
- private void txtAccessAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible);
- }
-
- private void txtAccessAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible);
- }
-
- private void txtAccessAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible);
- }
-
- private void txtAccessAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible);
- }
- #endregion
-
- #region Sqlite界面事件
- private void cbxSqliteReadFile_CheckedChanged(object sender, EventArgs e)
- {
- cbxSqliteReadFolder.Checked = !cbxSqliteReadFile.Checked;
- }
-
- private void cbxSqliteReadFolder_CheckedChanged(object sender, EventArgs e)
- {
- cbxSqliteReadFile.Checked = !cbxSqliteReadFolder.Checked;
- }
-
- private void txtSqliteSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible);
- }
-
- private void txtSqliteSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible);
- }
-
- private void txtSqliteFileNameFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible);
- }
-
- private void txtSqliteFileNameFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible);
- }
-
- private void txtSqliteAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible);
- }
-
- private void txtSqliteAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible);
- }
-
- private void txtSqliteAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible);
- }
-
- private void txtSqliteAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible);
- }
- #endregion
-
- #region SqlServer界面事件
- private void txtSqlServerSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible);
- }
-
- private void txtSqlServerSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible);
- }
-
- private void txtSqlServerConnection_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible);
- }
-
- private void txtSqlServerConnection_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible);
- }
-
- private void txtSqlServerAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible);
- }
-
- private void txtSqlServerAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible);
- }
-
- private void txtSqlServerAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible);
- }
-
- private void txtSqlServerAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible);
- }
- #endregion
-
- #region MySql界面事件
-
- private void txtMySqlSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible);
- }
-
- private void txtMySqlSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible);
- }
-
- private void txtMySqlAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible);
- }
-
- private void txtMySqlAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible);
- }
-
- private void txtMySqlAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible);
- }
-
- private void txtMySqlAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible);
- }
- #endregion
-
- #region Oracle界面事件
-
- private void txtOracleSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible);
- }
-
- private void txtOracleSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible);
- }
-
- private void txtOracleAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible);
- }
-
- private void txtOracleAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible);
- }
-
- private void txtOracleAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible);
- }
-
- private void txtOracleAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible);
- }
- #endregion
-
- #region Txt界面事件
- private void cbxNormalFileReadFile_CheckedChanged(object sender, EventArgs e)
- {
- cbxNormalFileReadFolder.Checked = !cbxNormalFileReadFile.Checked;
- }
-
- private void cbxNormalFileReadFolder_CheckedChanged(object sender, EventArgs e)
- {
- cbxNormalFileReadFile.Checked = !cbxNormalFileReadFolder.Checked;
- }
-
- private void txtNormalFileSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible);
- }
-
- private void txtNormalFileSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible);
- }
-
- private void txtNormalFileNameFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible);
- }
-
- private void txtNormalFileNameFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible);
- }
-
- private void txtNormalFileSuffix_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible);
- }
-
- private void txtNormalFileSuffix_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible);
- }
-
- private void txtNormalFileReadDataMode_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible);
- }
-
- private void txtNormalFileReadDataMode_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible);
- }
- private void txtNormalFileReadSplitMode_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible);
- }
-
- private void txtNormalFileReadSplitMode_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible);
- }
-
- private void cbxNormalFileCustomDate_CheckedChanged(object sender, EventArgs e)
- {
- cbxNormalFileNoCustomDate.Checked = !cbxNormalFileCustomDate.Checked;
- }
-
- private void cbxNormalFileNoCustomDate_CheckedChanged(object sender, EventArgs e)
- {
- cbxNormalFileCustomDate.Checked = !cbxNormalFileNoCustomDate.Checked;
- }
-
- #endregion
-
- #region PostgreSQL界面事件
-
- private void txtPostgreSqlSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible);
- }
-
- private void txtPostgreSqlSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible);
- }
-
- private void txtPostgreSqlAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible);
- }
-
- private void txtPostgreSqlAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible);
- }
-
- private void txtPostgreSqlAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible);
- }
-
- private void txtPostgreSqlAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible);
- }
-
- #endregion
-
- #region Kingbase界面事件
- private void txtKingbaseSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible);
- }
-
- private void txtKingbaseSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible);
- }
-
- private void txtKingbaseAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible);
- }
-
- private void txtKingbaseAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible);
- }
-
- private void txtKingbaseAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible);
- }
-
- private void txtKingbaseAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible);
- }
- #endregion
-
- #region Dm界面事件
- private void txtDmSpecialDateColumnFormat_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtDmSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtDmSpecialDateColumnFormat_Decrible);
- }
-
- private void txtDmSpecialDateColumnFormat_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtDmSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtDmSpecialDateColumnFormat_Decrible);
- }
-
- private void txtDmAutoSqlName_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtDmAutoSqlName, SourceSettingTextBoxDecrible.txtDmAutoSqlName_Decrible);
- }
-
- private void txtDmAutoSqlName_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtDmAutoSqlName, SourceSettingTextBoxDecrible.txtDmAutoSqlName_Decrible);
- }
-
- private void txtDmAutoSql_Leave(object sender, EventArgs e)
- {
- DefaultTextBoxShowLeaveValue(txtDmAutoSql, SourceSettingTextBoxDecrible.txtDmAutoSql_Decrible);
- }
-
- private void txtDmAutoSql_Enter(object sender, EventArgs e)
- {
- DefaultTextBoxShowEnterValue(txtDmAutoSql, SourceSettingTextBoxDecrible.txtDmAutoSql_Decrible);
- }
- #endregion
-
- private void frmSourceSetting_Resize(object sender, EventArgs e)
- {
- arrayFields();
- btnOK.Left = (this.Width - btnOK.Width) / 2;
- }
-
- private void frmSourceSetting_Shown(object sender, EventArgs e)
- {
- arrayFields();
- btnOK.Left = (this.Width - btnOK.Width) / 2;
- }
-
- private void arrayFields() {
- switch (tabcDS.SelectedIndex)
- {
- case 0:
- FieldLine[] fields = {
- new FieldLine(lbExcelDateFormat,txtExcelSpecialDateColumnFormat),
- new FieldLine(lblExcelRemoteUser,txtExcelFileNameFormat),
- new FieldLine(lbExcelDynQuery,txtExcelAutoSqlName)
- };
- FormSizeHelper.Arrange(tabExcel, fields);
- txtExcelAutoSql.Width = txtExcelAutoSqlName.Width;
- txtExcelAutoSql.Height = tabExcel.Height - txtExcelAutoSql.Top - 24;
- break;
- }
- }
-
- }
- }
|