This commit is contained in:
zaccaria.majid
2022-10-10 10:11:40 +02:00
9 changed files with 60 additions and 18 deletions
+3 -3
View File
@@ -196,18 +196,18 @@ namespace MP.Data.Controllers
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
/// </summary>
/// <returns></returns>
public List<StatODLModel> StatOdl(int IdxOdl)
public async Task<List<StatODLModel>> StatOdl(int IdxOdl)
{
List<StatODLModel> dbResult = new List<StatODLModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
var IdxODL = new SqlParameter("@IdxODL", IdxOdl);
dbResult = dbCtx
dbResult = await dbCtx
.DbSetStatOdl
.FromSqlRaw("EXEC stp_STAT_ODL @IdxODL", IdxODL)
.AsNoTracking()
.ToList();
.ToListAsync();
}
return dbResult;
}
+2 -2
View File
@@ -16,10 +16,10 @@ namespace MP.Data.DatabaseModels
[Key]
public int IdxStato { get; set; }
public string DescrizioneCodArticolo { get; set; } = "";
public string Descrizione { get; set; } = "";
public string Semaforo { get; set; }
public string Css { get; set; }
public decimal TotDurata { get; set; }
public double TotDurata { get; set; }
#endregion Public Properties
}
+15 -5
View File
@@ -27,7 +27,7 @@ else
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(@record.CodArticolo)">
<tr class="@checkSelect(@record.IdxOdl)">
<td>
@record.CodArticolo
<div class="small textConsensed text-secondary">@record.ArticoloNav.DescArticolo</div>
@@ -83,9 +83,8 @@ else
<b>@record.DurataMinuti</b>
</div>
<div>
<button class="btn btn-sm btn-primary py-0" type="button" data-bs-toggle="modal" data-bs-target="#staticBackdrop" title="Mostra statistiche"><i class="fa-solid fa-chart-pie"></i></button>
<button class="btn btn-sm btn-primary py-0" type="button" @onclick="() => selectRecord(record)" data-bs-toggle="modal" data-bs-target="#staticBackdrop" title="Mostra statistiche"><i class="fa-solid fa-chart-pie"></i></button>
</div>
<!-- Modal -->
<div class="modal fade" id="staticBackdrop" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
<div class="modal-dialog">
@@ -95,8 +94,19 @@ else
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div>
</div>
@if (currRecord != null)
{
<h3>ODL @currRecord.IdxOdl</h3>
@if (ListOdlStats != null)
{
<ul>
@foreach (var statRecord in ListOdlStats)
{
<li>@statRecord.Descrizione - @($"{statRecord.TotDurata:N1}min")</li>
}
</ul>
}
}
</div>
</div>
</div>
+26 -4
View File
@@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data.DatabaseModels;
using MP.SPEC.Data;
using Newtonsoft.Json.Linq;
namespace MP.SPEC.Components
{
@@ -22,14 +23,14 @@ namespace MP.SPEC.Components
#region Public Methods
public string checkSelect(string CodArticolo)
public string checkSelect(int IdxOdl)
{
string answ = "";
if (currRecord != null)
{
try
{
answ = (currRecord.CodArticolo == CodArticolo) ? "table-info" : "";
answ = (currRecord.IdxOdl == IdxOdl) ? "table-info" : "";
}
catch
{ }
@@ -39,8 +40,10 @@ namespace MP.SPEC.Components
public void Dispose()
{
#if false
MessageService.EA_PageUpdated -= MessageService_EA_PageUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
MessageService.EA_SearchUpdated -= OnSeachUpdated;
#endif
}
#endregion Public Methods
@@ -88,7 +91,10 @@ namespace MP.SPEC.Components
protected async Task UpdateData()
{
currRecord = null;
#if false
currRecord = null;
#endif
await selectRecord(null);
await reloadData();
}
@@ -97,9 +103,25 @@ namespace MP.SPEC.Components
#region Private Fields
private ODLModel? currRecord = null;
protected async Task selectRecord(ODLModel? currRec)
{
await Task.Delay(1);
currRecord = currRec;
if (currRec != null)
{
ListOdlStats = await MDService.StatOdl(currRec.IdxOdl);
}
else
{
ListOdlStats = null;
}
}
private List<ODLModel>? ListRecords;
private List<ListValues>? ListStati;
private List<ODLModel>? SearchRecords;
private List<StatODLModel>? ListOdlStats;
#endregion Private Fields
+10
View File
@@ -408,6 +408,16 @@ namespace MP.SPEC.Data
return Task.FromResult(dbController.AnagGruppiAziende());
}
/// <summary>
/// Statistiche ODL calcolate (da stored stp_STAT_ODL)
/// </summary>
/// <returns></returns>
public Task<List<StatODLModel>> StatOdl(int IdxOdl)
{
return dbController.StatOdl(IdxOdl);
}
/// <summary>
/// Restitusice elenco fasi
/// </summary>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2210.1008</Version>
<Version>6.16.2210.1009</Version>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2210.1008</h4>
<h4>Versione: 6.16.2210.1009</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2210.1008
6.16.2210.1009
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2210.1008</version>
<version>6.16.2210.1009</version>
<url>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>