diff --git a/EmployeeManagmentContracts/ViewModels/EmployeeViewModel.cs b/EmployeeManagmentContracts/ViewModels/EmployeeViewModel.cs index 4bf5bef..119b947 100644 --- a/EmployeeManagmentContracts/ViewModels/EmployeeViewModel.cs +++ b/EmployeeManagmentContracts/ViewModels/EmployeeViewModel.cs @@ -16,6 +16,8 @@ namespace EmployeeManagmentContracts.ViewModels public float Bid { get; set; } public int? PhysicalPersonsId { get; set; } public string? PhysicalPersonName { get; set; } + // Новое свойство для отображения комбинированного текста + public string DisplayText => $"{NameJob} ({PhysicalPersonName})"; } } diff --git a/EmployeeManagmentContracts/ViewModels/VacationViewModel.cs b/EmployeeManagmentContracts/ViewModels/VacationViewModel.cs index a40b950..9f3d5aa 100644 --- a/EmployeeManagmentContracts/ViewModels/VacationViewModel.cs +++ b/EmployeeManagmentContracts/ViewModels/VacationViewModel.cs @@ -14,5 +14,15 @@ namespace EmployeeManagmentContracts.ViewModels public bool Passed { get; set; } public int? EmployeeId { get; set; } public string? EmployeeName { get; set; } = string.Empty; + + public string DisplayName + { + get + { + return $"{EmployeeName} ({StartData:dd.MM.yyyy} - {EndData:dd.MM.yyyy})"; + } + } + + } } diff --git a/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs b/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs index ef13084..4d78289 100644 --- a/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs +++ b/EmployeeManagmentDataBaseImplement/Implements/EmployeeStorage.cs @@ -22,7 +22,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements PartTimeJob = e.PartTimeJob, Bid = e.Bid, PhysicalPersonsId = e.PhisicalPersonsId, - PhysicalPersonName = $"{e.PhisicalPerson.Surname} {e.PhisicalPerson.Name}" + PhysicalPersonName = $"{e.PhisicalPerson.Surname} {e.PhisicalPerson.Name} {e.PhisicalPerson.Patronymic} " }) .ToList(); } @@ -48,7 +48,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements PartTimeJob = e.PartTimeJob, Bid = e.Bid, PhysicalPersonsId = e.PhisicalPersonsId, - PhysicalPersonName = $"{e.PhisicalPerson.Surname} {e.PhisicalPerson.Name}" + PhysicalPersonName = $"{e.PhisicalPerson.Surname} {e.PhisicalPerson.Name} {e.PhisicalPerson.Patronymic}", }) .ToList(); } @@ -71,7 +71,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements Bid = entity.Bid, PhysicalPersonsId = entity.PhisicalPersonsId, PhysicalPersonName = entity.PhisicalPerson != null - ? $"{entity.PhisicalPerson.Surname} {entity.PhisicalPerson.Name}" + ? $"{entity.PhisicalPerson.Surname} {entity.PhisicalPerson.Name} {entity.PhisicalPerson.Patronymic} " : "Не указано" // Обработка отсутствующего физического лица }; } diff --git a/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs b/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs index 22f9d9d..73d74b3 100644 --- a/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs +++ b/EmployeeManagmentDataBaseImplement/Implements/VacationStorage.cs @@ -22,7 +22,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements EndData = v.EndData, Passed = v.Passed, EmployeeId = v.EmployeesId, - EmployeeName = v.Employee != null ? $"{v.Employee.PhisicalPerson.Surname} {v.Employee.PhisicalPerson.Name}" : "Не указано" + EmployeeName = v.Employee != null ? $"{v.Employee.PhisicalPerson.Surname} {v.Employee.PhisicalPerson.Name} {v.Employee.PhisicalPerson.Patronymic} ({v.Employee.NameJob})" : "Не указано" }) .ToList(); } @@ -44,7 +44,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements EndData = v.EndData, Passed = v.Passed, EmployeeId = v.EmployeesId, - EmployeeName = v.Employee != null ? $"{v.Employee.PhisicalPerson.Surname} {v.Employee.PhisicalPerson.Name}" : "Не указано" + EmployeeName = v.Employee != null ? $"{v.Employee.PhisicalPerson.Surname} {v.Employee.PhisicalPerson.Name} {v.Employee.PhisicalPerson.Patronymic} ({v.Employee.NameJob})" : "Не указано" }) .ToList(); } @@ -63,7 +63,7 @@ namespace EmployeeManagmentDataBaseImplement.Implements EndData = entity.EndData, 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/EmployeeManagmentDataModels/EmployeeManagmentDataModels.csproj b/EmployeeManagmentDataModels/EmployeeManagmentDataModels.csproj index acb35f3..7518d5f 100644 --- a/EmployeeManagmentDataModels/EmployeeManagmentDataModels.csproj +++ b/EmployeeManagmentDataModels/EmployeeManagmentDataModels.csproj @@ -18,6 +18,7 @@ + diff --git a/EmployeeManagmentDataModels/Enums/BooleanToSalaryConverter.cs b/EmployeeManagmentDataModels/Enums/BooleanToSalaryConverter.cs new file mode 100644 index 0000000..6484750 --- /dev/null +++ b/EmployeeManagmentDataModels/Enums/BooleanToSalaryConverter.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System; +using System.Windows.Data; + +namespace EmployeeManagmentDataModels.Enums +{ + public class BooleanToSalaryConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is bool booleanValue) + { + return booleanValue ? "Заплачено" : "Не заплачено"; + } + return "Неизвестно"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException("Обратное преобразование не поддерживается."); + } + } +} diff --git a/EmployeeManagmentDataModels/Enums/BooleanToVacationConverter.cs b/EmployeeManagmentDataModels/Enums/BooleanToVacationConverter.cs new file mode 100644 index 0000000..915cf98 --- /dev/null +++ b/EmployeeManagmentDataModels/Enums/BooleanToVacationConverter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace EmployeeManagmentDataModels.Enums +{ + public class BooleanToVacationConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is bool booleanValue) + { + return booleanValue ? "Завершен" : "Не завершено"; + } + return "Неизвестно"; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException("Обратное преобразование не поддерживается."); + } + } +} diff --git a/EmployeeManagmentView/App.xaml b/EmployeeManagmentView/App.xaml index 1476ad8..0229ece 100644 --- a/EmployeeManagmentView/App.xaml +++ b/EmployeeManagmentView/App.xaml @@ -2,6 +2,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> +