using Register_office.BaseClasses;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace Register_office.Model;

public partial class SyndromeExaminationType : IUnionId
{
	public object GetId() => string.Concat(SyndromeId, ExaminationTypeId);

	public int SyndromeId { get; set; }

    public int ExaminationTypeId { get; set; }

    public virtual ExaminationType ExaminationType { get; set; } = null!;

    public virtual SyndromeType Syndrome { get; set; } = null!;
}

internal class SyndromeExaminationTypeWrapper
{
	[Display(Name = "hide")]
	public int SyndromeId { get; set; }

	[Display(Name = "hide")]
	public int ExaminationTypeId { get; set; }

	[Display(Name = "Синдром")]
	public string SyndromeName { get; set; } = null!;

	[Display(Name = "Обследование")]
	public string ExaminationName { get; set; } = null!;

	public SyndromeExaminationTypeWrapper(SyndromeExaminationType src)
	{
		SyndromeId = src.SyndromeId;
		ExaminationTypeId = src.ExaminationTypeId;
		SyndromeName = src.Syndrome.Name;
		ExaminationName = src.ExaminationType.Name;
	}

	internal static List<SyndromeExaminationTypeWrapper> ToList(List<SyndromeExaminationType> src)
	{
		List<SyndromeExaminationTypeWrapper> res = [];

		foreach (SyndromeExaminationType lst in src)
		{
			res.Add(new SyndromeExaminationTypeWrapper(lst));
		}

		return res;
	}
}
