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 preselezioni (globalmente opzionali)
///
public class SelectPayload
{
///
/// Famiglia HW selezionata
///
public string FamilyHardware { get; set; } = string.Empty;
///
/// Colore selezionato
///
public string ColorMaterial { get; set; } = string.Empty;
///
/// Materiale selezionato
///
public string Wood { get; set; } = string.Empty;
///
/// Tipologia vetro selezionato
///
public string Glass { get; set; } = string.Empty;
///
/// Tipologia profilo selezionato
///
public string Profile { get; set; } = string.Empty;
///
/// Verifica di validità dell'intero Payload
///
///
public bool IsValid()
{
bool famHwOK = !string.IsNullOrEmpty(FamilyHardware);
bool colorOK = !string.IsNullOrEmpty(ColorMaterial);
bool glassOk = !string.IsNullOrEmpty(Glass);
bool woodOK = !string.IsNullOrEmpty(Wood);
bool profileOK = !string.IsNullOrEmpty(Profile);
return famHwOK && colorOK && woodOK && glassOk && profileOK;
}
///
/// Verifica che Payload sia almeno parzialmente popolato
///
///
public bool IsPopulated()
{
bool famHwOK = FamilyHardware != null;
bool glassOK = Glass != null;
bool woodOK = Wood != null;
bool colorOK = ColorMaterial != null;
bool profileOK = Profile != null;
return famHwOK || glassOK || colorOK || woodOK || profileOK;
}
}
}