CourseWork_CarCenter/CarCenter/CarCenterContracts/ViewModels/EmployeeViewModel.cs

30 lines
953 B
C#

using CarCenterDataModels.Models;
using System.ComponentModel;
using Newtonsoft.Json;
namespace CarCenterContracts.ViewModels
{
public class EmployeeViewModel : IEmployeeModel
{
[DisplayName("ФИО Сотрудника")]
public string EmployeeFIO { get; set; } = string.Empty;
[DisplayName("Специализация")]
public string Specialization { get; set; } = string.Empty;
public int ManagerId { get; set; }
public int Id { get; set; }
public Dictionary<int, ISaleModel> EmployeeSales { get; set; } = new();
public Dictionary<int, IInspectionModel> EmployeeInspection { get; set; }
public EmployeeViewModel() { }
[JsonConstructor]
public EmployeeViewModel(Dictionary<int, SaleViewModel> EmployeeSales)
{
this.EmployeeSales = EmployeeSales.ToDictionary(x => x.Key, x => x.Value as ISaleModel);
}
}
}