CNAS取数仪器端升级
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

73 lignes
2.1KB

  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. using System.Xml.Serialization;
  12. namespace CNAS_DBSync
  13. {
  14. public partial class frmSystemSetting : Form
  15. {
  16. private SystemFormatConfig systemConfig;
  17. public frmSystemSetting()
  18. {
  19. InitializeComponent();
  20. }
  21. private void frmSystemSetting_Load(object sender, EventArgs e)
  22. {
  23. //加载配置信息
  24. systemConfig= FileOperation.GetSystemFormatConfigData();
  25. if (systemConfig.TableInfoMode == "1")
  26. {
  27. this.cbxManual.Checked = true;
  28. this.cbxAutomatic.Checked = false;
  29. }
  30. else
  31. {
  32. this.cbxManual.Checked = false;
  33. this.cbxAutomatic.Checked = true;
  34. }
  35. int days = 0;
  36. if (Int32.TryParse(systemConfig.ShowDelayDays, out days))
  37. {
  38. this.numpShowDataDays.Value = -days;
  39. }
  40. if (Int32.TryParse(systemConfig.ShowLogDays, out days))
  41. {
  42. this.numpLogDataDays.Value = -days;
  43. }
  44. }
  45. private void btnOK_Click(object sender, EventArgs e)
  46. {
  47. //判断合法性,存储配置信息
  48. systemConfig.TableInfoMode = this.cbxManual.Checked ? "1" : "0";
  49. systemConfig.ShowDelayDays = (-numpShowDataDays.Value).ToString();
  50. systemConfig.ShowLogDays = (-numpLogDataDays.Value).ToString();
  51. bool bSave = FileOperation.SaveSystemFormatConfigData(systemConfig);
  52. MessageBox.Show(bSave?"保存成功!":"保存失败!");
  53. }
  54. private void cbxManual_CheckedChanged(object sender, EventArgs e)
  55. {
  56. cbxAutomatic.Checked = !cbxManual.Checked;
  57. }
  58. private void cbxAutomatic_CheckedChanged(object sender, EventArgs e)
  59. {
  60. cbxManual.Checked = !cbxAutomatic.Checked;
  61. }
  62. }
  63. }