97 lines
3.0 KiB
C#
97 lines
3.0 KiB
C#
using EmployeeManagmentBusinessLogic.BusinessLogic;
|
|
using EmployeeManagmentContracts.BusinessLogicContracts;
|
|
using EmployeeManagmentView.PhysicalPerson;
|
|
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;
|
|
|
|
namespace EmployeeManagmentView.Employee
|
|
{
|
|
/// <summary>
|
|
/// Логика взаимодействия для EmployeeManagementWindow.xaml
|
|
/// </summary>
|
|
public partial class EmployeeManagementWindow : Window
|
|
{
|
|
|
|
private readonly IEmployeeLogic _employeeLogic;
|
|
private readonly IPhisicalPersonLogic _phisicalPersonLogic;
|
|
|
|
public EmployeeManagementWindow(IEmployeeLogic employeeLogic, IPhisicalPersonLogic phisicalPersonLogic)
|
|
{
|
|
_employeeLogic = employeeLogic;
|
|
_phisicalPersonLogic = phisicalPersonLogic;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void OpenAddEmployeeWindow(object sender, RoutedEventArgs e)
|
|
{
|
|
foreach (Window window in Application.Current.Windows)
|
|
{
|
|
if (window is AddEmployeeWindow existingWindow)
|
|
{
|
|
existingWindow.Activate();
|
|
return;
|
|
}
|
|
}
|
|
|
|
var addWindow = new AddEmployeeWindow(_employeeLogic, _phisicalPersonLogic);
|
|
addWindow.Show();
|
|
}
|
|
|
|
private void OpenDeleteEmployeeWindow(object sender, RoutedEventArgs e)
|
|
{
|
|
foreach (Window window in Application.Current.Windows)
|
|
{
|
|
if (window is DeleteEmployeeWindow existingWindow)
|
|
{
|
|
existingWindow.Activate();
|
|
return;
|
|
}
|
|
}
|
|
|
|
var deleteWindow = new DeleteEmployeeWindow(_employeeLogic);
|
|
deleteWindow.Show();
|
|
}
|
|
|
|
private void OpenEditEmployeeWindow(object sender, RoutedEventArgs e)
|
|
{
|
|
foreach (Window window in Application.Current.Windows)
|
|
{
|
|
if (window is EditEmployeeWindow existingWindow)
|
|
{
|
|
existingWindow.Activate();
|
|
return;
|
|
}
|
|
}
|
|
|
|
var editWindow = new EditEmployeeWindow(_employeeLogic);
|
|
editWindow.Show();
|
|
}
|
|
|
|
private void OpenViewEmployeesWindow(object sender, RoutedEventArgs e)
|
|
{
|
|
foreach (Window window in Application.Current.Windows)
|
|
{
|
|
if (window is ViewEmployeeWindow existingWindow)
|
|
{
|
|
existingWindow.Activate();
|
|
return;
|
|
}
|
|
}
|
|
|
|
var viewWindow = new ViewEmployeeWindow(_employeeLogic);
|
|
viewWindow.Show();
|
|
}
|
|
}
|
|
}
|