using Egw.Window.Data; using Microsoft.AspNetCore.Components; using System; using System.Collections.Generic; using System.Linq; using System.Net.Http.Headers; using System.Text; using System.Threading.Tasks; namespace WebWindowComplex.DTO { /// /// Payload complessivo delle anagrafiche necessarie x Window /// public class BaseListPayload { /// /// Elenco Famiglie HW in formato DTO /// public List FamilyHardware { get; set; } = null!; /// /// Elenco HW /// public List Hardware { get; set; } = null!; /// /// Elenco colori /// public List ColorMaterial { get; set; } = null!; /// /// Elenco Materiali impiegabili /// public List Wood { get; set; } = null!; /// /// Elenco vetri ammessi /// public List Glass { get; set; } = null!; /// /// Lista info profili nel nuovo formato compatto /// public List? ProfileList { get; set; } = null; /// /// Verifica di validità dell'intero Payload /// /// public bool IsValid() { bool famHwOK = FamilyHardware != null && FamilyHardware.Count > 0; bool hwOK = Hardware != null && Hardware.Count > 0; bool glassOK = Glass != null && Glass.Count > 0; bool woodOK = Wood != null && Wood.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; bool profileOK = ProfileList != null && ProfileList.Count > 0; return famHwOK && glassOK && hwOK && colorOK && woodOK && profileOK; } /// /// Verifica che Payload sia almeno parzialmente popolato /// /// public bool IsPopulated() { bool famHwOK = FamilyHardware != null && FamilyHardware.Count > 0; bool hwOK = Hardware != null && Hardware.Count > 0; bool glassOK = Glass != null && Glass.Count > 0; bool woodOK = Wood != null && Wood.Count > 0; bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0; bool profileOK = ProfileList != null && ProfileList.Count > 0; return famHwOK || glassOK || hwOK || colorOK || woodOK || profileOK; } } }