diff --git a/EmployeeManagmentContracts/ViewModels/SalaryViewModel.cs b/EmployeeManagmentContracts/ViewModels/SalaryViewModel.cs index 97de7b4..bfd1089 100644 --- a/EmployeeManagmentContracts/ViewModels/SalaryViewModel.cs +++ b/EmployeeManagmentContracts/ViewModels/SalaryViewModel.cs @@ -17,5 +17,13 @@ namespace EmployeeManagmentContracts.ViewModels public int? EmployeeId { get; set; } public string? EmployeeName { get; set; } = string.Empty; + + public string DisplayName + { + get + { + return $"{EmployeeName} ({Date:dd.MM.yyyy})"; + } + } } } diff --git a/EmployeeManagmentDataBaseImplement/Implements/SalaryStorage.cs b/EmployeeManagmentDataBaseImplement/Implements/SalaryStorage.cs index 8f674d1..b514e61 100644 --- a/EmployeeManagmentDataBaseImplement/Implements/SalaryStorage.cs +++ b/EmployeeManagmentDataBaseImplement/Implements/SalaryStorage.cs @@ -24,7 +24,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements Date = s.Data, Passed = s.Passed, EmployeeId = s.EmployeesId, - EmployeeName = s.Employee != null ? $"{s.Employee.PhisicalPerson.Surname} {s.Employee.PhisicalPerson.Name}" : "Не указано" + EmployeeName = s.Employee != null ? $"{s.Employee.PhisicalPerson.Surname} {s.Employee.PhisicalPerson.Name} {s.Employee.PhisicalPerson.Patronymic} ({s.Employee.NameJob})" : "Не указано" }) .ToList(); } @@ -47,7 +47,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements Date = s.Data, Passed = s.Passed, EmployeeId = s.EmployeesId, - EmployeeName = s.Employee != null ? $"{s.Employee.PhisicalPerson.Surname} {s.Employee.PhisicalPerson.Name}" : "Не указано" + EmployeeName = s.Employee != null ? $"{s.Employee.PhisicalPerson.Surname} {s.Employee.PhisicalPerson.Name} {s.Employee.PhisicalPerson.Patronymic} ({s.Employee.NameJob})" : "Не указано" }) .ToList(); } @@ -68,7 +68,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements Date = entity.Data, Passed = entity.Passed, EmployeeId = entity.EmployeesId, - EmployeeName = entity.Employee != null ? $"{entity.Employee.PhisicalPerson.Surname} {entity.Employee.PhisicalPerson.Name}" : "Не указано" + EmployeeName = entity.Employee != null ? $"{entity.Employee.PhisicalPerson.Surname} {entity.Employee.PhisicalPerson.Name} {entity.Employee.PhisicalPerson.Patronymic} ({entity.Employee.NameJob})" : "Не указано" }; } diff --git a/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs b/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs index 73d74b3..309652b 100644 --- a/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs +++ b/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs @@ -23,6 +23,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements Passed = v.Passed, EmployeeId = v.EmployeesId, EmployeeName = v.Employee != null ? $"{v.Employee.PhisicalPerson.Surname} {v.Employee.PhisicalPerson.Name} {v.Employee.PhisicalPerson.Patronymic} ({v.Employee.NameJob})" : "Не указано" + }) .ToList(); } diff --git a/EmployeeManagmentView/Employee/Salary/AddSalaryWindow.xaml.cs b/EmployeeManagmentView/Employee/Salary/AddSalaryWindow.xaml.cs index 67ff424..df9bcfe 100644 --- a/EmployeeManagmentView/Employee/Salary/AddSalaryWindow.xaml.cs +++ b/EmployeeManagmentView/Employee/Salary/AddSalaryWindow.xaml.cs @@ -25,6 +25,7 @@ namespace EmployeeManagmentView.Employee.Salary private readonly ISalaryLogic _salaryLogic; private readonly IEmployeeLogic _employeeLogic; private readonly IPhisicalPersonLogic _phisicalPersonLogic; + private List _employees; public AddSalaryWindow(ISalaryLogic salaryLogic, IEmployeeLogic employeeLogic, IPhisicalPersonLogic phisicalPersonLogic) { @@ -151,9 +152,17 @@ namespace EmployeeManagmentView.Employee.Salary private void LoadEmployees() { - var employees = _employeeLogic.GetFullList(); - EmployeeComboBox.ItemsSource = employees; - EmployeeComboBox.DisplayMemberPath = "NameJob"; + _employees = _employeeLogic.GetFullList(); + + // Заполняем комбинированное свойство, если нужно + foreach (var employee in _employees) + { + var physicalPerson = _phisicalPersonLogic.GetElement(employee.PhysicalPersonsId ?? 0); + employee.PhysicalPersonName = physicalPerson?.FullNameWithBirthday; + } + + EmployeeComboBox.ItemsSource = _employees; + EmployeeComboBox.DisplayMemberPath = "DisplayText"; // Используем новое свойство EmployeeComboBox.SelectedValuePath = "Id"; } diff --git a/EmployeeManagmentView/Employee/Salary/DeleteSalaryWindow.xaml b/EmployeeManagmentView/Employee/Salary/DeleteSalaryWindow.xaml index c81e4a5..fd7ca8f 100644 --- a/EmployeeManagmentView/Employee/Salary/DeleteSalaryWindow.xaml +++ b/EmployeeManagmentView/Employee/Salary/DeleteSalaryWindow.xaml @@ -1,12 +1,17 @@  + + + + - + diff --git a/EmployeeManagmentView/Employee/Salary/EditSalaryWindow.xaml.cs b/EmployeeManagmentView/Employee/Salary/EditSalaryWindow.xaml.cs index 33ab2a5..bf89a74 100644 --- a/EmployeeManagmentView/Employee/Salary/EditSalaryWindow.xaml.cs +++ b/EmployeeManagmentView/Employee/Salary/EditSalaryWindow.xaml.cs @@ -40,7 +40,7 @@ namespace EmployeeManagmentView.Employee.Salary { _salaries = _salaryLogic.GetFullList(); SalaryComboBox.ItemsSource = _salaries; - SalaryComboBox.DisplayMemberPath = "EmployeeName"; + SalaryComboBox.DisplayMemberPath = "DisplayName"; SalaryComboBox.SelectedValuePath = "Id"; } diff --git a/EmployeeManagmentView/Employee/Salary/ViewSalaryWindow.xaml b/EmployeeManagmentView/Employee/Salary/ViewSalaryWindow.xaml index 7ee9c24..d9f07d6 100644 --- a/EmployeeManagmentView/Employee/Salary/ViewSalaryWindow.xaml +++ b/EmployeeManagmentView/Employee/Salary/ViewSalaryWindow.xaml @@ -38,8 +38,7 @@ - - + diff --git a/EmployeeManagmentView/Employee/Vacation/DeleteVacationWindow.xaml b/EmployeeManagmentView/Employee/Vacation/DeleteVacationWindow.xaml index d6061f7..d0423e4 100644 --- a/EmployeeManagmentView/Employee/Vacation/DeleteVacationWindow.xaml +++ b/EmployeeManagmentView/Employee/Vacation/DeleteVacationWindow.xaml @@ -1,11 +1,15 @@  + + + @@ -32,7 +36,7 @@ - + diff --git a/EmployeeManagmentView/Employee/Vacation/EditVacationWindow.xaml.cs b/EmployeeManagmentView/Employee/Vacation/EditVacationWindow.xaml.cs index 4692607..d440c83 100644 --- a/EmployeeManagmentView/Employee/Vacation/EditVacationWindow.xaml.cs +++ b/EmployeeManagmentView/Employee/Vacation/EditVacationWindow.xaml.cs @@ -41,7 +41,7 @@ namespace EmployeeManagmentView.Employee.Vacation { _vacations = _vacationLogic.GetFullList(); VacationComboBox.ItemsSource = _vacations; - VacationComboBox.DisplayMemberPath = "EmployeeName"; + VacationComboBox.DisplayMemberPath = "DisplayName"; VacationComboBox.SelectedValuePath = "Id"; }