75 lines
2.4 KiB
C#
75 lines
2.4 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 template in formato DTO
|
|
/// </summary>
|
|
public List<TemplateSelectDTO>? TemplateDTO { get; set; } = null;
|
|
|
|
/// <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!;
|
|
|
|
/// <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;
|
|
return famHwOK && glassOK && hwOK && colorOK && matOK;
|
|
}
|
|
/// <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;
|
|
return famHwOK || glassOK || hwOK || colorOK || matOK;
|
|
}
|
|
}
|
|
}
|