2024-04-30 20:34:23 +02:00
|
|
|
|
using System.Windows;
|
2024-05-06 19:13:17 +02:00
|
|
|
|
using WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels;
|
2024-04-28 18:00:25 +02:00
|
|
|
|
|
|
|
|
|
|
namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Interaction logic for GetAllEmployees.xaml
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class GetAllEmployees : Window
|
|
|
|
|
|
{
|
|
|
|
|
|
public GetAllEmployees()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
}
|
2024-04-29 22:57:48 +02:00
|
|
|
|
|
|
|
|
|
|
private void CreateNewEmployee(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
2024-05-06 19:13:17 +02:00
|
|
|
|
CreateNewEmployeeViewModel viewModel = new CreateNewEmployeeViewModel();
|
|
|
|
|
|
viewModel.NewEmployeeCreated += (newEmployee) =>
|
|
|
|
|
|
{
|
|
|
|
|
|
var getAllEmployeesViewModel = (GetAllEmployeesViewModel)DataContext;
|
|
|
|
|
|
if (getAllEmployeesViewModel != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Application.Current.Dispatcher.Invoke(() =>
|
|
|
|
|
|
{
|
|
|
|
|
|
getAllEmployeesViewModel.Employees.Add(newEmployee);
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
};
|
|
|
|
|
|
Window window = new CreateNewEmployee(viewModel);
|
2024-04-29 22:57:48 +02:00
|
|
|
|
window.Show();
|
|
|
|
|
|
}
|
2024-04-28 18:00:25 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|