Rogashova_E.A._CourseWork_H.../HospitalContracts/ViewModels/RecipesViewModel.cs

43 lines
1.3 KiB
C#

using HospitalDataModels.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace HospitalContracts.ViewModels
{
public class RecipesViewModel: IRecipesModel
{
public int Id { get; set; }
public int ClientId { get; set; }
[DisplayName("Доза")]
public string Dose { get; set; } = string.Empty;
[DisplayName("Дата выписки")]
public DateTime Date { get; set; }
[DisplayName("Клиент")]
public string ClientFIO { get; set; } = string.Empty;
[DisplayName("Способ приготовления")]
public string ModeOfApplication { get; set; } = string.Empty;
[DisplayName("Процедура")]
public Dictionary<int, IProceduresModel> RecipeProcedures
{
get;
set;
} = new();
[DisplayName("Симптом")]
public int SymptomsId { get; set; }
public RecipesViewModel() { }
[JsonConstructor]
public RecipesViewModel(Dictionary<int, ProceduresViewModel> RecipeProcedures)
{
this.RecipeProcedures = RecipeProcedures.ToDictionary(x => x.Key, x => x.Value as IProceduresModel);
}
}
}