2024-11-26 22:35:12 +04:00
|
|
|
|
using EmployeeManagmentContracts.BusinessLogicContracts;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
namespace EmployeeManagmentView.PhysicalPerson
|
|
|
|
|
{
|
|
|
|
|
public partial class PhysicalPersonManagementWindow : Window
|
|
|
|
|
{
|
|
|
|
|
private readonly IPhisicalPersonLogic _phisicalPersonLogic;
|
|
|
|
|
|
|
|
|
|
public PhysicalPersonManagementWindow(IPhisicalPersonLogic phisicalPersonLogic)
|
|
|
|
|
{
|
|
|
|
|
_phisicalPersonLogic = phisicalPersonLogic;
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OpenAddPhysicalPersonWindow(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
2024-11-27 01:21:37 +04:00
|
|
|
|
foreach (Window window in Application.Current.Windows)
|
|
|
|
|
{
|
2024-11-30 15:36:29 +04:00
|
|
|
|
if (window is AddPhysicalPersonWindow existingWindow)
|
2024-11-27 01:21:37 +04:00
|
|
|
|
{
|
2024-11-30 15:36:29 +04:00
|
|
|
|
existingWindow.Activate();
|
2024-11-27 01:21:37 +04:00
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-30 15:36:29 +04:00
|
|
|
|
var addWindow = new AddPhysicalPersonWindow(_phisicalPersonLogic);
|
|
|
|
|
addWindow.Show();
|
2024-11-26 22:35:12 +04:00
|
|
|
|
}
|
2024-11-27 01:21:37 +04:00
|
|
|
|
|
2024-11-30 15:36:29 +04:00
|
|
|
|
private void OpenDeletePhysicalPersonWindow(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
foreach (Window window in Application.Current.Windows)
|
|
|
|
|
{
|
|
|
|
|
if (window is DeletePhysicalPersonWindow existingWindow)
|
|
|
|
|
{
|
|
|
|
|
existingWindow.Activate();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var deleteWindow = new DeletePhysicalPersonWindow(_phisicalPersonLogic);
|
|
|
|
|
deleteWindow.Show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OpenEditPhysicalPersonWindow(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
foreach (Window window in Application.Current.Windows)
|
|
|
|
|
{
|
|
|
|
|
if (window is EditPhysicalPersonWindow existingWindow)
|
|
|
|
|
{
|
|
|
|
|
existingWindow.Activate();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var editWindow = new EditPhysicalPersonWindow(_phisicalPersonLogic);
|
|
|
|
|
editWindow.Show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OpenViewPhysicalPersonsWindow(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
foreach (Window window in Application.Current.Windows)
|
|
|
|
|
{
|
|
|
|
|
if (window is ViewPhysicalPersonsWindow existingWindow)
|
|
|
|
|
{
|
|
|
|
|
existingWindow.Activate();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var viewWindow = new ViewPhysicalPersonsWindow(_phisicalPersonLogic);
|
|
|
|
|
viewWindow.Show();
|
|
|
|
|
}
|
2024-11-26 22:35:12 +04:00
|
|
|
|
}
|
|
|
|
|
}
|