From 8118574c9bbc5d5b153aa4bc139a11ad17eef3e2 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 21 Nov 2022 15:49:30 +0100 Subject: [PATCH 1/4] bozza jumper --- MP.INVE/Components/InveSessionList.razor.cs | 2 +- MP.INVE/Pages/Acquisizione.razor.cs | 12 +++---- MP.INVE/Pages/Jumper.razor | 2 +- MP.INVE/Pages/Jumper.razor.cs | 38 +++++++++++++++++++++ MP.INVE/appsettings.json | 4 +-- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/MP.INVE/Components/InveSessionList.razor.cs b/MP.INVE/Components/InveSessionList.razor.cs index 8bdc71a4..511d8056 100644 --- a/MP.INVE/Components/InveSessionList.razor.cs +++ b/MP.INVE/Components/InveSessionList.razor.cs @@ -89,7 +89,7 @@ namespace MP.INVE.Components private DateTime dtStart { get; set; } = DateTime.Now.AddMonths(-1); private DateTime dtEnd { get; set; } = DateTime.Now; - protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrl"]}"; } + protected string BaseUrlTab { get => $"{Configuration["ServerConf:BaseUrlJumper"]}"; } protected string rawCode diff --git a/MP.INVE/Pages/Acquisizione.razor.cs b/MP.INVE/Pages/Acquisizione.razor.cs index 6e8c3620..c0853bfe 100644 --- a/MP.INVE/Pages/Acquisizione.razor.cs +++ b/MP.INVE/Pages/Acquisizione.razor.cs @@ -17,6 +17,7 @@ using MP.INVE.Components; using Blazored.LocalStorage; using MP.Data.DTO; using Microsoft.AspNetCore.WebUtilities; +using MP.INVE.Data; namespace MP.INVE.Pages { @@ -26,18 +27,15 @@ namespace MP.INVE.Pages protected ILocalStorageService localStorage { get; set; } = null!; [Inject] protected NavigationManager NavManager { get; set; } = null!; + [Inject] + protected MiDataService MIService { get; set; } = null!; + + private bool logged { get;set; } = false; protected string idOPeratore { get; set; } = null!; protected string authKey { get; set; } = null!; protected override async Task OnInitializedAsync() { - await Task.Delay(1); - var uri = NavManager.ToAbsoluteUri(NavManager.Uri); - if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("MatrOpr", out var _matrOpr) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("UserAuthKey", out var _authKey)) - { - idOPeratore = _matrOpr; - authKey = _authKey; - } } protected DateTime? lastScan { get; set; } = null; } diff --git a/MP.INVE/Pages/Jumper.razor b/MP.INVE/Pages/Jumper.razor index 433b7484..0cc71e05 100644 --- a/MP.INVE/Pages/Jumper.razor +++ b/MP.INVE/Pages/Jumper.razor @@ -1,5 +1,5 @@ @page "/Jumper" -

Jumper

+

@logged

