4fda312aac
- altri metodi tracciati - modifica json x prod - aggiunta Async vari
113 lines
2.8 KiB
C#
113 lines
2.8 KiB
C#
using GWMS.Data.DTO;
|
|
using GWMS.UI.Data;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.JSInterop;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GWMS.UI.Pages
|
|
{
|
|
[AllowAnonymous]
|
|
public partial class Test : ComponentBase, IDisposable
|
|
{
|
|
#region Private Fields
|
|
|
|
private string emailCorpo = "Questo è un messaggio di prova: verifica invio email con MailKit asp.net core.";
|
|
private string emailDest = "samuele@steamware.net";
|
|
private string emailOggetto = "Prova invio email";
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Protected Fields
|
|
|
|
/// <summary>
|
|
/// Valore PlantId filtrato da claim
|
|
/// </summary>
|
|
protected int ClaimPlantId = -1;
|
|
|
|
#endregion Protected Fields
|
|
|
|
#region Private Properties
|
|
|
|
private bool isLoading { get; set; } = false;
|
|
|
|
private bool ShowCharts { get; set; } = false;
|
|
|
|
#endregion Private Properties
|
|
|
|
#region Protected Properties
|
|
|
|
[Inject]
|
|
protected GWMSDataService DataService { get; set; }
|
|
|
|
[Inject]
|
|
protected IJSRuntime JSRuntime { get; set; }
|
|
|
|
[Inject]
|
|
protected MessageService MessageService { get; set; }
|
|
|
|
[Inject]
|
|
protected NavigationManager NavManager { get; set; }
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Private Methods
|
|
|
|
/// <summary>
|
|
/// Recupero Claims dell'utente...
|
|
///
|
|
/// https://docs.microsoft.com/it-it/aspnet/core/blazor/security/?view=aspnetcore-5.0
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
private async Task GetClaimsData()
|
|
{
|
|
ClaimPlantId = 0;
|
|
await Task.Delay(1);
|
|
}
|
|
|
|
private async Task ReloadAllData()
|
|
{
|
|
isLoading = true;
|
|
await GetClaimsData();
|
|
isLoading = false;
|
|
}
|
|
|
|
#endregion Private Methods
|
|
|
|
#region Protected Methods
|
|
|
|
protected override async Task OnInitializedAsync()
|
|
{
|
|
MessageService.ShowSearch = false;
|
|
MessageService.PageName = "Test page";
|
|
MessageService.PageIcon = "fas fa-gears pr-2";
|
|
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
|
await ReloadAllData();
|
|
}
|
|
|
|
protected async Task SendEmail()
|
|
{
|
|
await DataService.TestSendEmailAsync(emailDest, emailOggetto, emailCorpo);
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
|
|
#region Public Methods
|
|
|
|
public void Dispose()
|
|
{
|
|
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
|
}
|
|
|
|
public async void OnSeachUpdated()
|
|
{
|
|
await Task.Delay(1);
|
|
StateHasChanged();
|
|
}
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |