Esempio n. 1
0
        //Чтение списка параметров для записи в архив
        public void ReadArchiveParams()
        {
            try
            {
                AddEvent("Загрузка архивных параметров");
                ArchiveProject = new ArchiveProject(Code, Name, ReportType.Calc, LastChange);
                ArchiveParams.Clear();
                using (var db = new DaoDb(File))
                {
                    using (var rec = new ReaderAdo(db, "SELECT CalcParamsArchive.* FROM CalcParamsArchive INNER JOIN CalcParams ON CalcParams.CalcParamId = CalcParamsArchive.CalcParamId WHERE CalcParams.CalcOn=True"))
                        while (rec.Read())
                        {
                            var par = new CalcParamArchive(rec, this);
                            ArchiveProject.AddParam(par.ArchiveParam);
                            ArchiveParams.Add(par.ArchiveParam.FullCode, par);
                        }

                    PrevParams.Clear();
                    if (IsLastBase || IsLastHour || IsLastDay)
                    {
                        PrevLastReport = new ArchiveReport(Code + "_Last_" + ThreadCalc.FullThreadName, Name, ReportType.Calc, LastChange);
                    }
                    if (IsManyBase || IsManyHour || IsManyDay || IsManyMoments)
                    {
                        PrevManyReport = new ArchiveReport(Code + "_Many_" + ThreadCalc.FullThreadName, Name, ReportType.Calc, LastChange);
                    }
                    using (var rec = new ReaderAdo(db, "SELECT * FROM PrevParams"))
                        while (rec.Read())
                        {
                            var p = new Prev(rec, this);
                            PrevParams.Add(p.Code, p);
                            if (p.LastReportParam != null)
                            {
                                PrevLastReport.AddParam(p.LastReportParam);
                            }
                            if (p.ManyReportParam != null)
                            {
                                PrevManyReport.AddParam(p.ManyReportParam);
                            }
                        }
                }
            }
            catch (Exception ex)
            {
                AddError("Ошибка при чтении списка архивных параметров", ex);
            }
        }
Esempio n. 2
0
 public InnerArchiveProject(ArchiveProject project)
 {
     Project = project;
 }