PIbd-22_Fedorenko_Puchkina_.../LawFim/LawFirmContracts/ViewModels/CaseViewModel.cs

31 lines
1.1 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using LawFimDataModels.Enums;
using LawFimDataModels.Models;
using System.ComponentModel;
using Newtonsoft.Json;
namespace LawFirmContracts.ViewModels
{
public class CaseViewModel : ICaseModel
{
public int Id { get; set; }
[DisplayName("Название")]
public string Name { get; set; } = string.Empty;
[DisplayName("Статус")]
public CaseStatus Status { get; set; } = CaseStatus.Неизвестен;
[DisplayName("Вид производства")]
public string CaseType { get; set; } = string.Empty;
[DisplayName("Дата создания")]
public DateTime DateCreate { get; set; }
[DisplayName("Дата выполнения")]
public DateTime? DateImplement { get; set; }
public Dictionary<int, IClientModel> CaseClients { get; set; } = new();
public int ExecutorId { get; set; }
public CaseViewModel() { }
[JsonConstructor]
public CaseViewModel(Dictionary<int, ClientViewModel> CaseClients)
{
this.CaseClients = CaseClients.ToDictionary(x => x.Key, x => x.Value as IClientModel);
}
}
}