71 lines
1.9 KiB
C#
71 lines
1.9 KiB
C#
using HospitalDataModels.Models;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace HospitalContracts.ViewModels
|
|
{
|
|
/// <summary>
|
|
/// Модель представления для сущности "Процедура"
|
|
/// </summary>
|
|
public class ProcedureViewModel : IProcedureModel
|
|
{
|
|
/// <summary>
|
|
/// Идентификатор
|
|
/// </summary>
|
|
public int Id { get; set; }
|
|
|
|
/// <summary>
|
|
/// Название процедуры
|
|
/// </summary>
|
|
[DisplayName("Название процедуры")]
|
|
public string Name { get; set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Описание процедуры
|
|
/// </summary>
|
|
[DisplayName("Описание процедуры")]
|
|
public string? Description { get; set; }
|
|
|
|
/// <summary>
|
|
/// Список лекарств для процедуры
|
|
/// </summary>
|
|
public Dictionary<int, IMedicineModel> ProcedureMedicines
|
|
{
|
|
get;
|
|
set;
|
|
} = new();
|
|
|
|
/// <summary>
|
|
/// Получить хэш-код
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public override int GetHashCode()
|
|
{
|
|
return Id.GetHashCode();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Сравнить объекты
|
|
/// </summary>
|
|
/// <param name="obj"></param>
|
|
/// <returns></returns>
|
|
public override bool Equals(object? obj)
|
|
{
|
|
if (this == obj)
|
|
{
|
|
return true;
|
|
}
|
|
if (obj != null && obj is ProcedureViewModel other)
|
|
{
|
|
return this.Id == other.Id;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|