Salvataggio da esterno componente x commenti
This commit is contained in:
@@ -47,14 +47,12 @@ namespace MP_TAB_SERV.Components
|
||||
[Parameter]
|
||||
public EventListModel? CurrRecord
|
||||
{
|
||||
//get;
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
DateSel = value.InizioStato ?? DateTime.Now;
|
||||
UserComment = value.Value;
|
||||
//ShowBtn = insRealtime;
|
||||
ShowBtn = false;
|
||||
}
|
||||
}
|
||||
@@ -90,12 +88,12 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected void doCancel()
|
||||
public void doCancel()
|
||||
{
|
||||
DoReset();
|
||||
}
|
||||
|
||||
protected async Task doSave()
|
||||
public async Task doSave()
|
||||
{
|
||||
// registro evento
|
||||
EventListModel newRec = new EventListModel()
|
||||
@@ -126,21 +124,16 @@ namespace MP_TAB_SERV.Components
|
||||
|
||||
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||
{
|
||||
#if false
|
||||
// cerco se ci sia una data-ora rif salvata...
|
||||
DateSel = await MServ.CommentoDtRifGet(false);
|
||||
if (!insRealtime)
|
||||
// verifico SE ci sia una data da usare...
|
||||
bool hasDtRif = await MServ.SessHasVal(MessageService.KeyCommDtRif);
|
||||
if (hasDtRif)
|
||||
{
|
||||
await Task.Delay(1);
|
||||
ShowBtn = false;
|
||||
UserComment = await MServ.CommentoValGet(true);
|
||||
if (ShowBtn)
|
||||
{
|
||||
DateSel = await MServ.CommentoDtRifGet(true);
|
||||
ShowBtn = false;
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
DateSel = await MServ.CommentoDtRifGet(true);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>6.16.2310.1011</Version>
|
||||
<Version>6.16.2310.1016</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>MP_TAB_SERV</RootNamespace>
|
||||
</PropertyGroup>
|
||||
@@ -47,10 +47,10 @@
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
|
||||
</Target>
|
||||
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -10,7 +10,7 @@ else
|
||||
<MachineBlock RecMSE="CurrMSE" FullMode="false"></MachineBlock>
|
||||
</div>
|
||||
|
||||
<NotesEditor Title="Dichiarazione Fermo Retroattiva + Commento" RecMSE="CurrMSE"></NotesEditor>
|
||||
<NotesEditor @ref="noteEdit" Title="Dichiarazione Fermo Retroattiva + Commento" RecMSE="CurrMSE" CanSave="false" E_DateSel="SetDate"></NotesEditor>
|
||||
|
||||
<div class="d-flex justify-content-between flex-wrap align-items-center mb-3">
|
||||
@if (!string.IsNullOrEmpty(lblOut))
|
||||
|
||||
@@ -2,36 +2,17 @@ using global::Microsoft.AspNetCore.Components;
|
||||
using MP.Data;
|
||||
using MP.Data.DatabaseModels;
|
||||
using MP.Data.Services;
|
||||
using MP_TAB_SERV.Components;
|
||||
|
||||
namespace MP_TAB_SERV.Pages
|
||||
{
|
||||
public partial class ProdStop
|
||||
{
|
||||
#region Public Properties
|
||||
#region Protected Fields
|
||||
|
||||
/// <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)
|
||||
/// </summary>
|
||||
public bool insRealtime
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = true;
|
||||
//try
|
||||
//{
|
||||
// if (Math.Abs(DtRif.Subtract(DateTime.Now).TotalMinutes) > dltMinRealtime)
|
||||
// {
|
||||
// answ = false;
|
||||
// }
|
||||
//}
|
||||
//catch
|
||||
//{ }
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
protected int dltMinRealtime = 1;
|
||||
|
||||
#endregion Public Properties
|
||||
#endregion Protected Fields
|
||||
|
||||
#region Protected Properties
|
||||
|
||||
@@ -39,10 +20,29 @@ namespace MP_TAB_SERV.Pages
|
||||
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
|
||||
protected DateTime DtRif { get; set; } = DateTime.Now;
|
||||
|
||||
protected List<vSelEventiBCodeModel> events2show { get; set; } = new List<vSelEventiBCodeModel>();
|
||||
|
||||
protected string IdxMacc { get; set; } = "";
|
||||
|
||||
/// <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)
|
||||
/// </summary>
|
||||
protected bool insRealtime
|
||||
{
|
||||
get
|
||||
{
|
||||
bool answ = true;
|
||||
if (Math.Abs(DtRif.Subtract(DateTime.Now).TotalMinutes) > dltMinRealtime)
|
||||
{
|
||||
answ = false;
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
protected string lblOut { get; set; } = "";
|
||||
|
||||
[Inject]
|
||||
@@ -51,13 +51,17 @@ namespace MP_TAB_SERV.Pages
|
||||
[Inject]
|
||||
protected MessageService MServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
protected NotesEditor? noteEdit { get; set; }
|
||||
|
||||
[Inject]
|
||||
protected SharedMemService SMServ { get; set; } = null!;
|
||||
|
||||
[Inject]
|
||||
protected TabDataService TabServ { get; set; } = null!;
|
||||
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
@@ -99,6 +103,12 @@ namespace MP_TAB_SERV.Pages
|
||||
}
|
||||
else
|
||||
{
|
||||
// chiamo registrazione commento...
|
||||
if (noteEdit != null)
|
||||
{
|
||||
await noteEdit.doSave();
|
||||
}
|
||||
|
||||
#if false
|
||||
// in primis disabilito insert...
|
||||
DataLayerObj.taStatoMacchine.setInsEnabled(idxMacchina, false);
|
||||
@@ -187,12 +197,16 @@ namespace MP_TAB_SERV.Pages
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
dltMinRealtime = SMServ.GetConfInt("dltMinRealtime");
|
||||
// leggo gli altri dati
|
||||
await ReloadData();
|
||||
}
|
||||
|
||||
protected void SetDate(DateTime newDate)
|
||||
{
|
||||
DtRif = newDate;
|
||||
}
|
||||
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
@@ -203,8 +217,6 @@ namespace MP_TAB_SERV.Pages
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
[Inject]
|
||||
protected NavigationManager NavMan { get; set; } = null!;
|
||||
|
||||
#region Private Methods
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>Modulo MAPOSPEC </i>
|
||||
<h4>Versione: 6.16.2310.1011</h4>
|
||||
<h4>Versione: 6.16.2310.1016</h4>
|
||||
<br /> Note di rilascio:
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
@@ -1 +1 @@
|
||||
6.16.2310.1011
|
||||
6.16.2310.1016
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>6.16.2310.1011</version>
|
||||
<version>6.16.2310.1016</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/MP-TAB-SERV.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB-SERV/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -153,17 +153,12 @@ namespace MP.Data.Services
|
||||
bool hasKey = await sessionStore.ContainKeyAsync(KeyCommDtRif);
|
||||
if (hasKey)
|
||||
{
|
||||
//try
|
||||
//{
|
||||
// recupero
|
||||
answ = await sessionStore.GetItemAsync<DateTime>(KeyCommDtRif);
|
||||
// svuoto data registrata se richiesto
|
||||
if (remAfter)
|
||||
{
|
||||
await sessionStore.RemoveItemAsync(KeyCommDtRif);
|
||||
}
|
||||
//}
|
||||
//catch { }
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
@@ -176,6 +171,18 @@ namespace MP.Data.Services
|
||||
await sessionStore.SetItemAsync(KeyCommDtRif, DtRif);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Verifico esistenza chiave in session store
|
||||
/// </summary>
|
||||
/// <param name="keyName"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> SessHasVal(string keyName)
|
||||
{
|
||||
bool hasKey = await sessionStore.ContainKeyAsync(keyName);
|
||||
return hasKey;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Commento fermata x recupero in editing
|
||||
/// </summary>
|
||||
@@ -342,8 +349,8 @@ namespace MP.Data.Services
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private const string KeyCommDtRif = "DtRifComm";
|
||||
private const string KeyCommText = "ValComm";
|
||||
public const string KeyCommDtRif = "DtRifComm";
|
||||
public const string KeyCommText = "ValComm";
|
||||
#if false
|
||||
public bool IsActive
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user