From 7db0881977efba95d1fa756406e0171d575e8e98 Mon Sep 17 00:00:00 2001 From: maksim Date: Sat, 30 Nov 2024 15:44:45 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=B2?= =?UTF-8?q?=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=BE=D1=80=D0=BC=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B2=D0=BE=D0=B4=D0=B8=D1=82=20=D0=A4=D0=98=D0=9E=20+?= =?UTF-8?q?=20=D0=B4=D1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/PhisicalPersonViewModel.cs | 7 +++++++ .../PhysicalPerson/EditPhysicalPersonWindow.xaml.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/EmployeeManagmentContracts/ViewModels/PhisicalPersonViewModel.cs b/EmployeeManagmentContracts/ViewModels/PhisicalPersonViewModel.cs index b5fca96..632cea2 100644 --- a/EmployeeManagmentContracts/ViewModels/PhisicalPersonViewModel.cs +++ b/EmployeeManagmentContracts/ViewModels/PhisicalPersonViewModel.cs @@ -16,5 +16,12 @@ namespace EmployeeManagmentContracts.ViewModels public string Gender { get; set; } = string.Empty; public string Address { get; set; } = string.Empty; public string Telephone { get; set; } = string.Empty; + + // Вычисляемое свойство для полного имени + public string FullName => $"{Surname} {Name} {Patronymic}"; + + // Вычисляемое свойство для полного имени с датой рождения + public string FullNameWithBirthday => $"{Surname} {Name} {Patronymic} ({Birthday:dd.MM.yyyy})"; + } } diff --git a/EmployeeManagmentView/PhysicalPerson/EditPhysicalPersonWindow.xaml.cs b/EmployeeManagmentView/PhysicalPerson/EditPhysicalPersonWindow.xaml.cs index 50b8ec8..ea18150 100644 --- a/EmployeeManagmentView/PhysicalPerson/EditPhysicalPersonWindow.xaml.cs +++ b/EmployeeManagmentView/PhysicalPerson/EditPhysicalPersonWindow.xaml.cs @@ -23,8 +23,8 @@ namespace EmployeeManagmentView.PhysicalPerson { _physicalPersons = _phisicalPersonLogic.GetFullList(); PhysicalPersonComboBox.ItemsSource = _physicalPersons; - PhysicalPersonComboBox.DisplayMemberPath = "Name"; // "FullName" - свойство с именем - PhysicalPersonComboBox.SelectedValuePath = "Id"; // "Id" - идентификатор физ.лица + PhysicalPersonComboBox.DisplayMemberPath = "FullNameWithBirthday"; + PhysicalPersonComboBox.SelectedValuePath = "Id"; } // Событие при выборе физ.лица