Fix tempalte e lettura dati UL / Scarti
This commit is contained in:
@@ -17,6 +17,8 @@ namespace MP.Stats.Data
|
||||
private static IConfiguration _configuration;
|
||||
private static ILogger<MpStatsService> _logger;
|
||||
|
||||
private static List<MP.Data.DatabaseModels.Actions> ActionsList = new List<MP.Data.DatabaseModels.Actions>();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Protected Fields
|
||||
@@ -57,6 +59,11 @@ namespace MP.Stats.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public Task<MP.Data.DatabaseModels.Actions[]> ActionsGetAll()
|
||||
{
|
||||
return Task.FromResult(dbController.ActionsGetAll().ToArray());
|
||||
}
|
||||
|
||||
public void rollBackEdit(object item)
|
||||
{
|
||||
dbController.RollBackEntity(item);
|
||||
|
||||
+39
-36
@@ -8,50 +8,53 @@
|
||||
<div class="card-body">
|
||||
@if (currRecord != null)
|
||||
{
|
||||
@*<BasketEditor Basket="@currBasket" DataReset="ResetData" DataUpdated="UpdateData"></BasketEditor>*@
|
||||
@*<BasketEditor Basket="@currBasket" DataReset="ResetData" DataUpdated="UpdateData"></BasketEditor>*@
|
||||
}
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:70%"></div>
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:70%"></div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Descrizione</th>
|
||||
<th class="text-right">Qta</th>
|
||||
<th class="text-right">Operatore</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Descrizione</th>
|
||||
<th class="text-right">Qta</th>
|
||||
<th class="text-right">Operatore</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.DataOraRif, @record.IdxMacchina, @record.Causale)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.DataOraRif.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.DataOraRif.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">
|
||||
<div>[@record.Causale] @record.Descrizione</div>
|
||||
<div class="small">@record.Note</div>
|
||||
</td>
|
||||
<td class="text-right">@record.Qta</td>
|
||||
<td class="text-right">@record.Cognome @record.Nome (@record.MatrOpr)</td>
|
||||
</tr>
|
||||
<tr class="@checkSelect(@record.DataOraRif, @record.IdxMacchina, @record.Causale)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.DataOraRif.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.DataOraRif.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">
|
||||
<div class="row">
|
||||
<div class="col">[@record.Causale]</div>
|
||||
<div class="col text-right">@record.Descrizione</div>
|
||||
</div>
|
||||
<div class="small">@record.Note</div>
|
||||
</td>
|
||||
<td class="text-right">@record.Qta</td>
|
||||
<td class="text-right">@record.Cognome @record.Nome (@record.MatrOpr)</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
|
||||
@@ -8,50 +8,57 @@
|
||||
<div class="card-body">
|
||||
@if (currRecord != null)
|
||||
{
|
||||
@*<BasketEditor Basket="@currBasket" DataReset="ResetData" DataUpdated="UpdateData"></BasketEditor>*@
|
||||
@*<BasketEditor Basket="@currBasket" DataReset="ResetData" DataUpdated="UpdateData"></BasketEditor>*@
|
||||
}
|
||||
@if (ListRecords == null)
|
||||
{
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:70%"></div>
|
||||
<div class="progress-bar progress-bar-striped progress-bar-animated" style="width:70%"></div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Descrizione</th>
|
||||
<th class="text-right">Qta</th>
|
||||
<th class="text-right">Operatore</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
<table class="table table-sm table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Macchina</th>
|
||||
<th>Data</th>
|
||||
<th>ODL/Commessa</th>
|
||||
<th>Articolo</th>
|
||||
<th class="text-right">Descrizione</th>
|
||||
<th class="text-right">Qta</th>
|
||||
<th class="text-right">Operatore</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var record in ListRecords)
|
||||
{
|
||||
<tr class="@checkSelect(@record.IdxLog)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.DataOraRif.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.DataOraRif.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">
|
||||
<div>@record.Valore</div>
|
||||
<div class="small">[@record.Azione] @record.IdxLog</div>
|
||||
</td>
|
||||
<td class="text-right">@record.Qta.ToString("N0")</td>
|
||||
<td class="text-right">@record.Cognome @record.Nome (@record.MatrOpr)</td>
|
||||
</tr>
|
||||
<tr class="@checkSelect(@record.IdxLog)">
|
||||
<td>
|
||||
<div>@record.CodMacchina</div>
|
||||
<div class="small">@record.IdxMacchina</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>@record.DataOraRif.ToString("yyyy.MM.dd")</div>
|
||||
<div class="small">@record.DataOraRif.ToString("ddd HH:mm.ss")</div>
|
||||
</td>
|
||||
<td>@record.IdxOdl | @record.KeyRichiesta</td>
|
||||
<td>@record.CodArticolo</td>
|
||||
<td class="text-right">
|
||||
<div>@record.Valore</div>
|
||||
<div class="small row">
|
||||
<div class="col">
|
||||
<span class="@decodeAction(@record.Azione).Class" aria-hidden="true"></span> [@record.IdxLog]
|
||||
</div>
|
||||
<div class="col text-right">
|
||||
@decodeAction(@record.Azione).Descrizione
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-right">@record.Qta.ToString("N0")</td>
|
||||
<td class="text-right">@record.Cognome @record.Nome (@record.MatrOpr)</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
}
|
||||
</div>
|
||||
<div class="card-footer py-1">
|
||||
|
||||
@@ -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
|
||||
@@ -10,6 +11,7 @@ namespace MP.Stats.Pages
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private MP.Data.DatabaseModels.Actions[] ActionsList;
|
||||
private MP.Data.DatabaseModels.UserActionLog currRecord = null;
|
||||
|
||||
private MP.Data.DatabaseModels.UserActionLog[] ListRecords;
|
||||
@@ -38,12 +40,22 @@ namespace MP.Stats.Pages
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
private async Task reloadData()
|
||||
{
|
||||
ActionsList = await StatService.ActionsGetAll();
|
||||
ListRecords = await StatService.StatUserLogGetAll(numRecord, MessageService.SearchVal);
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task ForceReload(int newNum)
|
||||
{
|
||||
numRecord = newNum;
|
||||
ListRecords = await StatService.StatUserLogGetAll(numRecord, MessageService.SearchVal);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -51,7 +63,7 @@ namespace MP.Stats.Pages
|
||||
numRecord = 10;
|
||||
MessageService.ShowSearch = true;
|
||||
MessageService.EA_SearchUpdated += OnSeachUpdated;
|
||||
ListRecords = await StatService.StatUserLogGetAll(numRecord, MessageService.SearchVal);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
protected void ResetData()
|
||||
@@ -63,7 +75,7 @@ namespace MP.Stats.Pages
|
||||
protected async Task UpdateData()
|
||||
{
|
||||
currRecord = null;
|
||||
ListRecords = await StatService.StatUserLogGetAll(numRecord, MessageService.SearchVal);
|
||||
await reloadData();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
@@ -85,6 +97,16 @@ namespace MP.Stats.Pages
|
||||
return answ;
|
||||
}
|
||||
|
||||
public MP.Data.DatabaseModels.Actions decodeAction(string azione)
|
||||
{
|
||||
// cerco
|
||||
MP.Data.DatabaseModels.Actions data = ActionsList
|
||||
.Where(x => x.Azione == azione)
|
||||
.FirstOrDefault();
|
||||
data = data != null ? data : new MP.Data.DatabaseModels.Actions() { Azione = "ND", Class = "", Descrizione = "ND" };
|
||||
return data;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
MessageService.EA_SearchUpdated -= OnSeachUpdated;
|
||||
|
||||
Reference in New Issue
Block a user