99 lines
3.3 KiB
C#
99 lines
3.3 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> Material { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// Elenco vetri ammessi
|
|
/// </summary>
|
|
public List<string> Glass { get; set; } = null!;
|
|
|
|
#if false
|
|
/// <summary>
|
|
/// Elenco profili ammessi
|
|
/// </summary>
|
|
[Obsolete("Sostituire con info ProfileList")]
|
|
public List<string>? Profile { get; set; } = null;
|
|
|
|
/// <summary>
|
|
/// Elenco profili ammessi
|
|
/// </summary>
|
|
[Obsolete("Sostituire con info ProfileList")]
|
|
public Dictionary<string, List<Threshold>>? Threshold { get; set; } = null;
|
|
#endif
|
|
|
|
/// <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 matOK = Material != null && Material.Count > 0;
|
|
bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0;
|
|
bool profileOK = ProfileList != null && ProfileList.Count > 0;
|
|
#if false
|
|
bool profileOKOld = Profile != null && Profile.Count > 0;
|
|
bool thresholdOK = Threshold != null && Threshold.Count > 0;
|
|
#endif
|
|
return famHwOK && glassOK && hwOK && colorOK && matOK && 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 matOK = Material != null && Material.Count > 0;
|
|
bool colorOK = ColorMaterial != null && ColorMaterial.Count > 0;
|
|
bool profileOK = ProfileList != null && ProfileList.Count > 0;
|
|
#if false
|
|
bool profileOKOld = Profile != null && Profile.Count > 0;
|
|
bool thresholdOK = Threshold != null && Threshold.Count > 0;
|
|
#endif
|
|
return famHwOK || glassOK || hwOK || colorOK || matOK || profileOK;
|
|
}
|
|
}
|
|
}
|