diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/MainWindow.xaml b/WD7UVN_SzTGUI_2023242.Client.WPF/MainWindow.xaml
index 24dfaf3..79ea396 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/MainWindow.xaml
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/MainWindow.xaml
@@ -21,11 +21,14 @@
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewEmployee.xaml.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewEmployee.xaml.cs
index 46e3b8f..6c06c68 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewEmployee.xaml.cs
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewEmployee.xaml.cs
@@ -1,27 +1,16 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
+using WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels;
namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
{
- ///
- /// Interaction logic for CreateNewEmployee.xaml
- ///
public partial class CreateNewEmployee : Window
{
- public CreateNewEmployee()
+ public CreateNewEmployee(CreateNewEmployeeViewModel viewModel)
{
InitializeComponent();
+ DataContext = viewModel;
+ viewModel.CloseAction = new Action(() => this.Close());
}
}
}
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml
index e72f900..10ca378 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml
@@ -5,8 +5,57 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WD7UVN_SzTGUI_2023242.Client.WPF.Windows"
mc:Ignorable="d"
- Title="CreateNewMaintainerTeam" Height="450" Width="800">
+ Title="Create new team" Height="550" Width="350">
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml.cs
index 1900730..c232836 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml.cs
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewMaintainerTeam.xaml.cs
@@ -1,27 +1,16 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
+using WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels;
namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
{
- ///
- /// Interaction logic for CreateNewMaintainerTeam.xaml
- ///
public partial class CreateNewMaintainerTeam : Window
{
- public CreateNewMaintainerTeam()
+ public CreateNewMaintainerTeam(CreateNewMaintainerTeamViewModel viewModel)
{
InitializeComponent();
+ DataContext = viewModel;
+ viewModel.CloseAction = new Action(() => this.Close());
}
}
}
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml
index ef4621e..d1cf232 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml
@@ -5,8 +5,77 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WD7UVN_SzTGUI_2023242.Client.WPF.Windows"
mc:Ignorable="d"
- Title="CreateNewService" Height="450" Width="800">
+ Title="Create new service" Height="550" Width="350">
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml.cs
index 059cea0..3770499 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml.cs
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/Create/CreateNewService.xaml.cs
@@ -1,27 +1,16 @@
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Shapes;
+using WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels;
namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
{
- ///
- /// Interaction logic for CreateNewService.xaml
- ///
public partial class CreateNewService : Window
{
- public CreateNewService()
+ public CreateNewService(CreateNewServiceViewModel viewModel)
{
InitializeComponent();
+ DataContext = viewModel;
+ viewModel.CloseAction = new Action(() => this.Close());
}
}
}
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllEmployees.xaml.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllEmployees.xaml.cs
index a439718..9e7315f 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllEmployees.xaml.cs
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllEmployees.xaml.cs
@@ -1,4 +1,5 @@
using System.Windows;
+using WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels;
namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
{
@@ -14,7 +15,19 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
private void CreateNewEmployee(object sender, RoutedEventArgs e)
{
- Window window = new CreateNewEmployee();
+ 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);
window.Show();
}
}
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllMaintainerTeams.xaml.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllMaintainerTeams.xaml.cs
index 2e5ddbd..9c43d50 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllMaintainerTeams.xaml.cs
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllMaintainerTeams.xaml.cs
@@ -1,4 +1,5 @@
using System.Windows;
+using WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels;
namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
{
@@ -14,7 +15,19 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
private void CreateNewMaintainerTeam(object sender, RoutedEventArgs e)
{
- Window window = new CreateNewMaintainerTeam();
+ CreateNewMaintainerTeamViewModel viewModel = new CreateNewMaintainerTeamViewModel();
+ viewModel.NewMaintainerTeamCreated += (newMaintainerTeam) =>
+ {
+ var getAllMaintainerTeamsViewModel = (GetAllMaintainerTeamsViewModel)DataContext;
+ if (getAllMaintainerTeamsViewModel != null)
+ {
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ getAllMaintainerTeamsViewModel.MaintainerTeams.Add(newMaintainerTeam);
+ });
+ }
+ };
+ Window window = new CreateNewMaintainerTeam(viewModel);
window.Show();
}
}
diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllServices.xaml.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllServices.xaml.cs
index f7f98fd..727521e 100644
--- a/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllServices.xaml.cs
+++ b/WD7UVN_SzTGUI_2023242.Client.WPF/Windows/GetAll/GetAllServices.xaml.cs
@@ -1,4 +1,5 @@
using System.Windows;
+using WD7UVN_SzTGUI_2023242.Client.WPF.ViewModels;
namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
{
@@ -14,7 +15,19 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF.Windows
private void CreateNewService(object sender, RoutedEventArgs e)
{
- Window window = new CreateNewService();
+ CreateNewServiceViewModel viewModel = new CreateNewServiceViewModel();
+ viewModel.NewServiceCreated += (newService) =>
+ {
+ var getAllServicesViewModel = (GetAllServicesViewModel)DataContext;
+ if (getAllServicesViewModel != null)
+ {
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ getAllServicesViewModel.Services.Add(newService);
+ });
+ }
+ };
+ Window window = new CreateNewService(viewModel);
window.Show();
}
}