コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
 public ReportSettingsPage()
 {
     InitializeComponent();
     DataContext = new
     {
         Collection = ReportsSettingController.instance().Collection
     };
 }
コード例 #4
0
 private void loadModels()
 {
     OvenController.instance();
     DetailsController.instance();
     RecipientsController.instance();
     SupplyController.instance();
     SupplyDetailsController.instance();
     WriteoffController.instance();
     WriteoffDetailsController.instance();
     ReportsSettingController.instance();
 }
コード例 #5
0
        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();
            }
        }
コード例 #6
0
 protected override IController controller()
 {
     return(ReportsSettingController.instance());
 }