using EmployeeManagmentBusinessLogic.BusinessLogic; using EmployeeManagmentContracts.BusinessLogicContracts; 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.Vacation { /// /// Логика взаимодействия для VacationManagementWindow.xaml /// public partial class VacationManagementWindow : Window { private readonly IVacationLogic _vacationLogic; private readonly IEmployeeLogic _employeeLogic; private readonly IPhisicalPersonLogic _phisicalPersonLogic; public VacationManagementWindow(IVacationLogic vacationLogic, IEmployeeLogic employeeLogic, IPhisicalPersonLogic phisicalPersonLogic) { _vacationLogic = vacationLogic; _employeeLogic = employeeLogic; _phisicalPersonLogic = phisicalPersonLogic; InitializeComponent(); } private void OpenAddVacationWindow(object sender, RoutedEventArgs e) { foreach (Window window in Application.Current.Windows) { if (window is AddVacationWindow existingWindow) { existingWindow.Activate(); return; } } var addWindow = new AddVacationWindow(_vacationLogic, _employeeLogic, _phisicalPersonLogic); addWindow.Show(); } private void OpenDeleteVacationWindow(object sender, RoutedEventArgs e) { foreach (Window window in Application.Current.Windows) { if (window is DeleteVacationWindow existingWindow) { existingWindow.Activate(); return; } } var deleteWindow = new DeleteVacationWindow(_vacationLogic); deleteWindow.Show(); } private void OpenEditVacationWindow(object sender, RoutedEventArgs e) { foreach (Window window in Application.Current.Windows) { if (window is EditVacationWindow existingWindow) { existingWindow.Activate(); return; } } var editWindow = new EditVacationWindow(_vacationLogic, _employeeLogic, _phisicalPersonLogic); editWindow.Show(); } private void OpenViewVacationWindow(object sender, RoutedEventArgs e) { foreach (Window window in Application.Current.Windows) { if (window is ViewVacationWindow existingWindow) { existingWindow.Activate(); return; } } var viewWindow = new ViewVacationWindow(_vacationLogic, _employeeLogic, _phisicalPersonLogic); viewWindow.Show(); } } }