using System; using System.Collections.Generic; using Kreta.Ellenorzo.Domain.VN.Adatszotar; using Kreta.Ellenorzo.Domain.VN.Interfaces; using Kreta.Ellenorzo.Domain.VN.UniqueIdentifier; using Kreta.Enums; namespace Kreta.Ellenorzo.Domain.VN.Tantargy { [Serializable] public class TantargyResponse : ISortable, IEqualityComparer { public TantargyResponse(int id, string nev) { Nev = nev; Uid = new TantargyUid(id); } public TantargyResponse(int id, string nev, Adatszotar kategoria) { Nev = nev; Kategoria = kategoria; Uid = new TantargyUid(id); } public TantargyResponse(int id, string nev, Adatszotar kategoria, string kategoriaLeiras, bool isFotargy, int? fotargyId, string fotargyNev, int? sorSzam) { Uid = new TantargyUid(id); Nev = nev; Kategoria = new Adatszotar(kategoria.Uid.Id, kategoriaLeiras); SorSzam = sorSzam; IsFotargy = isFotargy; FotargyId = fotargyId; FotargyNev = fotargyNev; } public TantargyResponse(int id, string nev, Adatszotar kategoria, string kategoriaLeiras) { Nev = nev; Kategoria = new Adatszotar(kategoria.Uid.Id, kategoriaLeiras); Uid = new TantargyUid(id); } public TantargyResponse(string uid) { Uid = new TantargyUid(uid); } public TantargyResponse(TantargyUid uid) { Uid = uid; } public TantargyResponse(int id) { Uid = new TantargyUid(id); } public TantargyResponse() { } public TantargyResponse(string uid, string nev, Adatszotar kategoria, int sortIndex = 0) { Uid = new TantargyUid(uid); Nev = nev; Kategoria = kategoria; SortIndex = sortIndex; } public TantargyResponse(TantargyUid uid, string nev, Adatszotar kategoria, int sortIndex = 0) { Uid = uid; Nev = nev; Kategoria = kategoria; SortIndex = sortIndex; } public TantargyResponse(int id, string nev, int? sorSzam, Adatszotar kategoria) { Uid = new TantargyUid(id); Nev = nev; Kategoria = kategoria; SorSzam = sorSzam; } public Adatszotar Kategoria { get; } public string Nev { get; set; } public TantargyUid Uid { get; } public bool IsFotargy { get; set; } public int? FotargyId { get; set; } public string FotargyNev { get; set; } public int? FotargyKategoriaId { get; set; } public bool TantargyInTtf { get; set; } public int? TantargyKategoriaOrderIndex { get; set; } public int? FotargyTantargyKategoriaOrderIndex { get; set; } public int SortIndex { get; set; } public int? SorSzam { get; set; } public bool Equals(TantargyResponse x, TantargyResponse y) => x.Uid.Equals(x.Uid, y.Uid); public bool Equals(TantargyResponse y) => Uid.Equals(y.Uid); public int GetHashCode(TantargyResponse obj) => obj.Uid.UidRaw.GetHashCode(); } }