33 lines
978 B
C#
33 lines
978 B
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 KurseViewModel: IKurseModel
|
|
{
|
|
public int Id { get; set; }
|
|
[DisplayName("Продолжительность курса")]
|
|
public string Duration { get; set; } = string.Empty;
|
|
[DisplayName("Срок приема")]
|
|
public int CountInDay { get; set; }
|
|
public Dictionary<int, IMedicinesModel> KurseMedicines
|
|
{
|
|
get;
|
|
set;
|
|
} = new();
|
|
|
|
public KurseViewModel() { }
|
|
[JsonConstructor]
|
|
public KurseViewModel(Dictionary<int, MedicinesViewModel> KurseMedicines)
|
|
{
|
|
this.KurseMedicines = KurseMedicines.ToDictionary(x => x.Key, x => x.Value as IMedicinesModel);
|
|
}
|
|
}
|
|
}
|