Update pagina Diario
This commit is contained in:
+11
-11
@@ -6,13 +6,12 @@
|
||||
<div class="card">
|
||||
<div class="card-header table-primary">
|
||||
<div class="row">
|
||||
<div class="col-6 col-lg-2 h2">Diario Produzione</div>
|
||||
<div class="col-6 col-lg-10">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
<div class="col-6 col-lg-3 h2">Diario Produzione</div>
|
||||
<div class="col-6 col-lg-9">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="card-body py-0">
|
||||
@if (currRecord != null)
|
||||
{
|
||||
@*<BasketEditor Basket="@currBasket" DataReset="ResetData" DataUpdated="UpdateData"></BasketEditor>*@
|
||||
@@ -23,6 +22,11 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-12 table-secondary">
|
||||
<SelectionFilter SelFilter="currFilter" filterChanged="DoFilter"></SelectionFilter>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -59,15 +63,11 @@
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<div class="row">
|
||||
<div class="col-8 col-lg-10">
|
||||
</div>
|
||||
<div class="col-4 col-lg-2">
|
||||
<DataPager numRecord="@numRecord" numRecordChanged="ForceReload" />
|
||||
</div>
|
||||
</div>
|
||||
<DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@SearchRecords.Count()" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.JSInterop;
|
||||
using MP.Stats.Data;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Stats.Pages
|
||||
@@ -14,11 +15,14 @@ namespace MP.Stats.Pages
|
||||
|
||||
private MP.Data.DatabaseModels.DdbTurni[] ListRecords;
|
||||
|
||||
private MP.Data.DatabaseModels.DdbTurni[] SearchRecords;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private SelectData currFilter { get; set; } = new SelectData();
|
||||
private int currPage { get; set; } = 1;
|
||||
private int numRecord { get; set; } = 10;
|
||||
|
||||
#endregion Private Properties
|
||||
@@ -43,8 +47,10 @@ namespace MP.Stats.Pages
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
//ListRecords = await StatService.StatScartiGetAll(currFilter.DateStart, currFilter.DateEnd, currFilter.IdxMacchina, currFilter.IdxOdl, currFilter.KeyRichiesta, currFilter.CodArticolo, numRecord, MessageService.SearchVal);
|
||||
ListRecords = await StatService.StatDdbGetAll(numRecord, MessageService.SearchVal);
|
||||
// fare VERO filtro periodo
|
||||
SearchRecords = await StatService.StatDdbGetAll(200, MessageService.SearchVal);
|
||||
// SearchRecords = await StatService.StatDdbGetAll(currFilter.DateStart, currFilter.DateEnd, currFilter.IdxMacchina, currFilter.IdxOdl, currFilter.KeyRichiesta, currFilter.CodArticolo, MessageService.SearchVal);
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToArray();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
@@ -63,6 +69,12 @@ namespace MP.Stats.Pages
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task ForceReloadPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
numRecord = 10;
|
||||
|
||||
Reference in New Issue
Block a user