From dfbc2d655bf71c15e4c232634d89f0707d0a7d20 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Wed, 16 Nov 2022 18:09:44 +0100 Subject: [PATCH] BOZZA creazione qr per ogni sessione x umper --- MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Pages/Session.razor | 26 +++++++++ MP.INVE/Pages/Session.razor.cs | 44 ++++++++++++-- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- MP.INVE/Shared/MainLayout.razor | 5 +- MP.INVE/Shared/NavMenu.razor | 98 ++++++++++++++++++-------------- MP.INVE/Shared/NavMenu.razor.cs | 31 ++++++++-- MP.INVE/appsettings.json | 1 + 10 files changed, 154 insertions(+), 59 deletions(-) diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 4e2a8c5e..ac2ca808 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2211.1617 + 6.16.2211.1618 diff --git a/MP.INVE/Pages/Session.razor b/MP.INVE/Pages/Session.razor index ae5f8eda..13318d17 100644 --- a/MP.INVE/Pages/Session.razor +++ b/MP.INVE/Pages/Session.razor @@ -26,6 +26,10 @@ @item.InveSessID + + @item.Description @@ -53,4 +57,26 @@ + + + + + \ No newline at end of file diff --git a/MP.INVE/Pages/Session.razor.cs b/MP.INVE/Pages/Session.razor.cs index 92a8377d..a35569bb 100644 --- a/MP.INVE/Pages/Session.razor.cs +++ b/MP.INVE/Pages/Session.razor.cs @@ -31,25 +31,59 @@ namespace MP.INVE.Pages protected override async Task OnInitializedAsync() { //await FilterChanged.InvokeAsync(actFilter); - //await getId(); + await getId(); await Task.Delay(1); elencoSessioni = MIDataservice.InventSessCurrList(); } -#if false + protected override async Task OnAfterRenderAsync(bool firstRender) + { + if (firstRender) + { + await JSRuntime.InvokeVoidAsync("clearContent", $"qrCodeImg_{101}"); + await JSRuntime.InvokeVoidAsync("displayQr", $"qrCodeImg_{101}", rawCode); + } + } + protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrlJumper"]}"; } + private int idOperatore { get; set; } = 0; + private int currIdSess { get; set; } = 0; + private string authKey { get; set; } = ""; + + protected string rawCode + { + get + { + string answ = ""; + answ = $"{BaseUrlTab}IdSessione={currIdSess}&MatrOpr={idOperatore}&UserAuthKey={authKey}"; + return answ; + } + } + + + protected void getCurrSess(int idSess) + { + currIdSess = idSess; + } + + [Inject] + private IConfiguration Configuration { get; set; } = null!; [Inject] protected ILocalStorageService localStorage { get; set; } = null!; [Inject] protected NavigationManager NavManager { get; set; } = null!; + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + + protected async Task getId() { OperatoreDTO local = new OperatoreDTO(); local = await localStorage.GetItemAsync("MatrOpr"); - if ((local == null)) + if(local != null) { - NavManager.NavigateTo("OperatoreLogin"); + idOperatore = local.MatrOpr; + authKey = local.hashAuthKey; } } -#endif } } \ No newline at end of file diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index 0742b597..c57285e7 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2211.1617

+

Versione: 6.16.2211.1618


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 0e34ded0..6469485d 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.1617 +6.16.2211.1618 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index d95385a5..dacc17ff 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.1617 + 6.16.2211.1618 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 14aea320..75da5b44 100644 --- a/MP.INVE/Shared/MainLayout.razor +++ b/MP.INVE/Shared/MainLayout.razor @@ -6,10 +6,7 @@
    - @if (userName != "0") - { - - } +
    diff --git a/MP.INVE/Shared/NavMenu.razor b/MP.INVE/Shared/NavMenu.razor index cf60bfa1..ab84a4ef 100644 --- a/MP.INVE/Shared/NavMenu.razor +++ b/MP.INVE/Shared/NavMenu.razor @@ -18,48 +18,62 @@
    - + @if (userName != "0") + { + + + }
    diff --git a/MP.INVE/Shared/NavMenu.razor.cs b/MP.INVE/Shared/NavMenu.razor.cs index fd219e3e..31d9c0ae 100644 --- a/MP.INVE/Shared/NavMenu.razor.cs +++ b/MP.INVE/Shared/NavMenu.razor.cs @@ -15,6 +15,8 @@ using MP.INVE; using MP.INVE.Shared; using MP.INVE.Components; using MP.INVE.Data; +using MP.Data.DTO; +using Blazored.LocalStorage; namespace MP.INVE.Shared { @@ -27,12 +29,33 @@ namespace MP.INVE.Shared { collapseNavMenu = !collapseNavMenu; } - + protected string userName { get; set; } = "0"; + protected async Task getId() + { + OperatoreDTO answ = new OperatoreDTO(); + answ = await localStorage.GetItemAsync("MatrOpr"); + if (answ != null) + { + userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})"; + if (NavigationManager.Uri.Contains("OperatoreLogin")) + { + NavigationManager.NavigateTo("Starter", true); + } + } + else + { + userName = "0"; + if (!NavigationManager.Uri.Contains("OperatoreLogin")) + { + NavigationManager.NavigateTo("OperatoreLogin", true); + } + } + } protected override async Task OnInitializedAsync() { // recupero elenco JQM //ElencoLink = await MDService.ElencoLink(); - await Task.Delay(1); + await getId(); } protected bool showText { get; set; } = true; @@ -46,8 +69,8 @@ namespace MP.INVE.Shared [Parameter] public EventCallback EC_compressUpdated { get; set; } - - + [Inject] + protected ILocalStorageService localStorage { get; set; } = null!; [Inject] protected NavigationManager NavigationManager { get; set; } = null!; diff --git a/MP.INVE/appsettings.json b/MP.INVE/appsettings.json index 7527e83b..a25eaf4a 100644 --- a/MP.INVE/appsettings.json +++ b/MP.INVE/appsettings.json @@ -19,5 +19,6 @@ "redisLongTimeCache": "15", "MpIoBaseUrl": "http://localhost:20967/", "BaseUrl": "https://iis02.egalware.com/MP/MAG/SMART/PLScanner?" + "BaseUrlJumper": "https://iis02.egalware.com/MP/jumper?" } }