From 6abd26ea3c78b2568c7e29c69454c57cae356d30 Mon Sep 17 00:00:00 2001 From: MaxKarme <91691525+MaxKarme@users.noreply.github.com> Date: Sat, 8 Apr 2023 23:34:04 +0400 Subject: [PATCH] make report logic student discipline --- .../BuisnessLogic/ReportLogic.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs b/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs index 277fee3..e0141ce 100644 --- a/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs +++ b/University/UniversityBuisnessLogic/BuisnessLogic/ReportLogic.cs @@ -23,6 +23,27 @@ namespace UniversityBuisnessLogic.BuisnessLogic if (model == null || model.Students == null) return new(); var disciplines = _disciplineStorage.GetFullList(); + List result = new(); + + foreach(var student in model.Students) + { + var record = new ReportStudentDisciplineViewModel + { + StudentName = student.Name, + }; + + foreach(var discipline in disciplines) + { + if(student.Statements.ContainsKey(discipline.Id)) + { + record.Disciplines.Add(discipline.Name); + } + } + + result.Add(record); + } + + return result; } } }