58 lines
1.3 KiB
C#
58 lines
1.3 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace GPW.CORE.Smart8.Components.Pages
|
|
{
|
|
public partial class Index : ComponentBase, IDisposable
|
|
{
|
|
#region Public Methods
|
|
|
|
public void Dispose()
|
|
{
|
|
MService.EA_DipUpdated -= MService_EA_DipUpdated;
|
|
GC.Collect();
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
MService.EA_DipUpdated += MService_EA_DipUpdated;
|
|
await ReloadData();
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Private Properties
|
|
|
|
/// <summary>
|
|
/// IdxDipCurr
|
|
/// </summary>
|
|
private int idxDipendente { get; set; } = 0;
|
|
|
|
[Inject]
|
|
private Data.MessageService MService { get; set; } = null!;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Private Methods
|
|
|
|
private async void MService_EA_DipUpdated()
|
|
{
|
|
await ReloadData();
|
|
}
|
|
|
|
private async Task ReloadData()
|
|
{
|
|
idxDipendente = MService.IdxDipendente;
|
|
await Task.Delay(1);
|
|
if (idxDipendente > 0)
|
|
{
|
|
await InvokeAsync(StateHasChanged);
|
|
}
|
|
}
|
|
|
|
#endregion Private Methods
|
|
}
|
|
} |