public Report GenerateReport(List<PersonWorkMonth> personWorkMonths, IPersonTimeManager personTimeManager)
        {
            var report = new Report();
            foreach (var personWorkMonth in personWorkMonths)
            {
                if (personWorkMonth.PersonTasks.Count == 0)
                {
                    report.Errors.Add(new NoTasksReportError(personWorkMonth.Person));
                }

                if (personWorkMonth.WorkDays.Count == 0)
                {
                    report.Errors.Add(new NoDaysReportError(personWorkMonth.Person));
                }

                report.Errors.Add(new NoTasksReportError(personWorkMonth.Person));
                report.Errors.Add(new NoDaysReportError(personWorkMonth.Person));

                personWorkMonth.WorkDays = personTimeManager.GetWorkDaysWithTasks(personWorkMonth.PersonTasks, personWorkMonth.WorkDays);

                var personReport = GetPersonReport(personWorkMonth);
                report.PersonReports.Add(personReport);
            }

            return report;
        }
        public void GenerateReport(Report report, Stream stream)
        {
            _binWriter = new StreamWriter(stream);
            _binWriter.WriteLine(HeaderString);

            foreach (var personWorkDayReports in report.PersonReports)
            {
                WritePersonWorkDay(personWorkDayReports);
            }
            _binWriter.Close();
        }
 public void SaveErrors(Report report, Action<List<ReportError>> errorWriter)
 {
     if (errorWriter != null)
         errorWriter(report.Errors);
 }