77 lines
2.6 KiB
C#
77 lines
2.6 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// Payload complessivo delle anagrafiche necessarie x Window
|
|
/// </summary>
|
|
public class BaseListPayload
|
|
{
|
|
/// <summary>
|
|
/// Elenco Famiglie HW in formato DTO
|
|
/// </summary>
|
|
public List<string> FamilyHardware { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Elenco HW
|
|
/// </summary>
|
|
public List<Hardware> Hardware { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Elenco colori
|
|
/// </summary>
|
|
public List<string> ColorMaterial { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Elenco Materiali impiegabili
|
|
/// </summary>
|
|
public List<string> Wood { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Elenco vetri ammessi
|
|
/// </summary>
|
|
public List<string> Glass { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Lista info profili nel nuovo formato compatto
|
|
/// </summary>
|
|
public List<ProfilePayload>? ProfileList { get; set; } = null;
|
|
|
|
/// <summary>
|
|
/// Verifica di validità dell'intero Payload
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
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;
|
|
}
|
|
/// <summary>
|
|
/// Verifica che Payload sia almeno parzialmente popolato
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
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;
|
|
}
|
|
}
|
|
}
|