Files
2026-01-19 10:29:50 +01:00

106 lines
2.5 KiB
C#

using Microsoft.AspNetCore.Components;
using WebWindowTest.DTO;
using WebWindowTest.Models;
namespace WebWindowTest.Compo
{
public partial class General
{
#region Public Properties
/// <summary>
/// Finestra corrente
/// </summary>
[Parameter]
public Window CurrWindow { get; set; } = null!;
[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
/// <summary>
/// Colore corrente
/// </summary>
protected string CurrColor
{
get => currColor;
}
/// <summary>
/// Vetro corrente
/// </summary>
protected string CurrGlass
{
get => currGlass;
}
/// <summary>
/// Materiale corrente
/// </summary>
protected string CurrMaterial
{
get => currMaterial;
}
/// <summary>
/// Profilo corrente
/// </summary>
protected string CurrProfile
{
get => currProfile;
}
#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);
}
}
}