From 8c1f2be1f151e67a8a0e121b17d5bc10433d828a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 31 Mar 2025 20:23:57 +0200 Subject: [PATCH] =?UTF-8?q?TAB3:=20-=20inizio=20gestione=20modifiche=20x?= =?UTF-8?q?=20caso=20manuale=20(con=20disabilitazione=20men=C3=B9=20e=20ca?= =?UTF-8?q?ricamento=20dato=20isManual)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MP-TAB3/Components/MachineBlock.razor | 14 +++++++- MP-TAB3/Components/MachineBlock.razor.cs | 22 +++++++++++- MP-TAB3/Components/SlideMenu.razor | 9 ++++- MP-TAB3/Components/SlideMenu.razor.cs | 18 ++++++++++ MP-TAB3/MP-TAB3.csproj | 2 +- MP-TAB3/Resources/ChangeLog.html | 2 +- MP-TAB3/Resources/VersNum.txt | 2 +- MP-TAB3/Resources/manifest.xml | 2 +- MP-TAB3/Shared/MainLayout.razor.cs | 2 +- MP-TAB3/Shared/NavMenu.razor | 45 +++++++++++++++++++----- MP.Data/DbModels/VMSFDModel.cs | 17 ++++----- MP.Data/Services/SharedMemService.cs | 8 ++++- 12 files changed, 118 insertions(+), 25 deletions(-) diff --git a/MP-TAB3/Components/MachineBlock.razor b/MP-TAB3/Components/MachineBlock.razor index 90e8c256..6b16571f 100644 --- a/MP-TAB3/Components/MachineBlock.razor +++ b/MP-TAB3/Components/MachineBlock.razor @@ -21,7 +21,11 @@ else
- @CRecMSE.Nome + @CRecMSE.Nome + @if(isManual) + { + + }
@@ -86,6 +90,10 @@ else
@CRecMSE.Nome + @if (isManual) + { + + }
@@ -151,6 +159,10 @@ else

@CRecMSE.Nome + @if (isManual) + { + + }

diff --git a/MP-TAB3/Components/MachineBlock.razor.cs b/MP-TAB3/Components/MachineBlock.razor.cs index feb4696e..24463263 100644 --- a/MP-TAB3/Components/MachineBlock.razor.cs +++ b/MP-TAB3/Components/MachineBlock.razor.cs @@ -34,6 +34,7 @@ namespace MP_TAB3.Components private bool inAttr = false; private bool isLoading = false; private bool isMulti = false; + private bool isManual = false; private bool LastFullMode = true; private string LastIdxMacchSub = ""; private int LastKeepAliveMin = 5; @@ -441,7 +442,24 @@ namespace MP_TAB3.Components { datiProdAct = SDService.MachProdStGet(IdxMaccCur); } - isMulti = SMServ.DictMacchMulti[IdxMaccMain] == 1; + // fix multi + if (SMServ.DictMacchMulti.ContainsKey(IdxMaccMain)) + { + isMulti = SMServ.DictMacchMulti[IdxMaccMain] == 1; + } + else + { + isMulti = false; + } + // fix manual + if (SMServ.DictMacchManual.ContainsKey(IdxMaccMain)) + { + isManual = SMServ.DictMacchManual[IdxMaccMain]; + } + else + { + isManual = false; + } // verificare if (!FullMode || !detailLoaded || doForce) { @@ -504,6 +522,8 @@ namespace MP_TAB3.Components { // salvo idxMacch await MServ.IdxMaccSet(RecMSE!.IdxMacchina); + // salvo se sia manuale... + await MServ.LastOpenedPageSet("machine-detail"); // navigo! NavMan.NavigateTo($"machine-detail"); diff --git a/MP-TAB3/Components/SlideMenu.razor b/MP-TAB3/Components/SlideMenu.razor index 7a4f65b1..05ba1295 100644 --- a/MP-TAB3/Components/SlideMenu.razor +++ b/MP-TAB3/Components/SlideMenu.razor @@ -28,7 +28,14 @@
@foreach (var item in MenuItems) { - + if (IsManual && item.ordine > 20) + { + + } + else + { + + } }
diff --git a/MP-TAB3/Components/SlideMenu.razor.cs b/MP-TAB3/Components/SlideMenu.razor.cs index 165b6728..855c00d9 100644 --- a/MP-TAB3/Components/SlideMenu.razor.cs +++ b/MP-TAB3/Components/SlideMenu.razor.cs @@ -18,6 +18,9 @@ namespace MP_TAB3.Components [Inject] protected MessageService MsgServ { get; set; } = null!; + [Inject] + protected SharedMemService MStor { get; set; } = null!; + [Inject] protected NavigationManager navManager { get; set; } = null!; @@ -30,6 +33,19 @@ namespace MP_TAB3.Components return navManager.Uri.Contains(currUri) ? "bg-dark text-light" : ""; } + protected override async Task OnAfterRenderAsync(bool firstRender) + { + idxMaccSel = await MsgServ.IdxMaccGet(); + if (!string.IsNullOrEmpty(idxMaccSel) && MStor.DictMacchManual.ContainsKey(idxMaccSel)) + { + IsManual = MStor.DictMacchManual[idxMaccSel]; + } + else + { + IsManual = false; + } + } + protected override void OnInitialized() { var rawVers = typeof(Program).Assembly.GetName().Version; @@ -51,6 +67,8 @@ namespace MP_TAB3.Components #region Private Fields + private string idxMaccSel = ""; + private bool IsManual = false; private Version version = null!; #endregion Private Fields diff --git a/MP-TAB3/MP-TAB3.csproj b/MP-TAB3/MP-TAB3.csproj index 420429a6..bbe3c472 100644 --- a/MP-TAB3/MP-TAB3.csproj +++ b/MP-TAB3/MP-TAB3.csproj @@ -3,7 +3,7 @@ net6.0 enable - 6.16.2503.3107 + 6.16.2503.3120 enable MP_TAB3 diff --git a/MP-TAB3/Resources/ChangeLog.html b/MP-TAB3/Resources/ChangeLog.html index 0a154808..763bd923 100644 --- a/MP-TAB3/Resources/ChangeLog.html +++ b/MP-TAB3/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2503.3107

+

Versione: 6.16.2503.3120


Note di rilascio: