diff --git a/MP.INVE/Components/CmpTop.razor.cs b/MP.INVE/Components/CmpTop.razor.cs
index 3a58fbc0..70f510b7 100644
--- a/MP.INVE/Components/CmpTop.razor.cs
+++ b/MP.INVE/Components/CmpTop.razor.cs
@@ -63,6 +63,11 @@ namespace MP.INVE.Components
await getId();
}
+ protected override async Task OnAfterRenderAsync(bool firstRender)
+ {
+ await getId();
+ }
+
#endregion Protected Methods
#region Private Fields
diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj
index c37ab6ce..4e2a8c5e 100644
--- a/MP.INVE/MP.INVE.csproj
+++ b/MP.INVE/MP.INVE.csproj
@@ -5,7 +5,7 @@
enable
enable
MP.INVE
- 6.16.2211.1616
+ 6.16.2211.1617
diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html
index db464b6c..0742b597 100644
--- a/MP.INVE/Resources/ChangeLog.html
+++ b/MP.INVE/Resources/ChangeLog.html
@@ -1,6 +1,6 @@
Modulo MAPOINVE
- Versione: 6.16.2211.1616
+ Versione: 6.16.2211.1617
Note di rilascio:
-
diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt
index c7a3e740..0e34ded0 100644
--- a/MP.INVE/Resources/VersNum.txt
+++ b/MP.INVE/Resources/VersNum.txt
@@ -1 +1 @@
-6.16.2211.1616
+6.16.2211.1617
diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml
index 6db4351e..d95385a5 100644
--- a/MP.INVE/Resources/manifest.xml
+++ b/MP.INVE/Resources/manifest.xml
@@ -1,6 +1,6 @@
-
- 6.16.2211.1616
+ 6.16.2211.1617
https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/MP.INVE.zip
https://nexus.steamware.net/repository/SWS/MP-INVE/stable/LAST/ChangeLog.html
false
diff --git a/MP.INVE/Shared/MainLayout.razor b/MP.INVE/Shared/MainLayout.razor
index 8ac70466..75da5b44 100644
--- a/MP.INVE/Shared/MainLayout.razor
+++ b/MP.INVE/Shared/MainLayout.razor
@@ -1,4 +1,6 @@
-@inherits LayoutComponentBase
+@using Blazored.LocalStorage;
+@using MP.Data.DTO;
+@inherits LayoutComponentBase
MP.INVE
@@ -12,7 +14,10 @@
- @Body
+ @if (userName != "0" || NavManager.Uri.Contains("OperatoreLogin"))
+ {
+ @Body
+ }
@@ -20,14 +25,3 @@
-@code {
- protected bool navLarge { get; set; } = true;
-
- protected string sideClass { get; set; } = "sidebar";
-
- protected void UpdateNavDisplay()
- {
- navLarge = !navLarge;
- sideClass = navLarge ? "sidebar" : "sidebarSmall";
- }
-}
\ No newline at end of file
diff --git a/MP.INVE/Shared/MainLayout.razor.cs b/MP.INVE/Shared/MainLayout.razor.cs
new file mode 100644
index 00000000..089b4dfa
--- /dev/null
+++ b/MP.INVE/Shared/MainLayout.razor.cs
@@ -0,0 +1,70 @@
+using Blazored.LocalStorage;
+using Microsoft.AspNetCore.Components;
+using MP.Data.DTO;
+
+namespace MP.INVE.Shared
+{
+ public partial class MainLayout
+ {
+ #region Protected Fields
+
+ protected string userName = "0";
+
+ #endregion Protected Fields
+
+ #region Protected Properties
+
+ protected bool navLarge { get; set; } = true;
+
+ protected string sideClass { get; set; } = "sidebar";
+
+ #endregion Protected Properties
+
+ #region Protected Methods
+
+ protected async Task getId()
+ {
+ OperatoreDTO answ = new OperatoreDTO();
+ answ = await localStorage.GetItemAsync("MatrOpr");
+ if (answ != null)
+ {
+ userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})";
+ if (NavManager.Uri.Contains("OperatoreLogin"))
+ {
+ NavManager.NavigateTo("Starter", true);
+ }
+ }
+ else
+ {
+ userName = "0";
+ if (!NavManager.Uri.Contains("OperatoreLogin"))
+ {
+ NavManager.NavigateTo("OperatoreLogin", true);
+ }
+ }
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ await getId();
+ }
+
+ protected void UpdateNavDisplay()
+ {
+ navLarge = !navLarge;
+ sideClass = navLarge ? "sidebar" : "sidebarSmall";
+ }
+
+ #endregion Protected Methods
+
+ #region Private Properties
+
+ [Inject]
+ private ILocalStorageService localStorage { get; set; } = null!;
+
+ [Inject]
+ private NavigationManager NavManager { get; set; } = null!;
+
+ #endregion Private Properties
+ }
+}
\ No newline at end of file
diff --git a/MP.INVE/Shared/NavMenu.razor b/MP.INVE/Shared/NavMenu.razor
index 4a7f7eb4..cf60bfa1 100644
--- a/MP.INVE/Shared/NavMenu.razor
+++ b/MP.INVE/Shared/NavMenu.razor
@@ -20,7 +20,7 @@
- @* *@
-
+ HandleClick("Session")'>
@@ -41,7 +40,7 @@
-
+ HandleClick("Acquisizione")'>
@@ -51,7 +50,7 @@
-
+ HandleClick("Invio")'>
@@ -63,36 +62,4 @@
-@code {
- private bool collapseNavMenu = true;
- //public List? ElencoLink { get; set; }
- private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
-
- private void ToggleNavMenu()
- {
- collapseNavMenu = !collapseNavMenu;
- }
-
- protected override async Task OnInitializedAsync()
- {
- // recupero elenco JQM
- //ElencoLink = await MDService.ElencoLink();
- await Task.Delay(1);
- }
-
- protected bool showText { get; set; } = true;
- protected void ToggleCompress()
- {
- showText = !showText;
- EC_compressUpdated.InvokeAsync(showText);
- }
-
- protected string hideText
- {
- get => showText ? "" : "invisible";
- }
-
- [Parameter]
- public EventCallback EC_compressUpdated { get; set; }
-}
diff --git a/MP.INVE/Shared/NavMenu.razor.cs b/MP.INVE/Shared/NavMenu.razor.cs
new file mode 100644
index 00000000..fd219e3e
--- /dev/null
+++ b/MP.INVE/Shared/NavMenu.razor.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Components;
+using System.Net.Http;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Components.Authorization;
+using Microsoft.AspNetCore.Components.Forms;
+using Microsoft.AspNetCore.Components.Routing;
+using Microsoft.AspNetCore.Components.Web;
+using Microsoft.AspNetCore.Components.Web.Virtualization;
+using Microsoft.JSInterop;
+using MP.INVE;
+using MP.INVE.Shared;
+using MP.INVE.Components;
+using MP.INVE.Data;
+
+namespace MP.INVE.Shared
+{
+ public partial class NavMenu
+ {
+ private bool collapseNavMenu = true;
+ //public List? ElencoLink { get; set; }
+ private string? NavMenuCssClass => collapseNavMenu ? "collapse" : null;
+ private void ToggleNavMenu()
+ {
+ collapseNavMenu = !collapseNavMenu;
+ }
+
+ protected override async Task OnInitializedAsync()
+ {
+ // recupero elenco JQM
+ //ElencoLink = await MDService.ElencoLink();
+ await Task.Delay(1);
+ }
+
+ protected bool showText { get; set; } = true;
+ protected void ToggleCompress()
+ {
+ showText = !showText;
+ EC_compressUpdated.InvokeAsync(showText);
+ }
+
+ protected string hideText { get => showText ? "" : "invisible"; }
+
+ [Parameter]
+ public EventCallback EC_compressUpdated { get; set; }
+
+
+ [Inject]
+ protected NavigationManager NavigationManager { get; set; } = null!;
+
+ private void HandleClick(string target)
+ {
+ NavigationManager.NavigateTo(target, true);
+ }
+ }
+}
\ No newline at end of file