private void OKsimpleButton_Click(object sender, EventArgs e) { if (!Directory.Exists($"{WorkPath}\\stf")) { Directory.CreateDirectory($"{WorkPath}\\stf"); } string TitleSettingPath = $"{WorkPath}\\stf\\reporttitle.json"; ReportTitleSetting TitleSetting = new ReportTitleSetting() { ContractNo = ContractNoTextEdit.Text, ElectNo = ElectNoTextEdit.Text }; File.WriteAllText(TitleSettingPath, JsonConvert.SerializeObject(TitleSetting, Formatting.Indented, new JsonSerializerSettings())); string FormatSettingPath = $"{WorkPath}\\stf\\format.json"; FileFormatSetting FormatSetting = new FileFormatSetting() { FileFormat = OutputFormatComboBoxEdit.SelectedIndex }; File.WriteAllText(FormatSettingPath, JsonConvert.SerializeObject(FormatSetting, Formatting.Indented, new JsonSerializerSettings())); XtraReportSetting.AutoExport = AutotoggleSwitch.IsOn; XtraReportSetting.Path = PathtextEdit.Text; XtraReportSetting.Day = Convert.ToInt32(DaycomboBoxEdit.Text); InitialMethod.Save_XtraReportSetting(XtraReportSetting); foreach (var item in exportElectricSettingUserControls) { item.Inserter_ReportConfig(); } Form1.accordionControl1.Enabled = true; Form1.FlyoutFlag = false; Form1.flyout.Close(); }