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

namespace Register_office.Model;

public partial class DiseaseSyndrome : IUnionId
{
	public object GetId() => DiseaseSyndromeId;

    public int DiseaseSyndromeId { get; set; }

    public int DiseaseId { get; set; }

    public int SyndromeId { get; set; }

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

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

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

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

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

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

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

	public DiseaseSyndromeWrapper(DiseaseSyndrome src)
	{
		DiseaseSyndromeId = src.DiseaseSyndromeId;
		DiseaseId = src.DiseaseId;
		SyndromeId = src.SyndromeId;
		DiseaseName = src.Disease.Name;
		SyndromeName = src.Syndrome.Name;
	}

	internal static List<DiseaseSyndromeWrapper> ToList(List<DiseaseSyndrome> src)
	{
		List<DiseaseSyndromeWrapper> res = [];

		foreach (DiseaseSyndrome lst in src)
		{
			res.Add(new DiseaseSyndromeWrapper(lst));
		}

		return res;
	}
}