Files
webwindowconfigurator/WebWindowComplex/Compo/General.razor.cs
T
Annamaria Sassi 90e6bc799a - Aggiunta lista Profili
- Aggiornato setup Hardware
2025-10-14 15:02:39 +02:00

126 lines
3.1 KiB
C#

using Microsoft.AspNetCore.Components;
using WebWindowComplex.DTO;
using WebWindowComplex.Models;
namespace WebWindowComplex.Compo
{
public partial class General
{
#region Public Properties
/// <summary>
/// Finestra corrente
/// </summary>
[Parameter]
public Window CurrWindow { get; set; } = null!;
[Parameter]
public EventCallback<string> EC_SelColor { get; set; }
[Parameter]
public EventCallback<string> EC_SelGlass { get; set; }
[Parameter]
public EventCallback<string> EC_SelWindMat { get; set; }
[Parameter]
public EventCallback<string> EC_SelProfile { get; set; }
[Parameter]
public EventCallback<bool> EC_ReqClose { get; set; }
/// <summary>
/// Elenco anagrafiche di base
/// </summary>
[Parameter]
public BaseListPayload ListPayload { get; set; } = null!;
/// <summary>
/// Elenco Warnings attivi
/// </summary>
[Parameter]
public Dictionary<string, string> ListWarnings { get; set; } = new Dictionary<string, string>();
#endregion Public Properties
#region Protected Properties
protected string CurrColor
{
get => currColor;
set
{
currColor = value;
_ = EC_SelColor.InvokeAsync(value);
}
}
protected string CurrGlass
{
get => currGlass;
set
{
currGlass = value;
_ = EC_SelGlass.InvokeAsync(value);
}
}
protected string CurrMaterial
{
get => currMaterial;
set
{
currMaterial = value;
_ = EC_SelWindMat.InvokeAsync(value);
}
}
protected string CurrProfile
{
get => currProfile;
set
{
currProfile = value;
_ = EC_SelProfile.InvokeAsync(value);
}
}
#endregion Protected Properties
#region Protected Methods
/// <summary>
/// Calcola CSS warning
/// </summary>
/// <param name="fKey"></param>
/// <returns></returns>
protected string cssValid(string fKey)
{
return ListWarnings.ContainsKey(fKey) ? "border border-danger" : "";
}
protected override void OnParametersSet()
{
currColor = CurrWindow.sColorMaterial;
currGlass = CurrWindow.sGlass;
currMaterial = CurrWindow.sMaterial;
currProfile = CurrWindow.sProfilePath;
}
#endregion Protected Methods
#region Private Fields
private string currColor = "";
private string currGlass = "";
private string currMaterial = "";
private string currProfile = "";
#endregion Private Fields
private void ReqClose()
{
_ = EC_ReqClose.InvokeAsync(true);
}
}
}