ff865edaf7
- update gestione reset key e cod impiego - test registrazione in debug - ok generazione nuove KEY
118 lines
2.9 KiB
C#
118 lines
2.9 KiB
C#
using EgwControlCenter.Core;
|
|
using EgwControlCenter.Core.DTO;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace EgwControlCenter.App.Components.Compo
|
|
{
|
|
public partial class ApplicationCheck : IDisposable
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public EventCallback<bool> EC_GotoSetup { get; set; }
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Public Methods
|
|
|
|
public void Dispose()
|
|
{
|
|
ACService.EA_StatusUpdated -= ACService_EA_StatusUpdated;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected AppControlService ACService { get; set; } = null!;
|
|
|
|
protected bool ShowOnlyUpdate
|
|
{
|
|
get => showOnlyUpdate;
|
|
set
|
|
{
|
|
showOnlyUpdate = value;
|
|
ForceReload();
|
|
}
|
|
}
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected void ForceCheck()
|
|
{
|
|
ACService.DoFullCheck(true);
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
ACService.EA_StatusUpdated += ACService_EA_StatusUpdated;
|
|
}
|
|
|
|
protected override void OnParametersSet()
|
|
{
|
|
ForceReload();
|
|
}
|
|
|
|
protected void SetNumRec(int newNum)
|
|
{
|
|
numRecord = newNum;
|
|
currPage = 1;
|
|
ForceReload();
|
|
}
|
|
|
|
protected void SetPage(int newNum)
|
|
{
|
|
currPage = newNum;
|
|
ForceReload();
|
|
}
|
|
|
|
protected async void ToggleSetup()
|
|
{
|
|
await EC_GotoSetup.InvokeAsync(true);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Properties
|
|
|
|
private int currPage { get; set; } = 1;
|
|
|
|
private List<VersStatusDTO> CurrRecords
|
|
{
|
|
get => ACService.ListAppStatus;
|
|
}
|
|
|
|
private bool isLoading { get; set; } = false;
|
|
private List<VersStatusDTO>? SearchRecords { get; set; } = null;
|
|
private List<VersStatusDTO>? ListRecords { get; set; } = null;
|
|
private int numRecord { get; set; } = 5;
|
|
private bool showOnlyUpdate { get; set; } = true;
|
|
private int totalCount { get; set; } = 0;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private void ACService_EA_StatusUpdated()
|
|
{
|
|
ForceReload();
|
|
}
|
|
|
|
private void ForceReload()
|
|
{
|
|
SearchRecords = CurrRecords
|
|
.Where(x => x.HasUpdate || !ShowOnlyUpdate)
|
|
.ToList();
|
|
totalCount = SearchRecords.Count;
|
|
ListRecords = SearchRecords
|
|
.Skip(numRecord * (currPage - 1))
|
|
.Take(numRecord)
|
|
.ToList();
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |