WhoMaintainsService done
This commit is contained in:
@@ -23,12 +23,14 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels
|
||||
(UpdateServiceCommand as RelayCommand).NotifyCanExecuteChanged();
|
||||
(DeleteServiceCommand as RelayCommand).NotifyCanExecuteChanged();
|
||||
(GetResponsibleEmployeeCommand as RelayCommand).NotifyCanExecuteChanged();
|
||||
(GetMaintainersCommand as RelayCommand).NotifyCanExecuteChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand UpdateServiceCommand { get; set; }
|
||||
public ICommand DeleteServiceCommand { get; set; }
|
||||
public ICommand GetResponsibleEmployeeCommand { get; set; }
|
||||
public ICommand GetMaintainersCommand { get; set; }
|
||||
|
||||
public static bool IsInDesignMode
|
||||
{
|
||||
@@ -72,6 +74,16 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels
|
||||
{
|
||||
return SelectedService != null;
|
||||
});
|
||||
|
||||
GetMaintainersCommand = new RelayCommand(() =>
|
||||
{
|
||||
Window window = new GetMaintainers(SelectedService);
|
||||
window.Show();
|
||||
},
|
||||
() =>
|
||||
{
|
||||
return SelectedService != null;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
using WD7UVN_HFT_2023241.Models;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels
|
||||
{
|
||||
public class GetMaintainersViewModel : ObservableRecipient
|
||||
{
|
||||
public RestCollection<Employee> Employees { get; set; }
|
||||
|
||||
public static bool IsInDesignMode
|
||||
{
|
||||
get
|
||||
{
|
||||
var prop = DesignerProperties.IsInDesignModeProperty;
|
||||
return (bool)DependencyPropertyDescriptor.FromProperty(prop, typeof(FrameworkElement)).Metadata.DefaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
public GetMaintainersViewModel(Service e)
|
||||
{
|
||||
if (!IsInDesignMode)
|
||||
{
|
||||
Employees = new RestCollection<Employee>("http://localhost:5000/", "api/WhoMaintainsService?id=" + e.ID.ToString(), "hub", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user