Beispiel #1
0
        public List <DomainReport> BuildReports(DateTime dateTime)
        {
            Interval dayInterval   = _intervalHelper.GetLastDay(dateTime);
            Interval weekInterval  = _intervalHelper.GetLastWeek(dateTime);
            Interval monthInterval = _intervalHelper.GetLastMonth(dateTime);

            ICompiler dayReportCompiler    = _compilerFactory.Create(dayInterval);
            ICompiler weekReportCompiler   = _compilerFactory.Create(weekInterval);
            ICompiler monthReportCompiler  = _compilerFactory.Create(monthInterval);
            ICompiler allDaysReortCompiler = _compilerFactory.Create(null);

            DomainReport dayReport     = dayReportCompiler.CompileReport();
            DomainReport weekReport    = weekReportCompiler.CompileReport(dayReport);
            DomainReport monthReport   = monthReportCompiler.CompileReport(dayReport);
            DomainReport allDaysReport = allDaysReortCompiler.CompileReport(dayReport);

            var reports = new List <DomainReport>
            {
                dayReport,
                weekReport,
                monthReport,
                allDaysReport
            };

            return(reports);
        }