Files
lux/Lux.UI/Components/Compo/Config/ProfThreshDetail.razor.cs
Annamaria Sassi 8525d81201 Correzioni
2026-04-28 18:47:30 +02:00

58 lines
1.4 KiB
C#

using Radzen;
namespace Lux.UI.Components.Compo.Config
{
public partial class ProfThreshDetail
{
[Parameter]
public List<Egw.Window.Data.Threshold> AllRecords { get; set; } = null!;
[Parameter]
public EventCallback<bool> EC_ReqClose { get; set; }
protected override void OnParametersSet()
{
isLoading = true;
UpdateTable();
}
protected void UpdateTable()
{
totalCount = AllRecords.Count;
ListRecords = AllRecords
.OrderBy(x => x.Type)
.Skip(numRecord * (currPage - 1))
.Take(numRecord)
.ToList();
isLoading = false;
}
protected void SaveNumRec(int newNum)
{
isLoading = true;
numRecord = newNum;
currPage = 1;
UpdateTable();
}
protected void SavePage(int newNum)
{
isLoading = true;
currPage = newNum;
UpdateTable();
}
protected List<Egw.Window.Data.Threshold>? ListRecords = null;
private bool isLoading = false;
private int currPage = 1;
private int totalCount = 0;
private int numRecord = 10;
private async Task DoClose(MouseEventArgs args)
{
await EC_ReqClose.InvokeAsync(true);
}
}
}