From b0ba438336efd6ca0b43c5875636a3361ee0e0b5 Mon Sep 17 00:00:00 2001 From: MiskolcziRichard Date: Sat, 4 May 2024 20:16:10 +0200 Subject: [PATCH] GetSubordinates done --- .../ViewModels/GetSubordinatesViewModel.cs | 36 ------------------- .../Windows/NonCRUD/GetSubordinates.xaml | 12 +------ 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetSubordinatesViewModel.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetSubordinatesViewModel.cs index 660998a..ad11fa0 100644 --- a/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetSubordinatesViewModel.cs +++ b/WD7UVN_SzTGUI_2023242.Client.WPF/ViewModels/GetSubordinatesViewModel.cs @@ -11,24 +11,6 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels { public RestCollection Employees { get; set; } - private Employee selectedEmployee; - - public Employee SelectedEmployee - { - get { return selectedEmployee; } - set - { - SetProperty(ref selectedEmployee, value); - (UpdateEmployeeCommand as RelayCommand).NotifyCanExecuteChanged(); - (DeleteEmployeeCommand as RelayCommand).NotifyCanExecuteChanged(); - (GetSubordinatesCommand as RelayCommand).NotifyCanExecuteChanged(); - } - } - - public ICommand UpdateEmployeeCommand { get; set; } - public ICommand DeleteEmployeeCommand { get; set; } - public ICommand GetSubordinatesCommand { get; set; } - public static bool IsInDesignMode { get @@ -43,24 +25,6 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels if (!IsInDesignMode) { Employees = new RestCollection("http://localhost:5000/", "api/GetSubordinates?id=" + e.ID.ToString(), "hub", true); - - UpdateEmployeeCommand = new RelayCommand(() => - { - Employees.Update(SelectedEmployee); - }, - () => - { - return SelectedEmployee != null; - }); - - DeleteEmployeeCommand = new RelayCommand(() => - { - Employees.Delete(SelectedEmployee.ID); - }, - () => - { - return SelectedEmployee != null; - }); } } } diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/NonCRUD/GetSubordinates.xaml b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/NonCRUD/GetSubordinates.xaml index 3c1a4d1..01b5572 100644 --- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/NonCRUD/GetSubordinates.xaml +++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/NonCRUD/GetSubordinates.xaml @@ -5,13 +5,9 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels" mc:Ignorable="d" - Title="Employees" Height="550" Width="350"> + Title="Subordinates of employee" Height="550" Width="350"> - - - -