Example #1
0
        public Report GenerateReport()
        {
            var workerReports = Workers.Select(t => new FormDayReport(t, Log, Date.Date)).Cast <IFormReport>().ToList();


            IFormReport bossReport = new FormDayReport(Boss, Log, Date.Date);

            workerReports.Add(bossReport);


            Report = new Report(workerReports);
            using ReportContext db = new ReportContext();
            db.Reports.Add(Report);
            return(Report);
        }
Example #2
0
        public Report GenerateReport()
        {
            List <IFormReport> workerReports = new List <IFormReport>();


            foreach (var t in Workers)
            {
                IFormReport newReport = new FormBossReport(t, Date.Date, Log);
                workerReports.Add(newReport);
            }
            IFormReport bossReport = new FormDayReport(Boss, Log, Date.Date);

            workerReports.Add(bossReport);


            Report = new Report(workerReports);
            using ReportContext db = new ReportContext();
            db.Reports.Add(Report);
            return(Report);
        }