private void createBackup() { ReportsSetting reportSetting = ReportsSettingController.instance().getByProgramName("DBBackup"); if (reportSetting.NextDateCreated == null) { return; } DateTime nextDate = (DateTime)reportSetting.NextDateCreated; DateTime current = DateTime.Now; if (current < nextDate) { return; } try { DataBase.Backup(reportSetting.ReportPath); reportSetting.save(); } catch (Exception ex) { Log.WriteError("В ходе создания резервной копии произошли ошибки!\n" + ex.Message); } }
private void createWriteoffReportPeriod() { ReportsSetting reportSetting = ReportsSettingController.instance().getByProgramName("WriteoffReport"); if (reportSetting.NextDateCreated == null) { return; } DateTime nextDate = (DateTime)reportSetting.NextDateCreated; DateTime current = DateTime.Now; if (current < nextDate) { return; } DateTime prev = new DateTime(current.Year, current.Month, 1, 0, 0, 0); Reports.WriteoffReport report = new Reports.WriteoffReport(); report.Postfix = "сформирован автоматически, " + current.ToString("dd.MM.yyyy HH_mm_ss"); report.H1 = "Журнал списания с " + prev.ToString("dd.MM.yyyy") + " по " + nextDate.ToString("dd.MM.yyyy") + " (сформирован автоматически, " + current.ToString("dd.MM.yyyy HH:mm:ss") + ")"; if (report.Save(prev, nextDate)) { reportSetting.save(); } }
public ReportSettingsPage() { InitializeComponent(); DataContext = new { Collection = ReportsSettingController.instance().Collection }; }
private void loadModels() { OvenController.instance(); DetailsController.instance(); RecipientsController.instance(); SupplyController.instance(); SupplyDetailsController.instance(); WriteoffController.instance(); WriteoffDetailsController.instance(); ReportsSettingController.instance(); }
private void createAvailabilityReportPeriod() { ReportsSetting reportSetting = ReportsSettingController.instance().getByProgramName("AvailabilityReport"); if (reportSetting.NextDateCreated == null) { return; } DateTime nextDate = (DateTime)reportSetting.NextDateCreated; DateTime current = DateTime.Now; if (current < nextDate) { return; } Reports.AvailabilityReport report = new Reports.AvailabilityReport(); report.Postfix = "сформирован автоматически"; report.H1 = "Отчет наличия на " + nextDate.ToString("dd.MM.yyyy") + " (сформирован автоматически, " + current.ToString("dd.MM.yyyy HH:mm:ss") + ")"; if (report.Save()) { reportSetting.save(); } }
protected override IController controller() { return(ReportsSettingController.instance()); }