diff --git a/MP.INVE/Pages/Jumper.razor.cs b/MP.INVE/Pages/Jumper.razor.cs index 91ed4305..778da839 100644 --- a/MP.INVE/Pages/Jumper.razor.cs +++ b/MP.INVE/Pages/Jumper.razor.cs @@ -14,10 +14,48 @@ using Microsoft.JSInterop; using MP.INVE; using MP.INVE.Shared; using MP.INVE.Components; +using Blazored.LocalStorage; +using Microsoft.AspNetCore.WebUtilities; +using MP.INVE.Data; +using MP.Data.DatabaseModels; namespace MP.INVE.Pages { public partial class Jumper { + [Inject] + protected ILocalStorageService localStorage { get; set; } = null!; + [Inject] + protected NavigationManager NavManager { get; set; } = null!; + [Inject] + protected MiDataService MIService { get; set; } = null!; + + private string logged { get; set; } = ""; + + private List operatore = new List(); + protected string idOPeratore { get; set; } = null!; + protected string authKey { get; set; } = null!; + protected override async Task OnInitializedAsync() + { + await Task.Delay(1); + var uri = NavManager.ToAbsoluteUri(NavManager.Uri); + if (QueryHelpers.ParseQuery(uri.Query).TryGetValue("MatrOpr", out var _matrOpr) && QueryHelpers.ParseQuery(uri.Query).TryGetValue("UserAuthKey", out var _authKey)) + { + idOPeratore = _matrOpr; + authKey = _authKey; + } + + operatore = MIService.ElencoOperatori(int.Parse(idOPeratore), MIService.DeriptData(authKey)); + + if(operatore.Count == 1) + { + logged = "success"; + NavManager.NavigateTo("Acquisizione"); + } + else + { + logged = "not success"; + } + } } } \ No newline at end of file diff --git a/MP.INVE/appsettings.json b/MP.INVE/appsettings.json index 885f1db8..9cbfcb78 100644 --- a/MP.INVE/appsettings.json +++ b/MP.INVE/appsettings.json @@ -18,7 +18,7 @@ "cacheCheckArtUsato": "2", "redisLongTimeCache": "15", "MpIoBaseUrl": "http://localhost:20967/", - "BaseUrl": "https://localhost:7212/Acquisizione?", - "BaseUrlJumper": "https://iis02.egalware.com/MP/jumper?" + "BaseUrl": "https://iis01.egalware.com/mp/inve/Acquisizione?", + "BaseUrlJumper": "https://iis01.egalware.com/MP/jumper?" } } From e9cc7752fa9f5e52165e05e1e1017bd46ed9a477 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 21 Nov 2022 15:51:00 +0100 Subject: [PATCH 2/4] fix link sessione --- MP.INVE/Pages/OperatoreLogin.razor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MP.INVE/Pages/OperatoreLogin.razor.cs b/MP.INVE/Pages/OperatoreLogin.razor.cs index e0570b65..15755f2f 100644 --- a/MP.INVE/Pages/OperatoreLogin.razor.cs +++ b/MP.INVE/Pages/OperatoreLogin.razor.cs @@ -66,7 +66,7 @@ namespace MP.INVE.Pages if (elencoOperatori.Count == 1) { - NavManager.NavigateTo("/Starter", true); + NavManager.NavigateTo("/MP/InveSession", true); localStorage.SetItemAsync("MatrOpr", sessionOpr); } else From e9747563766fd3ac75e53c3673ea6c64550ace58 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 21 Nov 2022 16:04:10 +0100 Subject: [PATCH 3/4] fix vari link reindirizzamento --- MP.Data/Utils.cs | 14 -------------- MP.INVE/Components/CmpTop.razor.cs | 6 +++--- MP.INVE/Components/InveSessionList.razor.cs | 4 ++-- MP.INVE/Components/MagList.razor.cs | 2 +- MP.INVE/MP.INVE.csproj | 2 +- MP.INVE/Pages/Index.razor.cs | 15 --------------- MP.INVE/Pages/OperatoreLogin.razor.cs | 2 +- MP.INVE/Pages/Starter.razor.cs | 6 ++++-- MP.INVE/Resources/ChangeLog.html | 2 +- MP.INVE/Resources/VersNum.txt | 2 +- MP.INVE/Resources/manifest.xml | 2 +- MP.INVE/Shared/MainLayout.razor.cs | 4 ++-- 12 files changed, 17 insertions(+), 44 deletions(-) diff --git a/MP.Data/Utils.cs b/MP.Data/Utils.cs index 87026808..f7f548cd 100644 --- a/MP.Data/Utils.cs +++ b/MP.Data/Utils.cs @@ -109,20 +109,6 @@ namespace MP.Data return answ; } - [Inject] - protected ILocalStorageService localStorage { get; set; } = null!; - [Inject] - protected NavigationManager NavManager { get; set; } = null!; - protected async Task getId() - { - OperatoreDTO local = new OperatoreDTO(); - local = await localStorage.GetItemAsync("MatrOpr"); - if ((local == null)) - { - NavManager.NavigateTo("OperatoreLogin"); - } - } - #endregion Public Methods } } \ No newline at end of file diff --git a/MP.INVE/Components/CmpTop.razor.cs b/MP.INVE/Components/CmpTop.razor.cs index 65f635b7..a482edc9 100644 --- a/MP.INVE/Components/CmpTop.razor.cs +++ b/MP.INVE/Components/CmpTop.razor.cs @@ -24,7 +24,7 @@ namespace MP.INVE.Components { await localStorage.ClearAsync(); // rimando a pagina login - NavManager.NavigateTo("OperatoreLogin", true); + NavManager.NavigateTo("/MP/Inve/OperatoreLogin", true); } #endregion Public Methods @@ -49,7 +49,7 @@ namespace MP.INVE.Components userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})"; if (NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("Starter", true); + NavManager.NavigateTo("/MP/Inve/Starter", true); } } else @@ -57,7 +57,7 @@ namespace MP.INVE.Components userName = "0"; if (!NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("OperatoreLogin", true); + NavManager.NavigateTo("/MP/Inve/OperatoreLogin", true); } } } diff --git a/MP.INVE/Components/InveSessionList.razor.cs b/MP.INVE/Components/InveSessionList.razor.cs index 511d8056..47794e1d 100644 --- a/MP.INVE/Components/InveSessionList.razor.cs +++ b/MP.INVE/Components/InveSessionList.razor.cs @@ -135,7 +135,7 @@ namespace MP.INVE.Components }; await MIDataservice.InsertNewSessione(newSess); - NavManager.NavigateTo("Session", true); + NavManager.NavigateTo(NavManager.Uri, true); await reloadData(); } else @@ -155,7 +155,7 @@ namespace MP.INVE.Components if (alert) { await MIDataservice.deleteSessione(session); - NavManager.NavigateTo("Session", true); + NavManager.NavigateTo(NavManager.Uri, true); await reloadData(); } } diff --git a/MP.INVE/Components/MagList.razor.cs b/MP.INVE/Components/MagList.razor.cs index 4b2b22f0..c16f7b45 100644 --- a/MP.INVE/Components/MagList.razor.cs +++ b/MP.INVE/Components/MagList.razor.cs @@ -75,7 +75,7 @@ namespace MP.INVE.Components Nascosto = false }; await MIDataservice.InsertNewMag(newMag); - NavManager.NavigateTo("Elencomagazzini", true); + NavManager.NavigateTo(NavManager.Uri, true); //await MIDataservice.FlushRedisCache(); await reloadData(); } diff --git a/MP.INVE/MP.INVE.csproj b/MP.INVE/MP.INVE.csproj index 319adc25..2ef6a6c0 100644 --- a/MP.INVE/MP.INVE.csproj +++ b/MP.INVE/MP.INVE.csproj @@ -5,7 +5,7 @@ enable enable MP.INVE - 6.16.2211.2115 + 6.16.2211.2116 diff --git a/MP.INVE/Pages/Index.razor.cs b/MP.INVE/Pages/Index.razor.cs index 24845251..5f7b5a65 100644 --- a/MP.INVE/Pages/Index.razor.cs +++ b/MP.INVE/Pages/Index.razor.cs @@ -34,21 +34,6 @@ namespace MP.INVE.Pages //await getId(); await Task.Delay(1); } -#if false - [Inject] - protected ILocalStorageService localStorage { get; set; } = null!; - [Inject] - protected NavigationManager NavManager { get; set; } = null!; - protected async Task getId() - { - OperatoreDTO local = new OperatoreDTO(); - local = await localStorage.GetItemAsync("MatrOpr"); - if ((local == null)) - { - NavManager.NavigateTo("OperatoreLogin"); - } - } -#endif #endregion Protected Methods #region Private Fields diff --git a/MP.INVE/Pages/OperatoreLogin.razor.cs b/MP.INVE/Pages/OperatoreLogin.razor.cs index 15755f2f..9a88ca47 100644 --- a/MP.INVE/Pages/OperatoreLogin.razor.cs +++ b/MP.INVE/Pages/OperatoreLogin.razor.cs @@ -66,7 +66,7 @@ namespace MP.INVE.Pages if (elencoOperatori.Count == 1) { - NavManager.NavigateTo("/MP/InveSession", true); + NavManager.NavigateTo("/MP/Inve/InveSession", true); localStorage.SetItemAsync("MatrOpr", sessionOpr); } else diff --git a/MP.INVE/Pages/Starter.razor.cs b/MP.INVE/Pages/Starter.razor.cs index 76cd6bf4..0a85d409 100644 --- a/MP.INVE/Pages/Starter.razor.cs +++ b/MP.INVE/Pages/Starter.razor.cs @@ -126,7 +126,7 @@ namespace MP.INVE.Pages Nascosto = false }; await MIDataservice.InsertNewMag(newMag); - NavManager.NavigateTo("Elencomagazzini", true); + NavManager.NavigateTo(NavManager.Uri, true); //await MIDataservice.FlushRedisCache(); await reloadData(); } @@ -135,6 +135,7 @@ namespace MP.INVE.Pages closeNew(); } } +#if false private async Task deleteMag(AnagMagModel mag) { @@ -145,7 +146,8 @@ namespace MP.INVE.Pages NavManager.NavigateTo("Elencomagazzini", true); await reloadData(); } - } + } +#endif protected void ForceReload(int newNum) { numRecord = newNum; diff --git a/MP.INVE/Resources/ChangeLog.html b/MP.INVE/Resources/ChangeLog.html index 3af84f29..ac15bafc 100644 --- a/MP.INVE/Resources/ChangeLog.html +++ b/MP.INVE/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOINVE -

