Update scarti x nuovo datapager
This commit is contained in:
@@ -70,6 +70,6 @@
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
<DataPager numRecord="@numRecord" numRecordChanged="ForceReload" totalCount="@SearchRecords.Count()" />
|
||||
<DataPager PageSize="@numRecord" currPage="@currPage" numRecordChanged="ForceReload" numPageChanged="ForceReloadPage" totalCount="@SearchRecords.Count()" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,6 +23,7 @@ namespace MP.Stats.Pages
|
||||
#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
|
||||
@@ -48,7 +49,7 @@ namespace MP.Stats.Pages
|
||||
private async Task reloadData()
|
||||
{
|
||||
SearchRecords = await StatService.StatScartiGetAll(currFilter.DateStart, currFilter.DateEnd, currFilter.IdxMacchina, currFilter.IdxOdl, currFilter.KeyRichiesta, currFilter.CodArticolo, MessageService.SearchVal);
|
||||
ListRecords = SearchRecords.Take(numRecord).ToArray();
|
||||
ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToArray();
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
@@ -67,6 +68,12 @@ namespace MP.Stats.Pages
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected async Task ForceReloadPage(int newNum)
|
||||
{
|
||||
currPage = newNum;
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
MessageService.ShowSearch = true;
|
||||
|
||||
Reference in New Issue
Block a user