Cambio comportamento insert fermate x mostrare esito insert
This commit is contained in:
@@ -16,13 +16,20 @@ else
|
||||
<div class="d-flex justify-content-between flex-wrap align-items-center mb-3">
|
||||
@if (!string.IsNullOrEmpty(lblOut))
|
||||
{
|
||||
<div class="alert @alertCss fs-5 w-100">
|
||||
@lblOut
|
||||
<div class="alert @alertCss shadow-lg fs-1 text-center p-5 w-100">
|
||||
<b>@titleOut</b>
|
||||
<div>
|
||||
@lblOut
|
||||
</div>
|
||||
<button class="btn btn-success" @onclick="ForceReloadPage"><i class="fa-solid fa-rotate-right"></i> Reload page</button>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
@foreach (var item in events2show)
|
||||
{
|
||||
<ProdStopMan objCss="@item.CssClass" objIcon="@item.Icon" objTxt="@(item.label)" IdxEvento="@item.value" E_EventSelected="EventRecord"></ProdStopMan>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using global::Microsoft.AspNetCore.Components;
|
||||
using Microsoft.AspNetCore.Components.Routing;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
@@ -9,16 +10,13 @@ namespace MP_TAB3.Pages
|
||||
{
|
||||
public partial class ProdStop
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
#endregion Public Methods
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
protected int dltMinRealtime = 1;
|
||||
|
||||
protected bool isProcessing = false;
|
||||
|
||||
protected string lblOut = "";
|
||||
protected int minAnticipoRicalcolo = 1;
|
||||
|
||||
protected bool rdm_ChkOnly = false;
|
||||
@@ -33,12 +31,10 @@ namespace MP_TAB3.Pages
|
||||
|
||||
protected string alertCss { get; set; } = "alert-danger";
|
||||
|
||||
|
||||
protected DateTime DtRif { get; set; } = DateTime.Now;
|
||||
|
||||
protected List<vSelEventiBCodeModel> events2show { get; set; } = new List<vSelEventiBCodeModel>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Determina se insert sia Realtime o batch con DataOra (in base a diff tra DataOra
|
||||
/// selezionata e realtime, se superiore ad X minuti NON � realtime)
|
||||
@@ -56,8 +52,6 @@ namespace MP_TAB3.Pages
|
||||
}
|
||||
}
|
||||
|
||||
protected string lblOut { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
protected StatusData MDataService { get; set; } = null!;
|
||||
|
||||
@@ -186,12 +180,13 @@ namespace MP_TAB3.Pages
|
||||
TabDServ.MacchinaSetInsEnab(IdxMacc, true);
|
||||
}
|
||||
// mostro esito
|
||||
alertCss = "alert-succes";
|
||||
lblOut = $"Registrata dichiarazione fermata [{rigaEvento.Nome}] alle {DateTime.Now:HH:mm:ss}";
|
||||
alertCss = "alert-primary";
|
||||
titleOut = rigaEvento.Nome;
|
||||
lblOut = $"Registrata dichiarazione fermata alle {DateTime.Now:HH:mm:ss}";
|
||||
}
|
||||
else
|
||||
{
|
||||
alertCss = "alert-danger";
|
||||
alertCss = "alert-warning";
|
||||
lblOut = $"Codice evento non valido! {IdxEv}";
|
||||
}
|
||||
}
|
||||
@@ -215,6 +210,11 @@ namespace MP_TAB3.Pages
|
||||
}
|
||||
}
|
||||
|
||||
protected void ForceReloadPage()
|
||||
{
|
||||
NavMan.NavigateTo(NavMan.Uri, true);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await base.OnInitializedAsync();
|
||||
@@ -227,34 +227,6 @@ namespace MP_TAB3.Pages
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected void SetDate(DateTime newDate)
|
||||
{
|
||||
DtRif = newDate;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int MatrOpr
|
||||
{
|
||||
get => MsgServ.MatrOpr;
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
|
||||
|
||||
|
||||
protected override async Task ReloadData()
|
||||
{
|
||||
if (string.IsNullOrEmpty(IdxMacc))
|
||||
@@ -277,6 +249,27 @@ namespace MP_TAB3.Pages
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
protected void SetDate(DateTime newDate)
|
||||
{
|
||||
DtRif = newDate;
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private static Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private string titleOut = "";
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Private Properties
|
||||
|
||||
private int MatrOpr
|
||||
{
|
||||
get => MsgServ.MatrOpr;
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user