Files
mapo-core/MP.INVE/Pages/Invio.razor.cs
T
2022-12-14 14:43:45 +01:00

102 lines
2.6 KiB
C#

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 Blazored.LocalStorage;
using MP.Data.DTO;
using MP.Data;
using MP.INVE.Data;
using MP.Data.DatabaseModels;
namespace MP.INVE.Pages
{
public partial class Invio
{
[Inject]
public MiDataService MIService { get; set; } = null!;
protected SelectInvioParams currParams = new SelectInvioParams();
private int totalCount
{
get => currParams.TotCount;
set
{
if (currParams.TotCount != value)
{
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;
}
}
}
protected void ForceReload(int newNum)
{
numRecord = newNum;
}
protected void ForceReloadPage(int newNum)
{
currPage = newNum;
}
protected List<InventorySessionModel> sessions { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
await reloadData();
}
private List<InventorySessionModel>? elencoSessioni;
protected bool isLoading = false;
private async Task reloadData()
{
elencoSessioni = null;
isLoading = true;
elencoSessioni = MIService.InventSessCurrList();
await Task.Delay(1);
await InvokeAsync(() => StateHasChanged());
await Task.Delay(1);
isLoading = false;
}
private int _sessID;
protected int sessID
{
get => _sessID;
set=> _sessID = value;
}
}
}