From 55b76c884014fe1626065e503bcd6ffda657bdab Mon Sep 17 00:00:00 2001 From: 1billy17 Date: Mon, 14 Apr 2025 17:45:48 +0300 Subject: [PATCH] =?UTF-8?q?session=201=20=D1=82=D0=B5=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D1=8C=20=D1=82=D0=BE=D1=87=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demko_term/AcceptStatementWindow.axaml.cs | 27 +++++++++++++----- demko_term/CreateApplicantWindow.axaml.cs | 6 ++-- demko_term/FormPersonalFileWindow.axaml | 2 +- demko_term/FormPersonalFileWindow.axaml.cs | 14 ++++++--- demko_term/HistoryWindow.axaml.cs | 8 +++--- demko_term/ManagerWindow.axaml.cs | 8 +++--- demko_term/VolunteerWindow.axaml.cs | 4 +-- demko_term/WorkerWindow.axaml.cs | 8 +++--- demko_term/bin/Debug/net8.0/demko_term.dll | Bin 87040 -> 88064 bytes demko_term/bin/Debug/net8.0/demko_term.pdb | Bin 35472 -> 35820 bytes .../obj/Debug/net8.0/Avalonia/demko_term.dll | Bin 87040 -> 88064 bytes .../obj/Debug/net8.0/Avalonia/demko_term.pdb | Bin 35472 -> 35820 bytes .../obj/Debug/net8.0/Avalonia/resources | Bin 17567 -> 17573 bytes .../Debug/net8.0/demko_term.AssemblyInfo.cs | 2 +- .../demko_term.AssemblyInfoInputs.cache | 2 +- demko_term/obj/Debug/net8.0/demko_term.dll | Bin 64000 -> 65024 bytes demko_term/obj/Debug/net8.0/demko_term.pdb | Bin 31760 -> 32044 bytes .../obj/Debug/net8.0/ref/demko_term.dll | Bin 15872 -> 16384 bytes .../net8.0/refint/Avalonia/demko_term.dll | Bin 15872 -> 16384 bytes .../obj/Debug/net8.0/refint/demko_term.dll | Bin 16896 -> 16896 bytes 20 files changed, 50 insertions(+), 31 deletions(-) diff --git a/demko_term/AcceptStatementWindow.axaml.cs b/demko_term/AcceptStatementWindow.axaml.cs index a198c7f..e2506b7 100644 --- a/demko_term/AcceptStatementWindow.axaml.cs +++ b/demko_term/AcceptStatementWindow.axaml.cs @@ -12,18 +12,29 @@ namespace demko_term; public partial class AcceptStatementWindow : Window { - public List AcceptApplicantList { get; } - public List AcceptSpecialtyList { get; } + public List AcceptApplicantList { get; set; } + public List AcceptSpecialtyList { get; set; } public AcceptStatementWindow() { using var context = new DemoCourseworkContext(); InitializeComponent(); - + DisplayComboBoxes(); + } + + public void LoadComboBoxes() + { + using var context = new DemoCourseworkContext(); AcceptApplicantList = context.Applicants.Select(a => a.Code.ToString()).ToList(); - AcceptApplicantComboBox.ItemsSource = AcceptApplicantList; AcceptSpecialtyList = context.Specialties.Select(s => s.Code).ToList(); + } + + public void DisplayComboBoxes() + { + LoadComboBoxes(); + + AcceptApplicantComboBox.ItemsSource = AcceptApplicantList; AcceptSpecialtyListBox.ItemsSource = AcceptSpecialtyList; } @@ -77,9 +88,11 @@ public partial class AcceptStatementWindow : Window } - private void CreateApplicantWindowButton_OnClick(object? sender, RoutedEventArgs e) + private async void CreateApplicantWindowButton_OnClick(object? sender, RoutedEventArgs e) { - CreateApplicantWindow ordersWindow = new CreateApplicantWindow(); - ordersWindow.ShowDialog(this); + CreateApplicantWindow createApplicantWindow = new CreateApplicantWindow(); + await createApplicantWindow.ShowDialog(this); + + DisplayComboBoxes(); } } \ No newline at end of file diff --git a/demko_term/CreateApplicantWindow.axaml.cs b/demko_term/CreateApplicantWindow.axaml.cs index 6b94506..a2fd199 100644 --- a/demko_term/CreateApplicantWindow.axaml.cs +++ b/demko_term/CreateApplicantWindow.axaml.cs @@ -10,7 +10,7 @@ namespace demko_term; public partial class CreateApplicantWindow : Window { - public string code_prew; + public int code_prew; public CreateApplicantWindow() { @@ -18,8 +18,8 @@ public partial class CreateApplicantWindow : Window InitializeComponent(); using var context = new DemoCourseworkContext(); - code_prew = context.Applicants.Select(a => a.Code).Max().ToString(); - CodeTextBox.Text = code_prew; + code_prew = context.Applicants.Select(a => a.Code).Max(); + CodeTextBox.Text = (code_prew + 1).ToString(); } public void CreateApplicant_OnClick(object? sender, RoutedEventArgs e) diff --git a/demko_term/FormPersonalFileWindow.axaml b/demko_term/FormPersonalFileWindow.axaml index 8c15333..d6536c0 100644 --- a/demko_term/FormPersonalFileWindow.axaml +++ b/demko_term/FormPersonalFileWindow.axaml @@ -9,7 +9,7 @@