From 8fbfea1f62ba9d32e4bc77a92bdbb447ee7013a9 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 4 Nov 2022 16:09:26 +0100 Subject: [PATCH] COmplreto refresh gestione licenze LAND - sistemato GC in generale - controllo e sistemazione calcolo data scadenza --- MP.Land/Data/LicenseService.cs | 30 +++++++++++++++++++++++++++++- MP.Land/MP.Land.csproj | 2 +- MP.Land/Pages/About.razor.cs | 9 +++------ MP.Land/Resources/ChangeLog.html | 2 +- MP.Land/Resources/VersNum.txt | 2 +- MP.Land/Resources/manifest.xml | 2 +- MP.SPEC/MP.SPEC.csproj | 2 +- MP.SPEC/Resources/ChangeLog.html | 2 +- MP.SPEC/Resources/VersNum.txt | 2 +- MP.SPEC/Resources/manifest.xml | 2 +- 10 files changed, 40 insertions(+), 15 deletions(-) diff --git a/MP.Land/Data/LicenseService.cs b/MP.Land/Data/LicenseService.cs index a9919f55..baeb055c 100644 --- a/MP.Land/Data/LicenseService.cs +++ b/MP.Land/Data/LicenseService.cs @@ -372,7 +372,35 @@ namespace MP.Land.Data } else { - _logger.LogInformation($"Record non trovato per {authKey}"); + _logger.LogInformation($"checkLicenseActive | Record non trovato per {authKey}"); + } + } + return answ; + } + /// + /// Verifica scadenza licenza + /// + /// + /// + public DateTime getLicenseExpiry(string authKey) + { + DateTime answ = DateTime.Today.AddDays(-1); + //cerco anche nelle info AKV + if (AKVList != null) + { + var recLic = AKVList.Where(x => x.ValString == authKey).FirstOrDefault(); + int numLic = 0; + //cerco in record + if (recLic != null) + { + numLic = (int)recLic.ValInt; + // verifico scadenza licenza! + DateTime scadenza = licenseManGLS.expiryDateByAuthKey(Installazione, recLic.NomeVar, numLic, authKey); + answ = scadenza; + } + else + { + _logger.LogInformation($"getLicenseExpiry | Record non trovato per {authKey}"); } } return answ; diff --git a/MP.Land/MP.Land.csproj b/MP.Land/MP.Land.csproj index f3047c6d..e5d244a5 100644 --- a/MP.Land/MP.Land.csproj +++ b/MP.Land/MP.Land.csproj @@ -3,7 +3,7 @@ net6.0 MP.Land - 6.16.2211.0415 + 6.16.2211.0416 diff --git a/MP.Land/Pages/About.razor.cs b/MP.Land/Pages/About.razor.cs index a423fa16..2f7a0ded 100644 --- a/MP.Land/Pages/About.razor.cs +++ b/MP.Land/Pages/About.razor.cs @@ -4,12 +4,8 @@ using System.Threading.Tasks; namespace MP.Land.Pages { - public partial class About + public partial class About { - #region Public Methods - - #endregion Public Methods - #region Protected Methods protected override async Task OnInitializedAsync() @@ -43,7 +39,7 @@ namespace MP.Land.Pages private async Task reloadLicenseData() { - int cDelay = 5; + int cDelay = 10; // recupero dati await Task.Delay(cDelay); try @@ -54,6 +50,7 @@ namespace MP.Land.Pages Installazione = LicServ.Installazione; Applicazione = LicServ.Applicazione; MastKey = LicServ.MasterKey; + Scadenza = LicServ.getLicenseExpiry(LicServ.MasterKey); await Task.Delay(cDelay); var fatto = await LicServ.RefreshLicense(); await Task.Delay(cDelay); diff --git a/MP.Land/Resources/ChangeLog.html b/MP.Land/Resources/ChangeLog.html index 36121c06..9fbcacb8 100644 --- a/MP.Land/Resources/ChangeLog.html +++ b/MP.Land/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo gestione Programmi MAPO -

Versione: 6.16.2211.0415

+

Versione: 6.16.2211.0416


Note di rilascio: