CNAS取数仪器端升级
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1218 行
60KB

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