make report logic student discipline

This commit is contained in:
MaxKarme 2023-04-08 23:34:04 +04:00
parent f29365f88c
commit 6abd26ea3c

View File

@ -23,6 +23,27 @@ namespace UniversityBuisnessLogic.BuisnessLogic
if (model == null || model.Students == null) return new();
var disciplines = _disciplineStorage.GetFullList();
List<ReportStudentDisciplineViewModel> 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;
}
}
}