Fix divieti PODL/ODL

This commit is contained in:
Samuele Locatelli
2024-04-24 13:00:40 +02:00
parent 3c33de1ec4
commit 52e753ba1c
11 changed files with 126 additions and 23 deletions
+16 -2
View File
@@ -15,10 +15,24 @@ else
@if (currRecord != null && !showStats && isCurrOdl)
{
<div class="col-6 col-lg-8">
<button @onclick="() => forceSyncDb()" class="btn btn-success btn-sm">Forza sync &rarr; macchina <i class="bi bi-fast-forward-circle"></i></button>
@if(enableForceSync)
{
<button @onclick="() => forceSyncDb()" class="btn btn-success btn-sm">Forza sync &rarr; macchina <i class="bi bi-fast-forward-circle"></i></button>
}
else
{
<button disabled class="btn btn-secondary btn-sm">Forza sync non abilitato <i class="bi bi-fast-forward-circle"></i></button>
}
</div>
<div class="col-6 col-lg-4 text-end">
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
@if(enableStopODL)
{
<button @onclick="() => chiudiOdl()" class="btn btn-danger btn-sm">Registra chiusura ODL <i class="far fa-stop-circle"></i></button>
}
else
{
<button disabled class="btn btn-secondary btn-sm">Chiusura ODL non abilitata <i class="far fa-stop-circl"></i></button>
}
</div>
}
<div class="col-12">
+25
View File
@@ -61,6 +61,16 @@ namespace MP.SPEC.Components
#endregion Public Methods
#region Protected Fields
protected bool enableForceSync = true;
protected bool enableStartPODL = true;
protected bool enableStopODL = true;
#endregion Protected Fields
#region Protected Properties
[Inject]
@@ -139,6 +149,21 @@ namespace MP.SPEC.Components
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
string SPEC_PODL_gest = await MDService.ConfigTryGet("SPEC_PODL_gest");
if (!string.IsNullOrEmpty(SPEC_PODL_gest))
{
bool.TryParse(SPEC_PODL_gest, out enableStartPODL);
}
string SPEC_ODL_gest = await MDService.ConfigTryGet("SPEC_ODL_gest");
if (!string.IsNullOrEmpty(SPEC_ODL_gest))
{
bool.TryParse(SPEC_ODL_gest, out enableStopODL);
}
string SPEC_XODL_sync = await MDService.ConfigTryGet("SPEC_XODL_sync");
if (!string.IsNullOrEmpty(SPEC_XODL_sync))
{
bool.TryParse(SPEC_XODL_sync, out enableForceSync);
}
}
protected override async Task OnParametersSetAsync()
+14 -5
View File
@@ -46,15 +46,24 @@ else
@if (record.IdxOdl == 0)
{
<button @onclick="() => editRecord(record)" class="btn btn-primary btn-sm mx-1" title="Modifica Record"><i class="bi bi-pencil-square"></i></button>
@if (canStartOdl(record.IdxMacchina))
@if (enableStartPODL)
{
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm mx-1" title="Avvia PODL">
<i class="far fa-play-circle"></i>
</button>
@if (canStartOdl(record.IdxMacchina))
{
<button @onclick="() => startOdl(record)" class="btn btn-success btn-sm mx-1" title="Avvia PODL">
<i class="far fa-play-circle"></i>
</button>
}
else
{
<button class="btn btn-secondary btn-sm disabled mx-1" title="ODL ancora in corso">
<i class="far fa-play-circle"></i>
</button>
}
}
else
{
<button class="btn btn-secondary btn-sm disabled mx-1" title="ODL ancora in corso">
<button class="btn btn-secondary btn-sm disabled mx-1" title="Avvio PODL non permesso">
<i class="far fa-play-circle"></i>
</button>
}
+37 -10
View File
@@ -60,6 +60,16 @@ namespace MP.SPEC.Components
#endregion Public Methods
#region Protected Fields
protected bool enableForceSync = true;
protected bool enableStartPODL = true;
protected bool enableStopODL = true;
#endregion Protected Fields
#region Protected Properties
protected string header
@@ -127,11 +137,36 @@ namespace MP.SPEC.Components
showRecipeConf = true;
}
protected async Task editRecord(PODLExpModel? selRec)
{
currRecord = selRec;
header = "Modifica PODL";
await RecordEdit.InvokeAsync(selRec);
}
protected override async Task OnInitializedAsync()
{
ListStati = await MDService.AnagStatiComm();
var strMachRecipe = await MDService.ConfigTryGet("MachineWithRecipe");
bool.TryParse(strMachRecipe, out MachineWithRecipe);
string strMachRecipe = await MDService.ConfigTryGet("MachineWithRecipe");
if (!string.IsNullOrEmpty(strMachRecipe))
{
bool.TryParse(strMachRecipe, out MachineWithRecipe);
}
string SPEC_PODL_gest = await MDService.ConfigTryGet("SPEC_PODL_gest");
if (!string.IsNullOrEmpty(SPEC_PODL_gest))
{
bool.TryParse(SPEC_PODL_gest, out enableStartPODL);
}
string SPEC_ODL_gest = await MDService.ConfigTryGet("SPEC_ODL_gest");
if (!string.IsNullOrEmpty(SPEC_ODL_gest))
{
bool.TryParse(SPEC_ODL_gest, out enableStopODL);
}
string SPEC_XODL_sync = await MDService.ConfigTryGet("SPEC_XODL_sync");
if (!string.IsNullOrEmpty(SPEC_XODL_sync))
{
bool.TryParse(SPEC_XODL_sync, out enableForceSync);
}
}
protected override async Task OnParametersSetAsync()
@@ -184,14 +219,6 @@ namespace MP.SPEC.Components
await RecordEdit.InvokeAsync(null);
}
protected async Task editRecord(PODLExpModel? selRec)
{
currRecord = selRec;
header = "Modifica PODL";
await RecordEdit.InvokeAsync(selRec);
}
protected async Task selRecord(PODLExpModel? selRec)
{
currRecord = selRec;
+1 -1
View File
@@ -443,7 +443,7 @@ namespace MP.SPEC.Data
return answ;
}
/// <summary>
/// Update chiave config
/// </summary>
+1 -1
View File
@@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP.SPEC</RootNamespace>
<Version>6.16.2404.2411</Version>
<Version>6.16.2404.2412</Version>
<UserSecretsId>1800a78a-6ff1-40f9-b490-87fb8bfc1394</UserSecretsId>
</PropertyGroup>
+10 -1
View File
@@ -261,7 +261,16 @@
</div>
<div class="col-3">
<div class="d-grid gap-2">
<button @onclick="() => forceSyncDb()" class="btn btn-success">Forza sync &rarr; macchina <i class="bi bi-fast-forward-circle"></i></button>
@if (enableForceSync)
{
<button @onclick="() => forceSyncDb()" class="btn btn-success">Forza sync &rarr; macchina <i class="bi bi-fast-forward-circle"></i></button>
}
else
{
<button class="btn btn-secondary btn-sm disabled mx-1" title="Forza Sync non permesso">
<i class="bi bi-fast-forward-circle"></i>
</button>
}
</div>
</div>
}
+19
View File
@@ -115,8 +115,27 @@ namespace MP.SPEC.Pages
currAzienda = await MDService.ConfigTryGet("AZIENDA");
padCodXdl = await MDService.ConfigTryGet("padCodXdl");
useFasi4KeyRich = await MDService.ConfigTryGet("SPEC_KeyRichiesta");
// carico opzioni gestione PODL/ODL/sync
string SPEC_PODL_gest = await MDService.ConfigTryGet("SPEC_PODL_gest");
if (!string.IsNullOrEmpty(SPEC_PODL_gest))
{
bool.TryParse(SPEC_PODL_gest, out enableStartPODL);
}
string SPEC_ODL_gest = await MDService.ConfigTryGet("SPEC_ODL_gest");
if (!string.IsNullOrEmpty(SPEC_ODL_gest))
{
bool.TryParse(SPEC_ODL_gest, out enableStopODL);
}
string SPEC_XODL_sync = await MDService.ConfigTryGet("SPEC_XODL_sync");
if (!string.IsNullOrEmpty(SPEC_XODL_sync))
{
bool.TryParse(SPEC_XODL_sync, out enableForceSync);
}
}
protected bool enableStartPODL = true;
protected bool enableStopODL = true;
protected bool enableForceSync = true;
protected string useFasi4KeyRich { get; set; } = "";
protected override async Task OnParametersSetAsync()
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2404.2411</h4>
<h4>Versione: 6.16.2404.2412</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2404.2411
6.16.2404.2412
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2404.2411</version>
<version>6.16.2404.2412</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>