This commit is contained in:
Татьяна Артамонова 2023-11-09 14:52:09 +04:00
parent 1bd9dce5f8
commit 2cea47984c

View File

@ -161,7 +161,7 @@ namespace UniversityView
List<ColumnDefinition> columnDefinitions = new() List<ColumnDefinition> columnDefinitions = new()
{ {
new ColumnDefinition { Header = "Идентификатор", PropertyName = "Id", Width = 11 }, new ColumnDefinition { Header = "ID", PropertyName = "Id", Width = 11 },
new ColumnDefinition { Header = "Личные данные", PropertyName = "PersonalData", Width = 11 }, new ColumnDefinition { Header = "Личные данные", PropertyName = "PersonalData", Width = 11 },
new ColumnDefinition { Header = "Личные данные", PropertyName = "PersonalData1", Width = 11 }, new ColumnDefinition { Header = "Личные данные", PropertyName = "PersonalData1", Width = 11 },
new ColumnDefinition { Header = "Направление", PropertyName = "DirectionName", Width = 21 } new ColumnDefinition { Header = "Направление", PropertyName = "DirectionName", Width = 21 }
@ -169,7 +169,7 @@ namespace UniversityView
List<ColumnDefinition> columnDefinitions2 = new() List<ColumnDefinition> columnDefinitions2 = new()
{ {
new ColumnDefinition { Header = "Идентификатор", PropertyName = "Id", Width = 11 }, new ColumnDefinition { Header = "ID", PropertyName = "Id", Width = 11 },
new ColumnDefinition { Header = "ФИО", PropertyName = "FIO", Width = 11 }, new ColumnDefinition { Header = "ФИО", PropertyName = "FIO", Width = 11 },
new ColumnDefinition { Header = "Электронная почта", PropertyName = "Email", Width = 70 }, new ColumnDefinition { Header = "Электронная почта", PropertyName = "Email", Width = 70 },
new ColumnDefinition { Header = "Направление", PropertyName = "DirectionName", Width = 21 } new ColumnDefinition { Header = "Направление", PropertyName = "DirectionName", Width = 21 }
@ -222,7 +222,11 @@ namespace UniversityView
int count = 0; int count = 0;
for (int j = 0; j < listStudents.Count; j++) for (int j = 0; j < listStudents.Count; j++)
{ {
if (listStudents[j].DirectionName == listDirections[i].Name) count++; string[] dirs = listStudents[j].DirectionName.Split(";");
foreach (var dir in dirs)
{
if (dir == listDirections[i].Name) count++;
}
} }
data.Add((listDirections[i].Name, count)); data.Add((listDirections[i].Name, count));
} }
@ -254,6 +258,7 @@ namespace UniversityView
{ {
form.ShowDialog(); form.ShowDialog();
} }
LoadData();
} }
} }
} }