From 2cea47984c04d72662a5505f853972312d7d0fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A2=D0=B0=D1=82=D1=8C=D1=8F=D0=BD=D0=B0=20=D0=90=D1=80?= =?UTF-8?q?=D1=82=D0=B0=D0=BC=D0=BE=D0=BD=D0=BE=D0=B2=D0=B0?= Date: Thu, 9 Nov 2023 14:52:09 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=81=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UniversityView/FormMain.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/UniversityView/FormMain.cs b/UniversityView/FormMain.cs index eaf868e..ffc3d73 100644 --- a/UniversityView/FormMain.cs +++ b/UniversityView/FormMain.cs @@ -161,7 +161,7 @@ namespace UniversityView List 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 = "PersonalData1", Width = 11 }, new ColumnDefinition { Header = "Направление", PropertyName = "DirectionName", Width = 21 } @@ -169,7 +169,7 @@ namespace UniversityView List 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 = "Email", Width = 70 }, new ColumnDefinition { Header = "Направление", PropertyName = "DirectionName", Width = 21 } @@ -222,7 +222,11 @@ namespace UniversityView int count = 0; 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)); } @@ -254,6 +258,7 @@ namespace UniversityView { form.ShowDialog(); } + LoadData(); } } }