GetSubordinates done

This commit is contained in:
MiskolcziRichard
2024-05-04 20:16:10 +02:00
parent 3c597bc4d3
commit b0ba438336
2 changed files with 1 additions and 47 deletions

View File

@@ -11,24 +11,6 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels
{
public RestCollection<Employee> 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<Employee>("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;
});
}
}
}