using CnasSynchronusClient; using CnasSynchrousModel; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Xml.Serialization; namespace CNAS_DBSync { public partial class frmSystemSetting : Form { private SystemFormatConfig systemConfig; public frmSystemSetting() { InitializeComponent(); } private void frmSystemSetting_Load(object sender, EventArgs e) { //加载配置信息 systemConfig= FileOperation.GetSystemFormatConfigData(); if (systemConfig.TableInfoMode == "1") { this.cbxManual.Checked = true; this.cbxAutomatic.Checked = false; } else { this.cbxManual.Checked = false; this.cbxAutomatic.Checked = true; } int days = 0; if (Int32.TryParse(systemConfig.ShowDelayDays, out days)) { this.numpShowDataDays.Value = -days; } if (Int32.TryParse(systemConfig.ShowLogDays, out days)) { this.numpLogDataDays.Value = -days; } } private void btnOK_Click(object sender, EventArgs e) { //判断合法性,存储配置信息 systemConfig.TableInfoMode = this.cbxManual.Checked ? "1" : "0"; systemConfig.ShowDelayDays = (-numpShowDataDays.Value).ToString(); systemConfig.ShowLogDays = (-numpLogDataDays.Value).ToString(); bool bSave = FileOperation.SaveSystemFormatConfigData(systemConfig); MessageBox.Show(bSave?"保存成功!":"保存失败!"); } private void cbxManual_CheckedChanged(object sender, EventArgs e) { cbxAutomatic.Checked = !cbxManual.Checked; } private void cbxAutomatic_CheckedChanged(object sender, EventArgs e) { cbxManual.Checked = !cbxAutomatic.Checked; } } }