Files
mapo-core/MP.SPEC/Components/ListODL.razor.cs
T
Samuele Locatelli 9407b451c7 bozza ODL
2022-08-01 13:34:16 +02:00

73 lines
1.9 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.SPEC;
using MP.SPEC.Shared;
using MP.SPEC.Components;
using MP.SPEC.Data;
using MP.Data.DatabaseModels;
namespace MP.SPEC.Components
{
public partial class ListODL
{
private bool isLoading { get; set; } = false;
private List<ODLModel>? ListRecords;
private ODLModel? currRecord = null;
private List<ODLModel>? SearchRecords;
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
[Inject]
protected MpDataService MDService { get; set; } = null!;
[Inject]
protected MessageService MessageService { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
await reloadData();
}
private async Task reloadData()
{
isLoading = true;
SearchRecords = await MDService.ListODLFilt(true, "*","*");
totalCount = SearchRecords.Count;
ListRecords = SearchRecords;//.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList();
isLoading = false;
}
public string checkSelect(string CodArticolo)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : "";
}
catch
{ }
}
return answ;
}
private int totalCount = 0;
}
}