Versione: 6.16.2211.2115

+

Versione: 6.16.2211.2116


Note di rilascio:
  • diff --git a/MP.INVE/Resources/VersNum.txt b/MP.INVE/Resources/VersNum.txt index 6387ee39..46dcee24 100644 --- a/MP.INVE/Resources/VersNum.txt +++ b/MP.INVE/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2211.2115 +6.16.2211.2116 diff --git a/MP.INVE/Resources/manifest.xml b/MP.INVE/Resources/manifest.xml index ce0cb59a..f606b314 100644 --- a/MP.INVE/Resources/manifest.xml +++ b/MP.INVE/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2211.2115 + 6.16.2211.2116 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.cs b/MP.INVE/Shared/MainLayout.razor.cs index f72febb2..6dc282a2 100644 --- a/MP.INVE/Shared/MainLayout.razor.cs +++ b/MP.INVE/Shared/MainLayout.razor.cs @@ -32,7 +32,7 @@ namespace MP.INVE.Shared userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})"; if (NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("Starter", true); + NavManager.NavigateTo("MP/Inve/Starter", true); } } else @@ -40,7 +40,7 @@ namespace MP.INVE.Shared userName = "0"; if (!NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("OperatoreLogin", true); + NavManager.NavigateTo("MP/Inve/OperatoreLogin", true); } } } From b8d5ab2d6c42e514869f384b7c8a0fe166990200 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Mon, 21 Nov 2022 17:00:14 +0100 Subject: [PATCH 4/4] ulteriore fix reindirizzamenti --- MP.INVE/Components/CmpTop.razor.cs | 6 +++--- MP.INVE/Pages/OperatoreLogin.razor.cs | 2 +- MP.INVE/Shared/MainLayout.razor.cs | 4 ++-- MP.INVE/appsettings.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MP.INVE/Components/CmpTop.razor.cs b/MP.INVE/Components/CmpTop.razor.cs index a482edc9..65f635b7 100644 --- a/MP.INVE/Components/CmpTop.razor.cs +++ b/MP.INVE/Components/CmpTop.razor.cs @@ -24,7 +24,7 @@ namespace MP.INVE.Components { await localStorage.ClearAsync(); // rimando a pagina login - NavManager.NavigateTo("/MP/Inve/OperatoreLogin", true); + NavManager.NavigateTo("OperatoreLogin", true); } #endregion Public Methods @@ -49,7 +49,7 @@ namespace MP.INVE.Components userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})"; if (NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("/MP/Inve/Starter", true); + NavManager.NavigateTo("Starter", true); } } else @@ -57,7 +57,7 @@ namespace MP.INVE.Components userName = "0"; if (!NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("/MP/Inve/OperatoreLogin", true); + NavManager.NavigateTo("OperatoreLogin", true); } } } diff --git a/MP.INVE/Pages/OperatoreLogin.razor.cs b/MP.INVE/Pages/OperatoreLogin.razor.cs index 9a88ca47..adda95e2 100644 --- a/MP.INVE/Pages/OperatoreLogin.razor.cs +++ b/MP.INVE/Pages/OperatoreLogin.razor.cs @@ -66,7 +66,7 @@ namespace MP.INVE.Pages if (elencoOperatori.Count == 1) { - NavManager.NavigateTo("/MP/Inve/InveSession", true); + NavManager.NavigateTo("InveSession", true); localStorage.SetItemAsync("MatrOpr", sessionOpr); } else diff --git a/MP.INVE/Shared/MainLayout.razor.cs b/MP.INVE/Shared/MainLayout.razor.cs index 6dc282a2..f72febb2 100644 --- a/MP.INVE/Shared/MainLayout.razor.cs +++ b/MP.INVE/Shared/MainLayout.razor.cs @@ -32,7 +32,7 @@ namespace MP.INVE.Shared userName = $"{answ.Cognome} {answ.Nome} ({answ.MatrOpr})"; if (NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("MP/Inve/Starter", true); + NavManager.NavigateTo("Starter", true); } } else @@ -40,7 +40,7 @@ namespace MP.INVE.Shared userName = "0"; if (!NavManager.Uri.Contains("OperatoreLogin")) { - NavManager.NavigateTo("MP/Inve/OperatoreLogin", true); + NavManager.NavigateTo("OperatoreLogin", true); } } } diff --git a/MP.INVE/appsettings.json b/MP.INVE/appsettings.json index 9cbfcb78..aa69a5b9 100644 --- a/MP.INVE/appsettings.json +++ b/MP.INVE/appsettings.json @@ -19,6 +19,6 @@ "redisLongTimeCache": "15", "MpIoBaseUrl": "http://localhost:20967/", "BaseUrl": "https://iis01.egalware.com/mp/inve/Acquisizione?", - "BaseUrlJumper": "https://iis01.egalware.com/MP/jumper?" + "BaseUrlJumper": "https://iis01.egalware.com/jumper?" } }