Files
gpw_next/GPW.CORE6.Smart/Pages/Index.razor.cs
T
2024-08-22 16:03:31 +02:00

59 lines
1.3 KiB
C#

using GPW.CORE6.Smart.Data;
using Microsoft.AspNetCore.Components;
namespace GPW.CORE6.Smart.Pages
{
public partial class Index : 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 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
}
}