diff --git a/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs b/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs index e0141ce..e258b11 100644 --- a/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs +++ b/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs @@ -11,11 +11,58 @@ namespace UniversityBuisnessLogic.BuisnessLogic { ILogger _logger; IDisciplineStorage _disciplineStorage; + IStatementStorage _statementStorage; + IExaminationResultStorage _examinationResultStorage; - public ReportLogic(ILogger logger, IDisciplineStorage disciplineStorage) + public ReportLogic(ILogger logger, IDisciplineStorage disciplineStorage, + IStatementStorage statementStorage, IExaminationResultStorage examinationResultStorage) { _logger = logger; _disciplineStorage = disciplineStorage; + _statementStorage = statementStorage; + _examinationResultStorage = examinationResultStorage; + } + + public List GetStudens(ReportBindingModel model) + { + if (model == null) return new(); + + var results = _examinationResultStorage.GetFilteredList(new ExaminationResultSearchModel + { + From = model.From, + To = model.To, + }); + + var statements = _statementStorage.GetFilteredList(new StatementSearchModel + { + From = model.From, + To = model.To, + }); + + List list = new(); + + foreach (var result in results) + { + foreach(var student in result.Students.Values) + { + foreach(var statement in statements) + { + if (!student.Statements.ContainsKey(statement.Id)) continue; + + list.Add(new ReportStudentsViewModel + { + StudentName = student.Name, + ExaminationForm = result.ExaminationForm, + mark = result.Mark, + ExaminationResultDate = result.Date, + HoursCount = statement.HoursCount, + StatementDate = statement.Date + }); + } + } + } + + return list; } public List GetStudentDiscipline(ReportBindingModel model) @@ -45,5 +92,20 @@ namespace UniversityBuisnessLogic.BuisnessLogic return result; } + + public void SaveStudentsToExcel() + { + throw new NotImplementedException("Реализация в следующем этапе"); + } + + public void SaveStudentsToPdf() + { + throw new NotImplementedException("Реализация в следующем этапе"); + } + + public void SaveStudentsToWord() + { + throw new NotImplementedException("Реализация в следующем этапе"); + } } }