CNAS取数仪器端升级
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

1139 строки
56KB

  1. using CnasSynchronusClient;
  2. using CnasSynchrousModel;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace CNAS_DBSync
  12. {
  13. public partial class frmSourceSetting : Form
  14. {
  15. public AccessFormatConfig AccessFormat { get; set; }
  16. public ExcelFormatConfig ExcelFormat { get; set; }
  17. public FoxProFormatConfig FoxProFormat { get; set; }
  18. public SqliteFormatConfig SqliteFormat { get; set; }
  19. public SqlServerFormatConfig SqlServerFormat { get; set; }
  20. public OracleFormatConfig OracleFormat { get; set; }
  21. public MySqlFormatConfig MySqlFormat { get; set; }
  22. public NormalFileFormatConfig NormalFileFormat { get; set; }
  23. public PostgreSqlFormatConfig PostgreSqlFormat { get; set; }
  24. public KingbaseFormatConfig KingbaseFormat { get; set; }
  25. //用来记录tablepage是否加载过,如果没有加载过,存储时不做处理
  26. private List<string> lstLoadingSource = new List<string>();
  27. public frmSourceSetting()
  28. {
  29. InitializeComponent();
  30. }
  31. private void frmSourceSetting_Load(object sender, EventArgs e)
  32. {
  33. //获取已经存储的数据,初始化各种类型的参数类
  34. ExcelFormat= FileOperation.GetFormatConfigData<ExcelFormatConfig>("ExcelFormatConfig.xml");
  35. AccessFormat = FileOperation.GetFormatConfigData<AccessFormatConfig>("AccessFormatConfig.xml");
  36. FoxProFormat= FileOperation.GetFormatConfigData<FoxProFormatConfig>("FoxProFormatConfig.xml");
  37. SqliteFormat= FileOperation.GetFormatConfigData<SqliteFormatConfig>("SqliteFormatConfig.xml");
  38. SqlServerFormat= FileOperation.GetFormatConfigData<SqlServerFormatConfig>("SqlServerFormatConfig.xml");
  39. OracleFormat = FileOperation.GetFormatConfigData<OracleFormatConfig>("OracleFormatConfig.xml");
  40. MySqlFormat = FileOperation.GetFormatConfigData<MySqlFormatConfig>("MySqlFormatConfig.xml");
  41. NormalFileFormat = FileOperation.GetFormatConfigData<NormalFileFormatConfig>("NormalFileFormatConfig.xml");
  42. PostgreSqlFormat = FileOperation.GetFormatConfigData<PostgreSqlFormatConfig>("PostgreSqlFormatConfig.xml");
  43. KingbaseFormat = FileOperation.GetFormatConfigData<KingbaseFormatConfig>("KingbaseFormatConfig.xml");
  44. //默认加载第一个tablepage
  45. LoadExcelControlData();
  46. }
  47. private void tabcDS_Selected(object sender, TabControlEventArgs e)
  48. {
  49. switch (e.TabPageIndex)
  50. {
  51. case 0:
  52. //切换到Excel时的操作
  53. LoadExcelControlData();
  54. break;
  55. case 1:
  56. //切换到FoxPro时的操作
  57. LoadFoxProControlData();
  58. break;
  59. case 2:
  60. //切换到Access时的操作
  61. LoadAccessControlData();
  62. break;
  63. case 3:
  64. //切换到Sqlite时的操作
  65. LoadSqliteControlData();
  66. break;
  67. case 4:
  68. //切换到SQLServer时的操作
  69. LoadSqlServerData();
  70. break;
  71. case 5:
  72. //切换到MySQL时的操作
  73. LoadMySqlControlData();
  74. break;
  75. case 6:
  76. //切换到Oracle时的操作
  77. LoadOracleControlData();
  78. break;
  79. case 7:
  80. //切换到Txt时的操作
  81. LoadNormalFileControlData();
  82. break;
  83. case 8:
  84. //切换到PostgreSQL时的操作
  85. LoadPostgreSqlControlData();
  86. break;
  87. case 9:
  88. //切换到Kingbase时的操作
  89. LoadKingbaseControlData();
  90. break;
  91. }
  92. }
  93. private void LoadNormalFileControlData()
  94. {
  95. this.cbxNormalFileReadFile.Checked = NormalFileFormat.ReadNormalFileMode == "0" ? true : false;
  96. this.cbxNormalFileReadFolder.Checked = !this.cbxNormalFileReadFile.Checked;
  97. this.txtNormalFileSpecialDateColumnFormat.Text = NormalFileFormat.NormalFileDateColumnFormat ?? "";
  98. this.txtNormalFileNameFormat.Text = NormalFileFormat.NormalFileNameFormat ?? "";
  99. this.txtNormalFileReadDataMode.Text = NormalFileFormat.NormalFileDataMode ?? "";
  100. this.txtNormalFileSuffix.Text = NormalFileFormat.NormalFileSuffix ?? "";
  101. this.txtNormalFileReadSplitMode.Text = NormalFileFormat.NormalFileSplitType ?? "";
  102. //显示数字
  103. int showValue = 1;
  104. if (NormalFileFormat.NormalFileStartLineIndex != null)
  105. {
  106. Int32.TryParse(NormalFileFormat.NormalFileStartLineIndex, out showValue);
  107. }
  108. this.numNormalFileStartIndex.Value = showValue;
  109. this.cbxNormalFileCustomDate.Checked = NormalFileFormat.IfCustomCreateDateColumn == "0" ? true : false;
  110. this.cbxNormalFileNoCustomDate.Checked = !this.cbxNormalFileCustomDate.Checked;
  111. DefaultTextBoxShowLeaveValue(txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible);
  112. DefaultTextBoxShowLeaveValue(txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible);
  113. DefaultTextBoxShowLeaveValue(txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible);
  114. DefaultTextBoxShowLeaveValue(txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible);
  115. DefaultTextBoxShowLeaveValue(txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible);
  116. if (!lstLoadingSource.Contains("NormalFileFormat")) lstLoadingSource.Add("NormalFileFormat");
  117. }
  118. private void LoadOracleControlData()
  119. {
  120. this.txtOracleSpecialDateColumnFormat.Text = OracleFormat.OracleFileDateColumnFormat ?? "";
  121. this.txtOracleAutoSqlName.Text = OracleFormat.AutoSql != null ? OracleFormat.AutoSql.OracleViewName : "";
  122. this.txtOracleAutoSql.Text = OracleFormat.AutoSql != null ? OracleFormat.AutoSql.OracleViewSql : "";
  123. DefaultTextBoxShowLeaveValue(txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible);
  124. DefaultTextBoxShowLeaveValue(txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible);
  125. DefaultTextBoxShowLeaveValue(txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible);
  126. if (!lstLoadingSource.Contains("OracleFormat")) lstLoadingSource.Add("OracleFormat");
  127. }
  128. private void LoadMySqlControlData()
  129. {
  130. this.txtMySqlSpecialDateColumnFormat.Text = MySqlFormat.MySqlFileDateColumnFormat ?? "";
  131. this.txtMySqlAutoSqlName.Text = MySqlFormat.AutoSql != null ? MySqlFormat.AutoSql.MySqlViewName : "";
  132. this.txtMySqlAutoSql.Text = MySqlFormat.AutoSql != null ? MySqlFormat.AutoSql.MySqlViewSql : "";
  133. DefaultTextBoxShowLeaveValue(txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible);
  134. DefaultTextBoxShowLeaveValue(txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible);
  135. DefaultTextBoxShowLeaveValue(txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible);
  136. if (!lstLoadingSource.Contains("MySqlFormat")) lstLoadingSource.Add("MySqlFormat");
  137. }
  138. private void LoadSqlServerData()
  139. {
  140. this.txtSqlServerSpecialDateColumnFormat.Text = SqlServerFormat.SqlServerFileDateColumnFormat ??"";
  141. this.txtSqlServerConnection.Text = SqlServerFormat.SqlServerConnection ?? "";
  142. this.txtSqlServerAutoSqlName.Text = SqlServerFormat.AutoSql != null ? SqlServerFormat.AutoSql.SqlServerViewName : "";
  143. this.txtSqlServerAutoSql.Text = SqlServerFormat.AutoSql != null ? SqlServerFormat.AutoSql.SqlServerViewSql : "";
  144. DefaultTextBoxShowLeaveValue(txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible);
  145. DefaultTextBoxShowLeaveValue(txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible);
  146. DefaultTextBoxShowLeaveValue(txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible);
  147. DefaultTextBoxShowLeaveValue(txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible);
  148. if (!lstLoadingSource.Contains("SqlServerFormat")) lstLoadingSource.Add("SqlServerFormat");
  149. }
  150. private void LoadSqliteControlData()
  151. {
  152. this.cbxSqliteReadFile.Checked = SqliteFormat.ReadSqliteFileMode == "0" ? true : false;
  153. this.cbxSqliteReadFolder.Checked = !this.cbxSqliteReadFile.Checked;
  154. this.txtSqliteSpecialDateColumnFormat.Text = SqliteFormat.SqliteFileDateColumnFormat ?? "";
  155. this.txtSqliteFileNameFormat.Text = SqliteFormat.SqliteFileNameFormat ?? "";
  156. this.txtSqliteAutoSqlName.Text = SqliteFormat.AutoSql != null ? SqliteFormat.AutoSql.SqliteViewName : "";
  157. this.txtSqliteAutoSql.Text = SqliteFormat.AutoSql != null ? SqliteFormat.AutoSql.SqliteViewSql : "";
  158. DefaultTextBoxShowLeaveValue(txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible);
  159. DefaultTextBoxShowLeaveValue(txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible);
  160. DefaultTextBoxShowLeaveValue(txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible);
  161. DefaultTextBoxShowLeaveValue(txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible);
  162. if (!lstLoadingSource.Contains("SqliteFormat")) lstLoadingSource.Add("SqliteFormat");
  163. }
  164. private void LoadAccessControlData()
  165. {
  166. this.cbxAccessOldVersion.Checked = AccessFormat.AccessFileVersion == "0" ? true : false;
  167. this.cbxAccessNewVersion.Checked = !this.cbxAccessOldVersion.Checked;
  168. this.txtAccessSuffix.Text = this.AccessFormat.AccessSuffix ?? "";
  169. this.txtAccessSpecialDateColumnFormat.Text = this.AccessFormat.AccessFileDateColumnFormat ?? "";
  170. this.txtAccessFileName.Text = this.AccessFormat.AccessFileNameFormat ?? "";
  171. this.cbxAccessReadFile.Checked=AccessFormat.ReadAccessFileMode=="0"?true:false;
  172. this.cbxAccessReadFolder.Checked = !cbxAccessReadFile.Checked;
  173. this.txtAccessAutoSqlName.Text = AccessFormat.AutoSql != null ? AccessFormat.AutoSql.AccessViewName : "";
  174. this.txtAccessAutoSql.Text = AccessFormat.AutoSql != null ? AccessFormat.AutoSql.AccessViewSql : "";
  175. DefaultTextBoxShowLeaveValue(txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible);
  176. DefaultTextBoxShowLeaveValue(txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible);
  177. DefaultTextBoxShowLeaveValue(txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible);
  178. DefaultTextBoxShowLeaveValue(txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible);
  179. DefaultTextBoxShowLeaveValue(txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible);
  180. if (!lstLoadingSource.Contains("AccessFormat")) lstLoadingSource.Add("AccessFormat");
  181. }
  182. private void LoadFoxProControlData()
  183. {
  184. this.cbxFoxProReadFile.Checked = FoxProFormat.ReadFoxProFileMode == "0" ? true : false;
  185. this.cbxFoxProReadFolder.Checked = !cbxFoxProReadFile.Checked;
  186. this.txtFoxProSpecialDateColumnFormat.Text = FoxProFormat.FoxProFileDateColumnFormat ?? "";
  187. this.txtFoxProFileNameFormat.Text = FoxProFormat.FoxProFileNameFormat ?? "";
  188. this.txtFoxProAutoSqlName.Text = FoxProFormat.AutoSql != null ? FoxProFormat.AutoSql.FoxProViewName : "";
  189. this.txtFoxProAutoSql.Text = FoxProFormat.AutoSql != null ? FoxProFormat.AutoSql.FoxProViewSql : "";
  190. this.txtFoxProSpecialMethodName.Text = FoxProFormat.SpecialDtOpera != null ? FoxProFormat.SpecialDtOpera.Method : "";
  191. this.txtFoxProSpecialMethod.Text= FoxProFormat.SpecialDtOpera != null ? FoxProFormat.SpecialDtOpera.Value : "";
  192. DefaultTextBoxShowLeaveValue(txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible);
  193. DefaultTextBoxShowLeaveValue(txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible);
  194. DefaultTextBoxShowLeaveValue(txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible);
  195. DefaultTextBoxShowLeaveValue(txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible);
  196. DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible);
  197. DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible);
  198. if (!lstLoadingSource.Contains("FoxProFormat")) lstLoadingSource.Add("FoxProFormat");
  199. }
  200. private void LoadExcelControlData()
  201. {
  202. this.cbxExcelOldVersion.Checked = ExcelFormat.ExcelFileVersion == "0" ? true : false;
  203. this.cbxExcelNewVersion.Checked = !cbxExcelOldVersion.Checked;
  204. this.txtExcelSpecialDateColumnFormat.Text = ExcelFormat.ExcelFileDateColumnFormat ?? "";
  205. this.txtExcelFileNameFormat.Text = ExcelFormat.ExcelFileNameFormat ?? "";
  206. this.cbxExcelReadFile.Checked = ExcelFormat.ReadExcelFileMode == "0" ? true : false;
  207. this.cbxExcelReadFolder.Checked = !cbxExcelReadFile.Checked;
  208. this.txtExcelAutoSqlName.Text = ExcelFormat.AutoSql != null ? ExcelFormat.AutoSql.ExcelViewName:"";
  209. this.txtExcelAutoSql.Text= ExcelFormat.AutoSql != null ? ExcelFormat.AutoSql.ExcelViewSql : "";
  210. DefaultTextBoxShowLeaveValue(txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible);
  211. DefaultTextBoxShowLeaveValue(txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible);
  212. DefaultTextBoxShowLeaveValue(txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible);
  213. DefaultTextBoxShowLeaveValue(txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible);
  214. if (!lstLoadingSource.Contains("ExcelFormat")) lstLoadingSource.Add("ExcelFormat");
  215. }
  216. private void LoadPostgreSqlControlData()
  217. {
  218. this.txtPostgreSqlSpecialDateColumnFormat.Text = PostgreSqlFormat.PostgreSqlFileDateColumnFormat ?? "";
  219. this.txtPostgreSqlAutoSqlName.Text = PostgreSqlFormat.AutoSql != null ? PostgreSqlFormat.AutoSql.PostgreSqlViewName : "";
  220. this.txtPostgreSqlAutoSql.Text = PostgreSqlFormat.AutoSql != null ? PostgreSqlFormat.AutoSql.PostgreSqlViewSql : "";
  221. DefaultTextBoxShowLeaveValue(txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible);
  222. DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible);
  223. DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible);
  224. if (!lstLoadingSource.Contains("PostgreSqlFormat")) lstLoadingSource.Add("PostgreSqlFormat");
  225. }
  226. private void LoadKingbaseControlData()
  227. {
  228. if(KingbaseFormat!=null)
  229. {
  230. this.txtKingbaseSpecialDateColumnFormat.Text = KingbaseFormat.KingbaseFileDateColumnFormat ?? "";
  231. this.txtKingbaseAutoSqlName.Text = KingbaseFormat.AutoSql != null ? KingbaseFormat.AutoSql.KingbaseViewName : "";
  232. this.txtKingbaseAutoSql.Text = KingbaseFormat.AutoSql != null ? KingbaseFormat.AutoSql.KingbaseViewSql : "";
  233. }
  234. DefaultTextBoxShowLeaveValue(txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible);
  235. DefaultTextBoxShowLeaveValue(txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible);
  236. DefaultTextBoxShowLeaveValue(txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible);
  237. if (!lstLoadingSource.Contains("KingbaseFormat")) lstLoadingSource.Add("KingbaseFormat");
  238. }
  239. private void DefaultTextBoxShowLeaveValue(TextBox textBox, string strValue)
  240. {
  241. if (textBox.Text.Length == 0)
  242. {
  243. textBox.Text = strValue;
  244. textBox.ForeColor = Color.Gray;
  245. }
  246. }
  247. private void DefaultTextBoxShowEnterValue(TextBox textBox, string strValue)
  248. {
  249. if (textBox.Text == strValue)
  250. {
  251. textBox.Text = "";
  252. textBox.ForeColor = Color.Black;
  253. }
  254. }
  255. private void btnOK_Click(object sender, EventArgs e)
  256. {
  257. bool bSaveSuccess = true;
  258. int count = 0;
  259. //判断类型内容是否发生了修改,如果发生了修改,进行存储
  260. if (ExcelFormatChanged())
  261. {
  262. bSaveSuccess = FileOperation.SaveFormatConfigData(ExcelFormat, "ExcelFormatConfig.xml");
  263. count = bSaveSuccess ? count : count + 1;
  264. }
  265. if (FoxProFormatChanged())
  266. {
  267. bSaveSuccess = FileOperation.SaveFormatConfigData(FoxProFormat, "FoxProFormatConfig.xml");
  268. count = bSaveSuccess ? count : count + 1;
  269. }
  270. if (AccessFormatChanged())
  271. {
  272. bSaveSuccess = FileOperation.SaveFormatConfigData(AccessFormat, "AccessFormatConfig.xml");
  273. count = bSaveSuccess ? count : count + 1;
  274. }
  275. if (SqliteFormatChanged())
  276. {
  277. bSaveSuccess = FileOperation.SaveFormatConfigData(SqliteFormat, "SqliteFormatConfig.xml");
  278. count = bSaveSuccess ? count : count + 1;
  279. }
  280. if (SqlServerFormatChanged())
  281. {
  282. bSaveSuccess = FileOperation.SaveFormatConfigData(SqlServerFormat, "SqlServerFormatConfig.xml");
  283. count = bSaveSuccess ? count : count + 1;
  284. }
  285. if (MySqlFormatChanged())
  286. {
  287. bSaveSuccess = FileOperation.SaveFormatConfigData(MySqlFormat, "MySqlFormatConfig.xml");
  288. count = bSaveSuccess ? count : count + 1;
  289. }
  290. if (OracleFormatChanged())
  291. {
  292. bSaveSuccess = FileOperation.SaveFormatConfigData(OracleFormat, "OracleFormatConfig.xml");
  293. count = bSaveSuccess ? count : count + 1;
  294. }
  295. if (NormalFileFormatChanged())
  296. {
  297. bSaveSuccess = FileOperation.SaveFormatConfigData(NormalFileFormat, "NormalFileFormatConfig.xml");
  298. count = bSaveSuccess ? count : count + 1;
  299. }
  300. if (PostgreSqlFormatChanged())
  301. {
  302. bSaveSuccess = FileOperation.SaveFormatConfigData(PostgreSqlFormat, "PostgreSqlFormatConfig.xml");
  303. count = bSaveSuccess ? count : count + 1;
  304. }
  305. if (KingbaseFormatChanged())
  306. {
  307. bSaveSuccess = FileOperation.SaveFormatConfigData(KingbaseFormat, "KingbaseFormatConfig.xml");
  308. count = bSaveSuccess ? count : count + 1;
  309. }
  310. MessageBox.Show(count == 0 ? "保存成功" : "保存失败!");
  311. }
  312. private bool NormalFileFormatChanged()
  313. {
  314. bool bIfChanged = false;
  315. if (!lstLoadingSource.Contains("NormalFileFormat")) return bIfChanged;
  316. if (this.cbxNormalFileReadFile.Checked != (NormalFileFormat.ReadNormalFileMode == "0" ? true : false))
  317. {
  318. NormalFileFormat.ReadNormalFileMode = this.cbxNormalFileReadFile.Checked ? "0" : "1";
  319. bIfChanged = true;
  320. }
  321. if (NormalFileFormat.IfCustomCreateDateColumn==null||(this.cbxNormalFileCustomDate.Checked != (NormalFileFormat.IfCustomCreateDateColumn == "0" ? true : false)))
  322. {
  323. NormalFileFormat.IfCustomCreateDateColumn= this.cbxNormalFileCustomDate.Checked ? "0" : "1";
  324. bIfChanged = true;
  325. }
  326. //数字
  327. int oldValue = 0;
  328. if (NormalFileFormat.NormalFileStartLineIndex != null)
  329. {
  330. Int32.TryParse(NormalFileFormat.NormalFileStartLineIndex, out oldValue);
  331. }
  332. if (this.numNormalFileStartIndex.Value != oldValue)
  333. {
  334. NormalFileFormat.NormalFileStartLineIndex = this.numNormalFileStartIndex.Value.ToString();
  335. bIfChanged = true;
  336. }
  337. NormalFileFormat.NormalFileDateColumnFormat=TextBoxChangedValue(NormalFileFormat.NormalFileDateColumnFormat, txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible,ref bIfChanged);
  338. NormalFileFormat.NormalFileNameFormat=TextBoxChangedValue(NormalFileFormat.NormalFileNameFormat, txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible,ref bIfChanged);
  339. NormalFileFormat.NormalFileDataMode=TextBoxChangedValue(NormalFileFormat.NormalFileDataMode, txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible,ref bIfChanged);
  340. NormalFileFormat.NormalFileSuffix=TextBoxChangedValue(NormalFileFormat.NormalFileSuffix, txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible,ref bIfChanged);
  341. NormalFileFormat.NormalFileSplitType = TextBoxChangedValue(NormalFileFormat.NormalFileSplitType,txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible, ref bIfChanged);
  342. return bIfChanged;
  343. }
  344. private bool OracleFormatChanged()
  345. {
  346. bool bIfChanged = false;
  347. if (!lstLoadingSource.Contains("OracleFormat")) return bIfChanged;
  348. OracleFormat.OracleFileDateColumnFormat=TextBoxChangedValue(OracleFormat.OracleFileDateColumnFormat, txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible,ref bIfChanged);
  349. OracleFormat.AutoSql.OracleViewName=TextBoxChangedValue(OracleFormat.AutoSql.OracleViewName, txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible,ref bIfChanged);
  350. OracleFormat.AutoSql.OracleViewSql=TextBoxChangedValue(OracleFormat.AutoSql.OracleViewSql, txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible,ref bIfChanged);
  351. return bIfChanged;
  352. }
  353. private bool MySqlFormatChanged()
  354. {
  355. bool bIfChanged = false;
  356. if (!lstLoadingSource.Contains("MySqlFormat")) return bIfChanged;
  357. MySqlFormat.MySqlFileDateColumnFormat=TextBoxChangedValue(MySqlFormat.MySqlFileDateColumnFormat, txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible,ref bIfChanged);
  358. MySqlFormat.AutoSql.MySqlViewName=TextBoxChangedValue(MySqlFormat.AutoSql.MySqlViewName, txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible,ref bIfChanged);
  359. MySqlFormat.AutoSql.MySqlViewSql=TextBoxChangedValue(MySqlFormat.AutoSql.MySqlViewSql, txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible,ref bIfChanged);
  360. return bIfChanged;
  361. }
  362. private bool SqlServerFormatChanged()
  363. {
  364. bool bIfChanged = false;
  365. if (!lstLoadingSource.Contains("SqlServerFormat")) return bIfChanged;
  366. SqlServerFormat.SqlServerFileDateColumnFormat=TextBoxChangedValue(SqlServerFormat.SqlServerFileDateColumnFormat, txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible,ref bIfChanged);
  367. SqlServerFormat.SqlServerConnection=TextBoxChangedValue(SqlServerFormat.SqlServerConnection, txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible,ref bIfChanged);
  368. SqlServerFormat.AutoSql.SqlServerViewName=TextBoxChangedValue(SqlServerFormat.AutoSql.SqlServerViewName, txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible,ref bIfChanged);
  369. SqlServerFormat.AutoSql.SqlServerViewSql=TextBoxChangedValue(SqlServerFormat.AutoSql.SqlServerViewSql, txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible,ref bIfChanged);
  370. return bIfChanged;
  371. }
  372. private bool SqliteFormatChanged()
  373. {
  374. bool bIfChanged = false;
  375. if (!lstLoadingSource.Contains("SqliteFormat")) return bIfChanged;
  376. if (this.cbxSqliteReadFile.Checked != (SqliteFormat.ReadSqliteFileMode == "0" ? true : false))
  377. {
  378. SqliteFormat.ReadSqliteFileMode = this.cbxSqliteReadFile.Checked ? "0" : "1";
  379. bIfChanged = true;
  380. }
  381. SqliteFormat.SqliteFileDateColumnFormat=TextBoxChangedValue(SqliteFormat.SqliteFileDateColumnFormat, txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible,ref bIfChanged);
  382. SqliteFormat.SqliteFileNameFormat=TextBoxChangedValue(SqliteFormat.SqliteFileNameFormat, txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible, ref bIfChanged);
  383. SqliteFormat.AutoSql.SqliteViewName=TextBoxChangedValue(SqliteFormat.AutoSql.SqliteViewName, txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible, ref bIfChanged);
  384. SqliteFormat.AutoSql.SqliteViewSql=TextBoxChangedValue(SqliteFormat.AutoSql.SqliteViewSql, txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible,ref bIfChanged);
  385. return bIfChanged;
  386. }
  387. private bool AccessFormatChanged()
  388. {
  389. bool bIfChanged = false;
  390. if (!lstLoadingSource.Contains("AccessFormat")) return bIfChanged;
  391. if (this.cbxAccessOldVersion.Checked != (AccessFormat.AccessFileVersion == "0" ? true : false))
  392. {
  393. AccessFormat.AccessFileVersion = this.cbxAccessOldVersion.Checked ? "0" : "1";
  394. bIfChanged = true;
  395. }
  396. this.AccessFormat.AccessSuffix=TextBoxChangedValue(this.AccessFormat.AccessSuffix, txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible,ref bIfChanged);
  397. this.AccessFormat.AccessFileDateColumnFormat=TextBoxChangedValue(AccessFormat.AccessFileDateColumnFormat, txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible,ref bIfChanged);
  398. this.AccessFormat.AccessFileNameFormat=TextBoxChangedValue(this.AccessFormat.AccessFileNameFormat, txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible, ref bIfChanged);
  399. if (this.cbxAccessReadFile.Checked != (AccessFormat.ReadAccessFileMode == "0" ? true : false))
  400. {
  401. AccessFormat.ReadAccessFileMode = this.cbxAccessReadFile.Checked ? "0" : "1";
  402. bIfChanged = true;
  403. }
  404. AccessFormat.AutoSql.AccessViewName=TextBoxChangedValue(AccessFormat.AutoSql.AccessViewName, txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible,ref bIfChanged);
  405. AccessFormat.AutoSql.AccessViewSql=TextBoxChangedValue(AccessFormat.AutoSql.AccessViewSql, txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible,ref bIfChanged);
  406. return bIfChanged;
  407. }
  408. private bool FoxProFormatChanged()
  409. {
  410. bool bIfChanged = false;
  411. if (!lstLoadingSource.Contains("FoxProFormat")) return bIfChanged;
  412. if (this.cbxFoxProReadFile.Checked != (FoxProFormat.ReadFoxProFileMode == "0" ? true : false))
  413. {
  414. FoxProFormat.ReadFoxProFileMode = this.cbxFoxProReadFile.Checked ? "0" : "1";
  415. bIfChanged = true;
  416. }
  417. FoxProFormat.FoxProFileDateColumnFormat = TextBoxChangedValue(FoxProFormat.FoxProFileDateColumnFormat,txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible, ref bIfChanged);
  418. FoxProFormat.FoxProFileNameFormat=TextBoxChangedValue(FoxProFormat.FoxProFileNameFormat, txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible, ref bIfChanged);
  419. FoxProFormat.AutoSql.FoxProViewName=TextBoxChangedValue(FoxProFormat.AutoSql.FoxProViewName, txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible, ref bIfChanged);
  420. FoxProFormat.AutoSql.FoxProViewSql=TextBoxChangedValue(FoxProFormat.AutoSql.FoxProViewSql, txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible, ref bIfChanged);
  421. FoxProFormat.SpecialDtOpera.Method=TextBoxChangedValue(FoxProFormat.SpecialDtOpera.Method, txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible, ref bIfChanged);
  422. FoxProFormat.SpecialDtOpera.Value=TextBoxChangedValue(FoxProFormat.SpecialDtOpera.Value, txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible, ref bIfChanged);
  423. return bIfChanged;
  424. }
  425. private bool PostgreSqlFormatChanged()
  426. {
  427. bool bIfChanged = false;
  428. if (!lstLoadingSource.Contains("PostgreSqlFormat")) return bIfChanged;
  429. PostgreSqlFormat.PostgreSqlFileDateColumnFormat = TextBoxChangedValue(PostgreSqlFormat.PostgreSqlFileDateColumnFormat, txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible, ref bIfChanged);
  430. PostgreSqlFormat.AutoSql.PostgreSqlViewName = TextBoxChangedValue(PostgreSqlFormat.AutoSql.PostgreSqlViewName, txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible, ref bIfChanged);
  431. PostgreSqlFormat.AutoSql.PostgreSqlViewSql = TextBoxChangedValue(PostgreSqlFormat.AutoSql.PostgreSqlViewSql, txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible, ref bIfChanged);
  432. return bIfChanged;
  433. }
  434. private bool KingbaseFormatChanged()
  435. {
  436. bool bIfChanged = false;
  437. if (!lstLoadingSource.Contains("KingbaseFormat")) return bIfChanged;
  438. KingbaseFormat.KingbaseFileDateColumnFormat = TextBoxChangedValue(KingbaseFormat.KingbaseFileDateColumnFormat, txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible, ref bIfChanged);
  439. KingbaseFormat.AutoSql.KingbaseViewName = TextBoxChangedValue(KingbaseFormat.AutoSql.KingbaseViewName, txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible, ref bIfChanged);
  440. KingbaseFormat.AutoSql.KingbaseViewSql = TextBoxChangedValue(KingbaseFormat.AutoSql.KingbaseViewSql, txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible, ref bIfChanged);
  441. return bIfChanged;
  442. }
  443. private string TextBoxChangedValue(string strClassValue,TextBox textBox,string strDetailValue,ref bool bIfChanged)
  444. {
  445. string strNewValue = "";
  446. if (textBox.Text != "" && textBox.Text != strDetailValue)
  447. strNewValue = textBox.Text;
  448. if (strNewValue != strClassValue)
  449. {
  450. strClassValue = strNewValue;
  451. bIfChanged = true;
  452. }
  453. return strClassValue;
  454. }
  455. //private void bTextBoxChanged(string strClassValue, TextBox textBox, string strDetailValue, ref bool bIfChanged)
  456. //{
  457. // string strNewValue = "";
  458. // if (textBox.Text != "" && textBox.Text != strDetailValue)
  459. // strNewValue = textBox.Text;
  460. // if (strNewValue != strClassValue)
  461. // {
  462. // strClassValue = strNewValue;
  463. // bIfChanged = true;
  464. // }
  465. //}
  466. private bool ExcelFormatChanged()
  467. {
  468. bool bIfChanged = false;
  469. if (!lstLoadingSource.Contains("ExcelFormat")) return bIfChanged;
  470. if (this.cbxExcelOldVersion.Checked != (ExcelFormat.ExcelFileVersion == "0" ? true : false))
  471. {
  472. ExcelFormat.ExcelFileVersion = this.cbxExcelOldVersion.Checked ? "0" : "1";
  473. bIfChanged = true;
  474. }
  475. ExcelFormat.ExcelFileDateColumnFormat=TextBoxChangedValue(ExcelFormat.ExcelFileDateColumnFormat, txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible,ref bIfChanged);
  476. ExcelFormat.ExcelFileNameFormat=TextBoxChangedValue(ExcelFormat.ExcelFileNameFormat, txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible, ref bIfChanged);
  477. if (cbxExcelReadFile.Checked != (ExcelFormat.ReadExcelFileMode == "0" ? true : false))
  478. {
  479. ExcelFormat.ReadExcelFileMode = cbxExcelReadFile.Checked ? "0" : "1";
  480. bIfChanged = true;
  481. }
  482. ExcelFormat.AutoSql.ExcelViewName=TextBoxChangedValue(ExcelFormat.AutoSql.ExcelViewName, txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible,ref bIfChanged);
  483. ExcelFormat.AutoSql.ExcelViewSql=TextBoxChangedValue(ExcelFormat.AutoSql.ExcelViewSql, txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible, ref bIfChanged);
  484. return bIfChanged;
  485. }
  486. #region Excel界面事件
  487. private void txtExcelSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  488. {
  489. DefaultTextBoxShowLeaveValue(txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible);
  490. }
  491. private void txtExcelSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  492. {
  493. DefaultTextBoxShowEnterValue(txtExcelSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtExcelSpecialDateColumnFormat_Decrible);
  494. }
  495. private void txtExcelFileNameFormat_Leave(object sender, EventArgs e)
  496. {
  497. DefaultTextBoxShowLeaveValue(txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible);
  498. }
  499. private void txtExcelFileNameFormat_Enter(object sender, EventArgs e)
  500. {
  501. DefaultTextBoxShowEnterValue(txtExcelFileNameFormat, SourceSettingTextBoxDecrible.txtExcelFileNameFormat_Decrible);
  502. }
  503. private void txtExcelAutoSqlName_Leave(object sender, EventArgs e)
  504. {
  505. DefaultTextBoxShowLeaveValue(txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible);
  506. }
  507. private void txtExcelAutoSqlName_Enter(object sender, EventArgs e)
  508. {
  509. DefaultTextBoxShowEnterValue(txtExcelAutoSqlName, SourceSettingTextBoxDecrible.txtExcelAutoSqlName_Decrible);
  510. }
  511. private void txtExcelAutoSql_Leave(object sender, EventArgs e)
  512. {
  513. DefaultTextBoxShowLeaveValue(txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible);
  514. }
  515. private void txtExcelAutoSql_Enter(object sender, EventArgs e)
  516. {
  517. DefaultTextBoxShowEnterValue(txtExcelAutoSql, SourceSettingTextBoxDecrible.txtExcelAutoSql_Decrible);
  518. }
  519. private void cbxExcelOldVersion_CheckedChanged(object sender, EventArgs e)
  520. {
  521. cbxExcelNewVersion.Checked = !cbxExcelOldVersion.Checked;
  522. }
  523. private void cbxExcelNewVersion_CheckedChanged(object sender, EventArgs e)
  524. {
  525. cbxExcelOldVersion.Checked = !cbxExcelNewVersion.Checked;
  526. }
  527. private void cbxExcelReadFile_CheckedChanged(object sender, EventArgs e)
  528. {
  529. cbxExcelReadFolder.Checked = !cbxExcelReadFile.Checked;
  530. }
  531. private void cbxExcelReadFolder_CheckedChanged(object sender, EventArgs e)
  532. {
  533. cbxExcelReadFile.Checked = !cbxExcelReadFolder.Checked;
  534. }
  535. #endregion
  536. #region FoxPro界面事件
  537. private void cbxFoxProReadFile_CheckedChanged(object sender, EventArgs e)
  538. {
  539. cbxFoxProReadFolder.Checked = !cbxFoxProReadFile.Checked;
  540. }
  541. private void cbxFoxProReadFolder_CheckedChanged(object sender, EventArgs e)
  542. {
  543. cbxFoxProReadFile.Checked = !cbxFoxProReadFolder.Checked;
  544. }
  545. private void txtFoxProSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  546. {
  547. DefaultTextBoxShowLeaveValue(txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible);
  548. }
  549. private void txtFoxProSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  550. {
  551. DefaultTextBoxShowEnterValue(txtFoxProSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtFoxProSpecialDateColumnFormat_Decrible);
  552. }
  553. private void txtFoxProFileNameFormat_Leave(object sender, EventArgs e)
  554. {
  555. DefaultTextBoxShowLeaveValue(txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible);
  556. }
  557. private void txtFoxProFileNameFormat_Enter(object sender, EventArgs e)
  558. {
  559. DefaultTextBoxShowEnterValue(txtFoxProFileNameFormat, SourceSettingTextBoxDecrible.txtFoxProFileNameFormat_Decrible);
  560. }
  561. private void txtFoxProAutoSqlName_Leave(object sender, EventArgs e)
  562. {
  563. DefaultTextBoxShowLeaveValue(txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible);
  564. }
  565. private void txtFoxProAutoSqlName_Enter(object sender, EventArgs e)
  566. {
  567. DefaultTextBoxShowEnterValue(txtFoxProAutoSqlName, SourceSettingTextBoxDecrible.txtFoxProAutoSqlName_Decrible);
  568. }
  569. private void txtFoxProAutoSql_Leave(object sender, EventArgs e)
  570. {
  571. DefaultTextBoxShowLeaveValue(txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible);
  572. }
  573. private void txtFoxProAutoSql_Enter(object sender, EventArgs e)
  574. {
  575. DefaultTextBoxShowEnterValue(txtFoxProAutoSql, SourceSettingTextBoxDecrible.txtFoxProAutoSql_Decrible);
  576. }
  577. private void txtFoxProSpecialMethodName_Leave(object sender, EventArgs e)
  578. {
  579. DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible);
  580. }
  581. private void txtFoxProSpecialMethodName_Enter(object sender, EventArgs e)
  582. {
  583. DefaultTextBoxShowEnterValue(txtFoxProSpecialMethodName, SourceSettingTextBoxDecrible.txtFoxProSpecialMethodName_Decrible);
  584. }
  585. private void txtFoxProSpecialMethod_Leave(object sender, EventArgs e)
  586. {
  587. DefaultTextBoxShowLeaveValue(txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible);
  588. }
  589. private void txtFoxProSpecialMethod_Enter(object sender, EventArgs e)
  590. {
  591. DefaultTextBoxShowEnterValue(txtFoxProSpecialMethod, SourceSettingTextBoxDecrible.txtFoxProSpecialMethod_Decrible);
  592. }
  593. #endregion
  594. #region Access界面事件
  595. private void cbxAccessOldVersion_CheckedChanged(object sender, EventArgs e)
  596. {
  597. cbxAccessNewVersion.Checked = !cbxAccessOldVersion.Checked;
  598. }
  599. private void cbxAccessNewVersion_CheckedChanged(object sender, EventArgs e)
  600. {
  601. cbxAccessOldVersion.Checked = !cbxAccessNewVersion.Checked;
  602. }
  603. private void cbxAccessReadFile_CheckedChanged(object sender, EventArgs e)
  604. {
  605. cbxAccessReadFolder.Checked = !cbxAccessReadFile.Checked;
  606. }
  607. private void cbxAccessReadFolder_CheckedChanged(object sender, EventArgs e)
  608. {
  609. cbxAccessReadFile.Checked = !cbxAccessReadFolder.Checked;
  610. }
  611. private void txtAccessSuffix_Leave(object sender, EventArgs e)
  612. {
  613. DefaultTextBoxShowLeaveValue(txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible);
  614. }
  615. private void txtAccessSuffix_Enter(object sender, EventArgs e)
  616. {
  617. DefaultTextBoxShowEnterValue(txtAccessSuffix, SourceSettingTextBoxDecrible.txtAccessSuffix_Decrible);
  618. }
  619. private void txtAccessSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  620. {
  621. DefaultTextBoxShowLeaveValue(txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible);
  622. }
  623. private void txtAccessSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  624. {
  625. DefaultTextBoxShowEnterValue(txtAccessSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtAccessSpecialDateColumnFormat_Decrible);
  626. }
  627. private void txtAccessFileName_Leave(object sender, EventArgs e)
  628. {
  629. DefaultTextBoxShowLeaveValue(txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible);
  630. }
  631. private void txtAccessFileName_Enter(object sender, EventArgs e)
  632. {
  633. DefaultTextBoxShowEnterValue(txtAccessFileName, SourceSettingTextBoxDecrible.txtAccessFileName_Decrible);
  634. }
  635. private void txtAccessAutoSqlName_Leave(object sender, EventArgs e)
  636. {
  637. DefaultTextBoxShowLeaveValue(txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible);
  638. }
  639. private void txtAccessAutoSqlName_Enter(object sender, EventArgs e)
  640. {
  641. DefaultTextBoxShowEnterValue(txtAccessAutoSqlName, SourceSettingTextBoxDecrible.txtAccessAutoSqlName_Decrible);
  642. }
  643. private void txtAccessAutoSql_Leave(object sender, EventArgs e)
  644. {
  645. DefaultTextBoxShowLeaveValue(txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible);
  646. }
  647. private void txtAccessAutoSql_Enter(object sender, EventArgs e)
  648. {
  649. DefaultTextBoxShowEnterValue(txtAccessAutoSql, SourceSettingTextBoxDecrible.txtAccessAutoSql_Decrible);
  650. }
  651. #endregion
  652. #region Sqlite界面事件
  653. private void cbxSqliteReadFile_CheckedChanged(object sender, EventArgs e)
  654. {
  655. cbxSqliteReadFolder.Checked = !cbxSqliteReadFile.Checked;
  656. }
  657. private void cbxSqliteReadFolder_CheckedChanged(object sender, EventArgs e)
  658. {
  659. cbxSqliteReadFile.Checked = !cbxSqliteReadFolder.Checked;
  660. }
  661. private void txtSqliteSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  662. {
  663. DefaultTextBoxShowLeaveValue(txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible);
  664. }
  665. private void txtSqliteSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  666. {
  667. DefaultTextBoxShowEnterValue(txtSqliteSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqliteSpecialDateColumnFormat_Decrible);
  668. }
  669. private void txtSqliteFileNameFormat_Leave(object sender, EventArgs e)
  670. {
  671. DefaultTextBoxShowLeaveValue(txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible);
  672. }
  673. private void txtSqliteFileNameFormat_Enter(object sender, EventArgs e)
  674. {
  675. DefaultTextBoxShowEnterValue(txtSqliteFileNameFormat, SourceSettingTextBoxDecrible.txtSqliteFileNameFormat_Decrible);
  676. }
  677. private void txtSqliteAutoSqlName_Leave(object sender, EventArgs e)
  678. {
  679. DefaultTextBoxShowLeaveValue(txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible);
  680. }
  681. private void txtSqliteAutoSqlName_Enter(object sender, EventArgs e)
  682. {
  683. DefaultTextBoxShowEnterValue(txtSqliteAutoSqlName, SourceSettingTextBoxDecrible.txtSqliteAutoSqlName_Decrible);
  684. }
  685. private void txtSqliteAutoSql_Leave(object sender, EventArgs e)
  686. {
  687. DefaultTextBoxShowLeaveValue(txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible);
  688. }
  689. private void txtSqliteAutoSql_Enter(object sender, EventArgs e)
  690. {
  691. DefaultTextBoxShowEnterValue(txtSqliteAutoSql, SourceSettingTextBoxDecrible.txtSqliteAutoSql_Decrible);
  692. }
  693. #endregion
  694. #region SqlServer界面事件
  695. private void txtSqlServerSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  696. {
  697. DefaultTextBoxShowLeaveValue(txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible);
  698. }
  699. private void txtSqlServerSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  700. {
  701. DefaultTextBoxShowEnterValue(txtSqlServerSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtSqlServerSpecialDateColumnFormat_Decrible);
  702. }
  703. private void txtSqlServerConnection_Leave(object sender, EventArgs e)
  704. {
  705. DefaultTextBoxShowLeaveValue(txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible);
  706. }
  707. private void txtSqlServerConnection_Enter(object sender, EventArgs e)
  708. {
  709. DefaultTextBoxShowEnterValue(txtSqlServerConnection, SourceSettingTextBoxDecrible.txtSqlServerConnection_Decrible);
  710. }
  711. private void txtSqlServerAutoSqlName_Leave(object sender, EventArgs e)
  712. {
  713. DefaultTextBoxShowLeaveValue(txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible);
  714. }
  715. private void txtSqlServerAutoSqlName_Enter(object sender, EventArgs e)
  716. {
  717. DefaultTextBoxShowEnterValue(txtSqlServerAutoSqlName, SourceSettingTextBoxDecrible.txtSqlServerAutoSqlName_Decrible);
  718. }
  719. private void txtSqlServerAutoSql_Leave(object sender, EventArgs e)
  720. {
  721. DefaultTextBoxShowLeaveValue(txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible);
  722. }
  723. private void txtSqlServerAutoSql_Enter(object sender, EventArgs e)
  724. {
  725. DefaultTextBoxShowEnterValue(txtSqlServerAutoSql, SourceSettingTextBoxDecrible.txtSqlServerAutoSql_Decrible);
  726. }
  727. #endregion
  728. #region MySql界面事件
  729. private void txtMySqlSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  730. {
  731. DefaultTextBoxShowLeaveValue(txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible);
  732. }
  733. private void txtMySqlSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  734. {
  735. DefaultTextBoxShowEnterValue(txtMySqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtMySqlSpecialDateColumnFormat_Decrible);
  736. }
  737. private void txtMySqlAutoSqlName_Leave(object sender, EventArgs e)
  738. {
  739. DefaultTextBoxShowLeaveValue(txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible);
  740. }
  741. private void txtMySqlAutoSqlName_Enter(object sender, EventArgs e)
  742. {
  743. DefaultTextBoxShowEnterValue(txtMySqlAutoSqlName, SourceSettingTextBoxDecrible.txtMySqlAutoSqlName_Decrible);
  744. }
  745. private void txtMySqlAutoSql_Leave(object sender, EventArgs e)
  746. {
  747. DefaultTextBoxShowLeaveValue(txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible);
  748. }
  749. private void txtMySqlAutoSql_Enter(object sender, EventArgs e)
  750. {
  751. DefaultTextBoxShowEnterValue(txtMySqlAutoSql, SourceSettingTextBoxDecrible.txtMySqlAutoSql_Decrible);
  752. }
  753. #endregion
  754. #region Oracle界面事件
  755. private void txtOracleSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  756. {
  757. DefaultTextBoxShowLeaveValue(txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible);
  758. }
  759. private void txtOracleSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  760. {
  761. DefaultTextBoxShowEnterValue(txtOracleSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtOracleSpecialDateColumnFormat_Decrible);
  762. }
  763. private void txtOracleAutoSqlName_Leave(object sender, EventArgs e)
  764. {
  765. DefaultTextBoxShowLeaveValue(txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible);
  766. }
  767. private void txtOracleAutoSqlName_Enter(object sender, EventArgs e)
  768. {
  769. DefaultTextBoxShowEnterValue(txtOracleAutoSqlName, SourceSettingTextBoxDecrible.txtOracleAutoSqlName_Decrible);
  770. }
  771. private void txtOracleAutoSql_Leave(object sender, EventArgs e)
  772. {
  773. DefaultTextBoxShowLeaveValue(txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible);
  774. }
  775. private void txtOracleAutoSql_Enter(object sender, EventArgs e)
  776. {
  777. DefaultTextBoxShowEnterValue(txtOracleAutoSql, SourceSettingTextBoxDecrible.txtOracleAutoSql_Decrible);
  778. }
  779. #endregion
  780. #region Txt界面事件
  781. private void cbxNormalFileReadFile_CheckedChanged(object sender, EventArgs e)
  782. {
  783. cbxNormalFileReadFolder.Checked = !cbxNormalFileReadFile.Checked;
  784. }
  785. private void cbxNormalFileReadFolder_CheckedChanged(object sender, EventArgs e)
  786. {
  787. cbxNormalFileReadFile.Checked = !cbxNormalFileReadFolder.Checked;
  788. }
  789. private void txtNormalFileSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  790. {
  791. DefaultTextBoxShowLeaveValue(txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible);
  792. }
  793. private void txtNormalFileSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  794. {
  795. DefaultTextBoxShowEnterValue(txtNormalFileSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtNormalFileSpecialDateColumnFormat_Decrible);
  796. }
  797. private void txtNormalFileNameFormat_Leave(object sender, EventArgs e)
  798. {
  799. DefaultTextBoxShowLeaveValue(txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible);
  800. }
  801. private void txtNormalFileNameFormat_Enter(object sender, EventArgs e)
  802. {
  803. DefaultTextBoxShowEnterValue(txtNormalFileNameFormat, SourceSettingTextBoxDecrible.txtNormalFileNameFormat_Decrible);
  804. }
  805. private void txtNormalFileSuffix_Leave(object sender, EventArgs e)
  806. {
  807. DefaultTextBoxShowLeaveValue(txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible);
  808. }
  809. private void txtNormalFileSuffix_Enter(object sender, EventArgs e)
  810. {
  811. DefaultTextBoxShowEnterValue(txtNormalFileSuffix, SourceSettingTextBoxDecrible.txtNormalFileSuffix_Decrible);
  812. }
  813. private void txtNormalFileReadDataMode_Leave(object sender, EventArgs e)
  814. {
  815. DefaultTextBoxShowLeaveValue(txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible);
  816. }
  817. private void txtNormalFileReadDataMode_Enter(object sender, EventArgs e)
  818. {
  819. DefaultTextBoxShowEnterValue(txtNormalFileReadDataMode, SourceSettingTextBoxDecrible.txtNormalFileReadDataMode_Decrible);
  820. }
  821. private void txtNormalFileReadSplitMode_Leave(object sender, EventArgs e)
  822. {
  823. DefaultTextBoxShowLeaveValue(txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible);
  824. }
  825. private void txtNormalFileReadSplitMode_Enter(object sender, EventArgs e)
  826. {
  827. DefaultTextBoxShowEnterValue(txtNormalFileReadSplitMode, SourceSettingTextBoxDecrible.txtNormalFileReadSplitMode_Decrible);
  828. }
  829. private void cbxNormalFileCustomDate_CheckedChanged(object sender, EventArgs e)
  830. {
  831. cbxNormalFileNoCustomDate.Checked = !cbxNormalFileCustomDate.Checked;
  832. }
  833. private void cbxNormalFileNoCustomDate_CheckedChanged(object sender, EventArgs e)
  834. {
  835. cbxNormalFileCustomDate.Checked = !cbxNormalFileNoCustomDate.Checked;
  836. }
  837. #endregion
  838. #region PostgreSQL界面事件
  839. private void txtPostgreSqlSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  840. {
  841. DefaultTextBoxShowLeaveValue(txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible);
  842. }
  843. private void txtPostgreSqlSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  844. {
  845. DefaultTextBoxShowEnterValue(txtPostgreSqlSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtPostgreSqlSpecialDateColumnFormat_Decrible);
  846. }
  847. private void txtPostgreSqlAutoSqlName_Leave(object sender, EventArgs e)
  848. {
  849. DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible);
  850. }
  851. private void txtPostgreSqlAutoSqlName_Enter(object sender, EventArgs e)
  852. {
  853. DefaultTextBoxShowEnterValue(txtPostgreSqlAutoSqlName, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSqlName_Decrible);
  854. }
  855. private void txtPostgreSqlAutoSql_Leave(object sender, EventArgs e)
  856. {
  857. DefaultTextBoxShowLeaveValue(txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible);
  858. }
  859. private void txtPostgreSqlAutoSql_Enter(object sender, EventArgs e)
  860. {
  861. DefaultTextBoxShowEnterValue(txtPostgreSqlAutoSql, SourceSettingTextBoxDecrible.txtPostgreSqlAutoSql_Decrible);
  862. }
  863. #endregion
  864. #region Kingbase界面事件
  865. private void txtKingbaseSpecialDateColumnFormat_Leave(object sender, EventArgs e)
  866. {
  867. DefaultTextBoxShowLeaveValue(txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible);
  868. }
  869. private void txtKingbaseSpecialDateColumnFormat_Enter(object sender, EventArgs e)
  870. {
  871. DefaultTextBoxShowEnterValue(txtKingbaseSpecialDateColumnFormat, SourceSettingTextBoxDecrible.txtKingbaseSpecialDateColumnFormat_Decrible);
  872. }
  873. private void txtKingbaseAutoSqlName_Leave(object sender, EventArgs e)
  874. {
  875. DefaultTextBoxShowLeaveValue(txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible);
  876. }
  877. private void txtKingbaseAutoSqlName_Enter(object sender, EventArgs e)
  878. {
  879. DefaultTextBoxShowEnterValue(txtKingbaseAutoSqlName, SourceSettingTextBoxDecrible.txtKingbaseAutoSqlName_Decrible);
  880. }
  881. private void txtKingbaseAutoSql_Leave(object sender, EventArgs e)
  882. {
  883. DefaultTextBoxShowLeaveValue(txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible);
  884. }
  885. private void txtKingbaseAutoSql_Enter(object sender, EventArgs e)
  886. {
  887. DefaultTextBoxShowEnterValue(txtKingbaseAutoSql, SourceSettingTextBoxDecrible.txtKingbaseAutoSql_Decrible);
  888. }
  889. #endregion
  890. private void frmSourceSetting_Resize(object sender, EventArgs e)
  891. {
  892. arrayFields();
  893. btnOK.Left = (this.Width - btnOK.Width) / 2;
  894. }
  895. private void frmSourceSetting_Shown(object sender, EventArgs e)
  896. {
  897. arrayFields();
  898. btnOK.Left = (this.Width - btnOK.Width) / 2;
  899. }
  900. private void arrayFields() {
  901. switch (tabcDS.SelectedIndex)
  902. {
  903. case 0:
  904. FieldLine[] fields = {
  905. new FieldLine(lbExcelDateFormat,txtExcelSpecialDateColumnFormat),
  906. new FieldLine(lblExcelRemoteUser,txtExcelFileNameFormat),
  907. new FieldLine(lbExcelDynQuery,txtExcelAutoSqlName)
  908. };
  909. FormSizeHelper.Arrange(tabExcel, fields);
  910. txtExcelAutoSql.Width = txtExcelAutoSqlName.Width;
  911. txtExcelAutoSql.Height = tabExcel.Height - txtExcelAutoSql.Top - 24;
  912. break;
  913. }
  914. }
  915. }
  916. }