using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using System.Net.Http; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Components.Routing; using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web.Virtualization; using Microsoft.JSInterop; using MP.INVE; using MP.INVE.Shared; using MP.INVE.Components; using MP.Data.DatabaseModels; using MP.INVE.Data; using MP.Data.DTO; using Blazored.LocalStorage; namespace MP.INVE.Pages { public partial class InveSession { [Inject] private MiDataService MIDataservice { get; set; } = null!; private SelectInveSessionParams currParams = new SelectInveSessionParams(); private List? elencoSessioni; private List? SearchRecords; private List? elencoOperatori; private List? ElencoMagazzini; private DataPager pagerSession = null!; protected override async Task OnInitializedAsync() { await getId(); } private void openNew() { reqNew = true; } protected async Task toggle() { inCorso = !inCorso; await Task.Delay(1); } private bool isLoading { get; set; } = false; private int totalCount { get => currParams.TotCount; set => currParams.TotCount = value; } private int numRecord { get => currParams.NumRec; set { if (currParams.NumRec != value) { currParams.NumRec = value; } } } private int currPage { get => currParams.CurrPage; set { if (currParams.CurrPage != value) { currParams.CurrPage = value; } } } private string idOperatore { get => currParams.idOperatore; set => currParams.idOperatore = value; } private bool reqNew { get => currParams.reqNew; set => currParams.reqNew = value; } private bool inCorso { get => currParams.inCorso; set { if (currParams.inCorso != value) { currParams.inCorso = value; } } } private string authKey { get => currParams.authKey; set => currParams.authKey = value; } [Inject] protected ILocalStorageService localStorage { get; set; } = null!; [Inject] protected NavigationManager NavManager { get; set; } = null!; [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; protected void ForceReload(int newNum) { numRecord = newNum; } protected void ForceReloadPage(int newNum) { currPage = newNum; } protected async Task getId() { OperatoreDTO local = new OperatoreDTO(); local = await localStorage.GetItemAsync("MatrOpr"); if (local != null) { idOperatore = local.MatrOpr.ToString(); authKey = local.hashAuthKey; } } } }