using System; using AllBase.Helper; using TemuKJD.BaseForms; namespace TemuKJD.KJDForms.SystemForms { public partial class SystemViolationDetectionForm : BaseForm { public SystemViolationDetectionForm() { InitializeComponent(); var settings = GlobalConfig.GlobalSettings; chkAutoReport.Checked = settings.AutoReportViolationProducts; chkAutoExcludeOnUpload.Checked = settings.AutoExcludeViolationProductsOnUpload; chkAutoDelist.Checked = settings.AutoDelistViolationProducts; chkAutoReport.CheckedChanged += Settings_CheckedChanged; chkAutoExcludeOnUpload.CheckedChanged += Settings_CheckedChanged; chkAutoDelist.CheckedChanged += Settings_CheckedChanged; } private void Settings_CheckedChanged(object sender, EventArgs e) { var settings = GlobalConfig.GlobalSettings; settings.AutoReportViolationProducts = chkAutoReport.Checked; settings.AutoExcludeViolationProductsOnUpload = chkAutoExcludeOnUpload.Checked; settings.AutoDelistViolationProducts = chkAutoDelist.Checked; StartUp.SaveGlobalSettings(); } } }