From 6f03fcf4404ce8778cddcc05e1e5d0e6cbcca6b0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 13 Nov 2021 11:00:10 +0100 Subject: [PATCH 1/7] Aggiunta attivazioni in editing licenza + altri componenti --- LiMan.UI/Components/Activations.razor | 50 +++++++++---------- LiMan.UI/Components/Activations.razor.cs | 24 ++++----- LiMan.UI/Components/EditLicenze.razor.cs | 18 ++++--- .../Components/ListInstallazioni.razor.cs | 3 -- LiMan.UI/Components/ListLicenze.razor | 8 ++- LiMan.UI/Components/ListLicenze.razor.cs | 18 +++++++ 6 files changed, 71 insertions(+), 50 deletions(-) diff --git a/LiMan.UI/Components/Activations.razor b/LiMan.UI/Components/Activations.razor index bb9d1a1..c7769d3 100644 --- a/LiMan.UI/Components/Activations.razor +++ b/LiMan.UI/Components/Activations.razor @@ -4,7 +4,7 @@ - + # Impiego @@ -16,35 +16,35 @@ @foreach (var record in ListRecords) { - - - - - - @record.IdxSubLic - - - @record.CodImpiego - - - @record.Chiave - - - @($"{record.VetoUnlock:yyyy.MM.dd}") - - - @if (record.Locked) + + + + + + @record.IdxSubLic + + + @record.CodImpiego + + + @record.Chiave + + + @($"{record.VetoUnlock:yyyy.MM.dd}") + + + @if (record.Locked) { - + } else { - + } - - + + } diff --git a/LiMan.UI/Components/Activations.razor.cs b/LiMan.UI/Components/Activations.razor.cs index e75a32e..1a2344b 100644 --- a/LiMan.UI/Components/Activations.razor.cs +++ b/LiMan.UI/Components/Activations.razor.cs @@ -20,6 +20,7 @@ namespace LiMan.UI.Components #region Protected Fields protected SubLicenzaModel _currRecord = new SubLicenzaModel(); + protected LicenzaModel _masterLic = new LicenzaModel(); #endregion Protected Fields @@ -54,6 +55,12 @@ namespace LiMan.UI.Components #region Public Properties + [Parameter] + public EventCallback DataReset { get; set; } + + [Parameter] + public EventCallback DataUpdated { get; set; } + [Parameter] public LicenzaModel MasterLicence { @@ -92,8 +99,9 @@ namespace LiMan.UI.Components #region Protected Methods - protected void close() + protected async void close() { + await DataUpdated.InvokeAsync(0); } /// @@ -119,20 +127,6 @@ namespace LiMan.UI.Components return answ; } - protected async Task PagerReloadNum(int newNum) - { - numRecord = newNum; - await ReloadAllData(); - isLoading = false; - } - - protected async Task PagerReloadPage(int newNum) - { - currPage = newNum; - await ReloadAllData(); - isLoading = false; - } - protected async Task ResetData() { await fullReload(); diff --git a/LiMan.UI/Components/EditLicenze.razor.cs b/LiMan.UI/Components/EditLicenze.razor.cs index 60993d0..f546d2d 100644 --- a/LiMan.UI/Components/EditLicenze.razor.cs +++ b/LiMan.UI/Components/EditLicenze.razor.cs @@ -70,6 +70,12 @@ namespace LiMan.UI.Components set { _currItem = value; + var pUpd = Task.Run(async () => + { + ListApp = await DataService.ApplicazioniNextGetAll(); + ListInstall = await DataService.InstallazioniNextGetAll(); + }); + pUpd.Wait(); } } @@ -120,12 +126,12 @@ namespace LiMan.UI.Components return q[parmName] ?? ""; } - protected override async Task OnInitializedAsync() - { - ListApp = await DataService.ApplicazioniNextGetAll(); - ListInstall = await DataService.InstallazioniNextGetAll(); - } - #endregion Protected Methods + + //protected override async Task OnInitializedAsync() + //{ + // ListApp = await DataService.ApplicazioniNextGetAll(); + // ListInstall = await DataService.InstallazioniNextGetAll(); + //} } } \ No newline at end of file diff --git a/LiMan.UI/Components/ListInstallazioni.razor.cs b/LiMan.UI/Components/ListInstallazioni.razor.cs index 03efedc..608a237 100644 --- a/LiMan.UI/Components/ListInstallazioni.razor.cs +++ b/LiMan.UI/Components/ListInstallazioni.razor.cs @@ -104,9 +104,6 @@ namespace LiMan.UI.Components protected override async Task OnInitializedAsync() { - AppMService.ShowSearch = false; - AppMService.PageName = "Gestione Licenze NEXT"; - AppMService.PageIcon = "fas fa-key"; await ReloadAllData(); } diff --git a/LiMan.UI/Components/ListLicenze.razor b/LiMan.UI/Components/ListLicenze.razor index 7556745..ef0f224 100644 --- a/LiMan.UI/Components/ListLicenze.razor +++ b/LiMan.UI/Components/ListLicenze.razor @@ -1,4 +1,5 @@ @using LiMan.UI.Components +
@@ -7,6 +8,11 @@
+
+ +
@@ -168,7 +174,7 @@ @if (showActivations) {
- +
}
diff --git a/LiMan.UI/Components/ListLicenze.razor.cs b/LiMan.UI/Components/ListLicenze.razor.cs index 5f39282..183c1e2 100644 --- a/LiMan.UI/Components/ListLicenze.razor.cs +++ b/LiMan.UI/Components/ListLicenze.razor.cs @@ -169,6 +169,24 @@ namespace LiMan.UI.Components #region Protected Methods + protected void AddNew() + { + LicenzaModel newRec = new LicenzaModel() + { + CodApp = "AAA", + CodInst = "EgalWare", + Descrizione = "Nuova Licenza", + Chiave = "000", + NumLicenze = 1, + Enigma = "", + Payload = "", + Tipo = DB.Enum.TipoLicenza.MasterKey, + Scadenza = DateTime.Today.AddMonths(1) + }; + currRecord = newRec; + showActivations = false; + } + /// /// formatta testo secondo scadenza: /// scadenza > 60gg --> verde From cf1139779e279c24639a8af5d4fd7f41a0786a08 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 13 Nov 2021 11:00:23 +0100 Subject: [PATCH 2/7] refresh apgine UI x applicazioni/installazioni --- LiMan.UI/Pages/Applicazioni.razor | 93 +++------------- LiMan.UI/Pages/Applicazioni.razor.cs | 146 -------------------------- LiMan.UI/Pages/Installazioni.razor | 101 +++--------------- LiMan.UI/Pages/Installazioni.razor.cs | 146 -------------------------- LiMan.UI/Pages/LiManDB.razor | 31 +----- LiMan.UI/Pages/LiManDB.razor.cs | 21 +++- 6 files changed, 47 insertions(+), 491 deletions(-) delete mode 100644 LiMan.UI/Pages/Applicazioni.razor.cs delete mode 100644 LiMan.UI/Pages/Installazioni.razor.cs diff --git a/LiMan.UI/Pages/Applicazioni.razor b/LiMan.UI/Pages/Applicazioni.razor index e1976da..18c5944 100644 --- a/LiMan.UI/Pages/Applicazioni.razor +++ b/LiMan.UI/Pages/Applicazioni.razor @@ -1,84 +1,17 @@ @page "/Applicazioni" @using LiMan.UI.Components +@using LiMan.UI.Data -
-
-
-
-
-
-

Applicazioni

-
-
-
- @**@ -
-
-
-
-
-
-
- @if (currRecord != null) - { - @**@ - } - @if (ListRecords == null) - { - - } - else if (totalCount == 0) - { -
Nessun record trovato
- } - else - { -
-
- - - - - - - - - - @foreach (var record in ListRecords) - { - - - - - - } - -
ApplicazioneDescrizione
- @if (currRecord == null) - { - - } - else - { - - } - - @record.Applicativo - -
@record.Descrizione
-
-
-
- } -
- -
\ No newline at end of file +@inject MessageService AppMService + + + +@code { + protected override void OnInitialized() + { + AppMService.ShowSearch = false; + AppMService.PageName = "Elenco Applicazioni"; + AppMService.PageIcon = "oi oi-list-rich"; + } +} \ No newline at end of file diff --git a/LiMan.UI/Pages/Applicazioni.razor.cs b/LiMan.UI/Pages/Applicazioni.razor.cs deleted file mode 100644 index ee3c998..0000000 --- a/LiMan.UI/Pages/Applicazioni.razor.cs +++ /dev/null @@ -1,146 +0,0 @@ -using LiMan.GLS.DatabaseModels; -using LiMan.UI.Data; -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace LiMan.UI.Pages -{ - public partial class Applicazioni : ComponentBase, IDisposable - { - #region Private Fields - - private AnagApplicazioni currRecord = null; - private List ListRecords; - private List SearchRecords; - - #endregion Private Fields - - #region Protected Fields - - protected int totalCount = 0; - - #endregion Protected Fields - - #region Private Properties - - private int currPage - { - get - { - return AppMService.PageNum; - } - set - { - AppMService.PageNum = value; - } - } - - private bool isLoading { get; set; } = false; - - private int numRecord - { - get - { - return AppMService.PageSize; - } - set - { - AppMService.PageSize = value; - } - } - - #endregion Private Properties - - #region Protected Properties - - [Inject] - protected MessageService AppMService { get; set; } - - [Inject] - protected LiManDataService DataService { get; set; } - - [Inject] - protected IJSRuntime JSRuntime { get; set; } - - [Inject] - protected NavigationManager NavManager { get; set; } - - protected bool showCamera { get; set; } = false; - - #endregion Protected Properties - - #region Private Methods - - private async Task ReloadAllData() - { - isLoading = true; - await Task.Delay(1); - //ListRecords = null; - SearchRecords = await DataService.ApplicazioniGLSGetAll(); - totalCount = SearchRecords.Count(); - ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); - isLoading = false; - } - - #endregion Private Methods - - #region Protected Methods - - protected void Edit(AnagApplicazioni selRecord) - { - currRecord = selRecord; - } - - protected override async Task OnInitializedAsync() - { - await ReloadAllData(); - } - - protected async Task PagerReloadNum(int newNum) - { - numRecord = newNum; - await ReloadAllData(); - isLoading = false; - } - - protected async Task PagerReloadPage(int newNum) - { - currPage = newNum; - await ReloadAllData(); - isLoading = false; - } - - protected void ResetData() - { - } - - #endregion Protected Methods - - #region Public Methods - - public string checkSelect(string Applicativo) - { - string answ = ""; - if (currRecord != null) - { - try - { - answ = (currRecord.Applicativo == Applicativo) ? "table-info" : ""; - } - catch - { } - } - return answ; - } - - public void Dispose() - { - } - - #endregion Public Methods - } -} \ No newline at end of file diff --git a/LiMan.UI/Pages/Installazioni.razor b/LiMan.UI/Pages/Installazioni.razor index 171c06d..c3f2cc7 100644 --- a/LiMan.UI/Pages/Installazioni.razor +++ b/LiMan.UI/Pages/Installazioni.razor @@ -1,92 +1,17 @@ @page "/Installazioni" @using LiMan.UI.Components +@using LiMan.UI.Data -
-
-
-
-
-
-

Installazioni

-
-
-
- @**@ -
-
-
-
-
-
-
- @if (currRecord != null) - { - @**@ - } - @if (ListRecords == null) - { - - } - else if (totalCount == 0) - { -
Nessun record trovato
- } - else - { -
-
- - - - - - - - - - - - @foreach (var record in ListRecords) - { - - - - - - - - } - -
InstallazioneDescrizioneContattoEmail
- @if (currRecord == null) - { - - } - else - { - - } - - @record.Installazione - -
@record.Descrizione
-
-
@record.Contatto
-
-
@record.Email
-
-
-
- } -
- -
\ No newline at end of file +@inject MessageService AppMService + + + +@code { + protected override void OnInitialized() + { + AppMService.ShowSearch = false; + AppMService.PageName = "Elenco Installazioni/Clienti"; + AppMService.PageIcon = "oi oi-list-rich"; + } +} \ No newline at end of file diff --git a/LiMan.UI/Pages/Installazioni.razor.cs b/LiMan.UI/Pages/Installazioni.razor.cs deleted file mode 100644 index b30b55f..0000000 --- a/LiMan.UI/Pages/Installazioni.razor.cs +++ /dev/null @@ -1,146 +0,0 @@ -using LiMan.GLS.DatabaseModels; -using LiMan.UI.Data; -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace LiMan.UI.Pages -{ - public partial class Installazioni : ComponentBase, IDisposable - { - #region Private Fields - - private AnagInstallazioni currRecord = null; - private List ListRecords; - private List SearchRecords; - - #endregion Private Fields - - #region Protected Fields - - protected int totalCount = 0; - - #endregion Protected Fields - - #region Private Properties - - private int currPage - { - get - { - return AppMService.PageNum; - } - set - { - AppMService.PageNum = value; - } - } - - private bool isLoading { get; set; } = false; - - private int numRecord - { - get - { - return AppMService.PageSize; - } - set - { - AppMService.PageSize = value; - } - } - - #endregion Private Properties - - #region Protected Properties - - [Inject] - protected MessageService AppMService { get; set; } - - [Inject] - protected LiManDataService DataService { get; set; } - - [Inject] - protected IJSRuntime JSRuntime { get; set; } - - [Inject] - protected NavigationManager NavManager { get; set; } - - protected bool showCamera { get; set; } = false; - - #endregion Protected Properties - - #region Private Methods - - private async Task ReloadAllData() - { - isLoading = true; - await Task.Delay(1); - //ListRecords = null; - SearchRecords = await DataService.InstallazioniGLSGetAll(); - totalCount = SearchRecords.Count(); - ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); - isLoading = false; - } - - #endregion Private Methods - - #region Protected Methods - - protected void Edit(AnagInstallazioni selRecord) - { - currRecord = selRecord; - } - - protected override async Task OnInitializedAsync() - { - await ReloadAllData(); - } - - protected async Task PagerReloadNum(int newNum) - { - numRecord = newNum; - await ReloadAllData(); - isLoading = false; - } - - protected async Task PagerReloadPage(int newNum) - { - currPage = newNum; - await ReloadAllData(); - isLoading = false; - } - - protected void ResetData() - { - } - - #endregion Protected Methods - - #region Public Methods - - public string checkSelect(string Installazione) - { - string answ = ""; - if (currRecord != null) - { - try - { - answ = (currRecord.Installazione == Installazione) ? "table-info" : ""; - } - catch - { } - } - return answ; - } - - public void Dispose() - { - } - - #endregion Public Methods - } -} \ No newline at end of file diff --git a/LiMan.UI/Pages/LiManDB.razor b/LiMan.UI/Pages/LiManDB.razor index 9d8ebd7..e507c15 100644 --- a/LiMan.UI/Pages/LiManDB.razor +++ b/LiMan.UI/Pages/LiManDB.razor @@ -5,36 +5,7 @@
-
- -
-
-
-
- -
-
-
-
-
-
- -
-
- -
-
-
-
+
\ No newline at end of file diff --git a/LiMan.UI/Pages/LiManDB.razor.cs b/LiMan.UI/Pages/LiManDB.razor.cs index b52a49e..8bc65b4 100644 --- a/LiMan.UI/Pages/LiManDB.razor.cs +++ b/LiMan.UI/Pages/LiManDB.razor.cs @@ -1,4 +1,6 @@ -using System; +using LiMan.UI.Data; +using Microsoft.AspNetCore.Components; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -7,5 +9,22 @@ namespace LiMan.UI.Pages { public partial class LiManDB { + #region Protected Properties + + [Inject] + protected MessageService AppMService { get; set; } + + #endregion Protected Properties + + #region Protected Methods + + protected override void OnInitialized() + { + AppMService.ShowSearch = false; + AppMService.PageName = "Gestione Licenze NEXT"; + AppMService.PageIcon = "fas fa-key pr-1"; + } + + #endregion Protected Methods } } \ No newline at end of file From 17c59324f4b25dcd4122f9add56911414fcda41b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 13 Nov 2021 11:00:38 +0100 Subject: [PATCH 3/7] fix nav menu --- LiMan.UI/Shared/NavMenu.razor | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/LiMan.UI/Shared/NavMenu.razor b/LiMan.UI/Shared/NavMenu.razor index 9be9f65..02ff0e5 100644 --- a/LiMan.UI/Shared/NavMenu.razor +++ b/LiMan.UI/Shared/NavMenu.razor @@ -17,21 +17,21 @@ Gestione Licenze NEXT + + - @**@ - @**@
From 3333b7f827a996441dfd443aa7928ff595e2ffdb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 13 Nov 2021 11:00:50 +0100 Subject: [PATCH 4/7] Nuovi oggetti licenza x testing --- Core/LicenseInquiry.cs | 20 ++++++++++++++++++++ Core/UserLicenseRequest.cs | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 Core/LicenseInquiry.cs diff --git a/Core/LicenseInquiry.cs b/Core/LicenseInquiry.cs new file mode 100644 index 0000000..fba9104 --- /dev/null +++ b/Core/LicenseInquiry.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Core +{ + public class LicenseCoord + { + #region Public Properties + + public string CodApp { get; set; } = ""; + public string CodInst { get; set; } = ""; + public string Enigma { get; set; } = ""; + public string MasterKey { get; set; } = ""; + + #endregion Public Properties + } +} \ No newline at end of file diff --git a/Core/UserLicenseRequest.cs b/Core/UserLicenseRequest.cs index 068d3e4..3449565 100644 --- a/Core/UserLicenseRequest.cs +++ b/Core/UserLicenseRequest.cs @@ -8,7 +8,11 @@ namespace Core { public class UserLicenseRequest { + #region Public Properties + public string MasterKey { get; set; } = ""; public Dictionary ParamDict { get; set; } = new Dictionary(); + + #endregion Public Properties } -} +} \ No newline at end of file From ddf0a013b0c48c8c9c6b083e290a0261675f4a40 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 13 Nov 2021 11:01:17 +0100 Subject: [PATCH 5/7] Metodi API x nuova gestione applicativo/attivazioni --- LiMan.Api/Controllers/LicenzaController.cs | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/LiMan.Api/Controllers/LicenzaController.cs b/LiMan.Api/Controllers/LicenzaController.cs index 3892f26..bb7ba4e 100644 --- a/LiMan.Api/Controllers/LicenzaController.cs +++ b/LiMan.Api/Controllers/LicenzaController.cs @@ -1,4 +1,5 @@ -using LiMan.APi.Data; +using Core; +using LiMan.APi.Data; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using NLog; @@ -66,6 +67,32 @@ namespace LiMan.APi.Controllers return result; } + /// POST api/licenza + /// + /// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE + /// + /// Info licenza in formato LicenseCoord + /// + [HttpPost()] + public async Task> Get([FromBody] LicenseCoord AppInfo) + { + var result = await _DataService.LicenzeSearch(AppInfo.CodInst, AppInfo.CodApp, AppInfo.MasterKey, false); + + return result; + } + + /// + /// Effettua refresh del payload calcolato ed aggiorna record ed infine lo restituisce + /// + /// Info licenza in formato LicenseCoord + // POST api/attivazioni/refreshPayload + [HttpPost("refreshPayload")] + public async Task RefreshPayload([FromBody] LicenseCoord AppInfo) + { + var done = await _DataService.LicenzaRefreshPayload(AppInfo); + return done; + } + #endregion Public Methods } } \ No newline at end of file From 3bbebf740eabc5f59d8c042290c25ca4d458647b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 13 Nov 2021 11:01:28 +0100 Subject: [PATCH 6/7] Update API e controller dati --- LiMan.Api/Data/ApiDataService.cs | 21 +++++- LiMan.Api/LiMan.APi.xml | 21 ++++++ .../PublishProfiles/IIS01.pubxml.user | 2 +- .../PublishProfiles/IIS02.pubxml.user | 2 +- LiMan.DB/Controllers/DbController.cs | 69 +++++++++++++++++++ 5 files changed, 112 insertions(+), 3 deletions(-) diff --git a/LiMan.Api/Data/ApiDataService.cs b/LiMan.Api/Data/ApiDataService.cs index fed3d31..8e0aea8 100644 --- a/LiMan.Api/Data/ApiDataService.cs +++ b/LiMan.Api/Data/ApiDataService.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.Configuration; +using Core; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using NLog; using System; @@ -55,6 +56,24 @@ namespace LiMan.APi.Data #endregion Public Constructors + #region Internal Methods + + /// + /// Effettua refresh del payload della licenza dato info + enigma generato dal client + /// + /// + /// + internal async Task LicenzaRefreshPayload(LicenseCoord appInfo) + { + // chiamo metodo x ricalcolare payload dato enigma + bool done = await dbController.LicenseUpdatePayload(appInfo.CodInst, appInfo.CodApp, appInfo.MasterKey, appInfo.Enigma); + // ora recupero i dati + var licList = await LicenzeSearch(appInfo.CodInst, appInfo.CodApp, appInfo.MasterKey, false); + return licList.FirstOrDefault(); + } + + #endregion Internal Methods + #region Public Methods /// diff --git a/LiMan.Api/LiMan.APi.xml b/LiMan.Api/LiMan.APi.xml index b02e3e6..50b3569 100644 --- a/LiMan.Api/LiMan.APi.xml +++ b/LiMan.Api/LiMan.APi.xml @@ -147,6 +147,20 @@ Chiave licenza da validare + + POST api/licenza + + Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE + + Info licenza in formato LicenseCoord + + + + + Effettua refresh del payload calcolato ed aggiorna record ed infine lo restituisce + + Info licenza in formato LicenseCoord + Classe astrazione accesso dati @@ -159,6 +173,13 @@ + + + Effettua refresh del payload della licenza dato info + enigma generato dal client + + + + Elenco licenze dato cliente diff --git a/LiMan.Api/Properties/PublishProfiles/IIS01.pubxml.user b/LiMan.Api/Properties/PublishProfiles/IIS01.pubxml.user index 5551d00..876b936 100644 --- a/LiMan.Api/Properties/PublishProfiles/IIS01.pubxml.user +++ b/LiMan.Api/Properties/PublishProfiles/IIS01.pubxml.user @@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5 - True|2021-11-08T11:34:27.5881363Z;True|2021-11-08T12:34:19.3151235+01:00;True|2021-11-06T11:19:02.9085307+01:00;True|2021-11-06T11:18:28.0387848+01:00;True|2021-11-06T09:53:17.1717596+01:00;True|2021-10-21T17:47:07.5800856+02:00;True|2021-10-21T17:45:53.9877689+02:00;True|2021-10-21T17:45:26.3424924+02:00;True|2021-10-21T17:44:04.8901686+02:00;True|2021-10-21T17:12:38.0143120+02:00;True|2021-10-21T12:48:27.8969428+02:00;True|2021-10-21T12:45:17.7896250+02:00;True|2021-10-21T12:44:18.8941191+02:00;True|2021-10-21T08:48:23.1235907+02:00;True|2021-10-21T08:48:18.3291685+02:00;True|2021-10-15T11:33:23.1161895+02:00;True|2021-10-15T11:26:37.7646366+02:00;True|2021-10-15T11:26:08.9411561+02:00;True|2021-10-15T11:25:36.6377010+02:00;True|2021-10-15T11:25:15.7375383+02:00;True|2021-10-15T11:20:26.4607123+02:00;True|2021-10-15T11:13:33.8524245+02:00;False|2021-10-15T10:30:42.4253422+02:00;False|2021-10-15T10:27:43.8339493+02:00;False|2021-10-15T10:23:05.0864739+02:00;False|2021-10-15T10:22:43.2958457+02:00;False|2021-10-15T10:22:15.0954116+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; + True|2021-11-09T11:19:52.2790510Z;True|2021-11-09T12:08:01.8726340+01:00;True|2021-11-09T12:07:57.5873940+01:00;True|2021-11-09T12:01:34.0204222+01:00;True|2021-11-08T19:24:35.2527291+01:00;True|2021-11-08T19:23:56.1076813+01:00;True|2021-11-08T12:34:27.5881363+01:00;True|2021-11-08T12:34:19.3151235+01:00;True|2021-11-06T11:19:02.9085307+01:00;True|2021-11-06T11:18:28.0387848+01:00;True|2021-11-06T09:53:17.1717596+01:00;True|2021-10-21T17:47:07.5800856+02:00;True|2021-10-21T17:45:53.9877689+02:00;True|2021-10-21T17:45:26.3424924+02:00;True|2021-10-21T17:44:04.8901686+02:00;True|2021-10-21T17:12:38.0143120+02:00;True|2021-10-21T12:48:27.8969428+02:00;True|2021-10-21T12:45:17.7896250+02:00;True|2021-10-21T12:44:18.8941191+02:00;True|2021-10-21T08:48:23.1235907+02:00;True|2021-10-21T08:48:18.3291685+02:00;True|2021-10-15T11:33:23.1161895+02:00;True|2021-10-15T11:26:37.7646366+02:00;True|2021-10-15T11:26:08.9411561+02:00;True|2021-10-15T11:25:36.6377010+02:00;True|2021-10-15T11:25:15.7375383+02:00;True|2021-10-15T11:20:26.4607123+02:00;True|2021-10-15T11:13:33.8524245+02:00;False|2021-10-15T10:30:42.4253422+02:00;False|2021-10-15T10:27:43.8339493+02:00;False|2021-10-15T10:23:05.0864739+02:00;False|2021-10-15T10:22:43.2958457+02:00;False|2021-10-15T10:22:15.0954116+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; \ No newline at end of file diff --git a/LiMan.Api/Properties/PublishProfiles/IIS02.pubxml.user b/LiMan.Api/Properties/PublishProfiles/IIS02.pubxml.user index 388769e..c3a5628 100644 --- a/LiMan.Api/Properties/PublishProfiles/IIS02.pubxml.user +++ b/LiMan.Api/Properties/PublishProfiles/IIS02.pubxml.user @@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5 - True|2021-11-08T11:35:03.8241794Z;True|2021-11-08T12:34:36.4622795+01:00;True|2021-11-06T11:18:52.0560366+01:00;True|2021-11-06T11:18:39.5514277+01:00;True|2021-10-21T17:10:41.5356616+02:00;True|2021-10-21T17:09:53.6684540+02:00;True|2021-10-21T12:51:53.0071793+02:00;True|2021-10-21T12:50:27.0123409+02:00;True|2021-10-21T08:48:42.2014540+02:00;True|2021-10-21T08:48:38.0576948+02:00;True|2021-10-21T08:48:31.5097766+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; + True|2021-11-09T11:20:06.9465420Z;True|2021-11-09T12:20:01.4943151+01:00;True|2021-11-09T12:09:11.1703666+01:00;True|2021-11-09T12:09:07.5492827+01:00;True|2021-11-09T12:08:22.2154622+01:00;True|2021-11-09T12:08:12.9067242+01:00;True|2021-11-08T19:23:37.2357518+01:00;True|2021-11-08T19:23:26.7465032+01:00;True|2021-11-08T12:35:03.8241794+01:00;True|2021-11-08T12:34:36.4622795+01:00;True|2021-11-06T11:18:52.0560366+01:00;True|2021-11-06T11:18:39.5514277+01:00;True|2021-10-21T17:10:41.5356616+02:00;True|2021-10-21T17:09:53.6684540+02:00;True|2021-10-21T12:51:53.0071793+02:00;True|2021-10-21T12:50:27.0123409+02:00;True|2021-10-21T08:48:42.2014540+02:00;True|2021-10-21T08:48:38.0576948+02:00;True|2021-10-21T08:48:31.5097766+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; \ No newline at end of file diff --git a/LiMan.DB/Controllers/DbController.cs b/LiMan.DB/Controllers/DbController.cs index 6f78d44..89ef10f 100644 --- a/LiMan.DB/Controllers/DbController.cs +++ b/LiMan.DB/Controllers/DbController.cs @@ -6,6 +6,7 @@ using NLog; using System; using System.Collections.Generic; using System.Linq; +using System.Security.Cryptography; using System.Text; using System.Threading.Tasks; @@ -533,6 +534,74 @@ namespace LiMan.DB.Controllers return dbResult; } + /// + /// Effettua refresh del payload della licenza dato info + enigma generato dal client + /// + /// + /// + /// + /// + /// + public Task LicenseUpdatePayload(string codInst, string codApp, string masterKey, string enigma) + { + bool fatto = false; + string newPayload = ""; + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + LicenzaModel mainLic = localDbCtx + .DbSetLicenze + .Where(x => x.CodApp == codApp && x.CodInst == codInst && x.Chiave == masterKey) + .Include(a => a.Attivazioni) + .FirstOrDefault(); + if (mainLic != null) + { + // se ho attivazioni... + if (mainLic.Attivazioni != null && mainLic.Attivazioni.Count > 0) + { + // se ho trovato --> recupero info applicazioni.... + var hashList = mainLic + .Attivazioni + .OrderBy(x => x.CodImpiego) + .Select(x => x.CodImpiego) + .ToList(); + // costruisco stringa da elenco impieghi... + StringBuilder sb = new StringBuilder(); + foreach (var item in hashList) + { + sb.AppendLine(item); + } + string rawData = sb.ToString(); + + // hashing! + using (var md5 = MD5.Create()) + { + byte[] InputBytes = Encoding.UTF8.GetBytes(rawData); + var byteHash = md5.ComputeHash(InputBytes); + newPayload = BitConverter.ToString(byteHash).Replace("-", "").ToLowerInvariant(); + } + } + else + { + // tengo vecchio payload + newPayload = mainLic.Payload; + } + + // salvo info! + mainLic.Enigma = enigma; + mainLic.DataEnigma = DateTime.Now; + mainLic.Payload = newPayload; + + // indico modificato + localDbCtx.Entry(mainLic).State = EntityState.Modified; + // salvo + localDbCtx.SaveChanges(); + fatto = true; + } + } + // restituisco fatto + return Task.FromResult(fatto); + } + /// /// Annulla modifiche su una specifica entity (cancel update) /// From 2665b63f395fe80de44acd9670b775e3935aed7e Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Sat, 13 Nov 2021 11:01:34 +0100 Subject: [PATCH 7/7] refresh globale --- LiMan.UI/LiMan.UI.csproj | 2 +- LiMan.UI/Properties/PublishProfiles/IIS01.pubxml.user | 2 +- LiMan.UI/Properties/PublishProfiles/IIS02.pubxml.user | 2 +- LiMan.UI/Resources/ChangeLog.html | 2 +- LiMan.UI/Resources/VersNum.txt | 2 +- LiMan.UI/Resources/manifest.xml | 2 +- LiMan.sln | 4 ++-- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index 312f492..19c6dc8 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net5.0 - 1.1.2111.0815 + 1.1.2111.1310 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Properties/PublishProfiles/IIS01.pubxml.user b/LiMan.UI/Properties/PublishProfiles/IIS01.pubxml.user index f0fb7eb..59346ef 100644 --- a/LiMan.UI/Properties/PublishProfiles/IIS01.pubxml.user +++ b/LiMan.UI/Properties/PublishProfiles/IIS01.pubxml.user @@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5 - True|2021-10-21T10:25:14.7142511Z;False|2021-10-21T12:24:42.4755537+02:00;True|2021-10-21T12:21:40.3278003+02:00;True|2021-10-21T12:20:53.0043613+02:00;True|2021-10-21T12:20:40.4757156+02:00;True|2021-10-21T08:46:30.7409630+02:00;True|2021-10-21T08:46:23.7853777+02:00;True|2021-10-15T11:33:23.1161895+02:00;True|2021-10-15T11:26:37.7646366+02:00;True|2021-10-15T11:26:08.9411561+02:00;True|2021-10-15T11:25:36.6377010+02:00;True|2021-10-15T11:25:15.7375383+02:00;True|2021-10-15T11:20:26.4607123+02:00;True|2021-10-15T11:13:33.8524245+02:00;False|2021-10-15T10:30:42.4253422+02:00;False|2021-10-15T10:27:43.8339493+02:00;False|2021-10-15T10:23:05.0864739+02:00;False|2021-10-15T10:22:43.2958457+02:00;False|2021-10-15T10:22:15.0954116+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; + True|2021-11-08T15:54:51.5730510Z;True|2021-11-08T16:54:38.6533172+01:00;False|2021-11-08T16:54:25.9022390+01:00;False|2021-11-08T16:37:09.0781792+01:00;False|2021-11-08T16:37:00.0817797+01:00;True|2021-10-21T12:25:14.7142511+02:00;False|2021-10-21T12:24:42.4755537+02:00;True|2021-10-21T12:21:40.3278003+02:00;True|2021-10-21T12:20:53.0043613+02:00;True|2021-10-21T12:20:40.4757156+02:00;True|2021-10-21T08:46:30.7409630+02:00;True|2021-10-21T08:46:23.7853777+02:00;True|2021-10-15T11:33:23.1161895+02:00;True|2021-10-15T11:26:37.7646366+02:00;True|2021-10-15T11:26:08.9411561+02:00;True|2021-10-15T11:25:36.6377010+02:00;True|2021-10-15T11:25:15.7375383+02:00;True|2021-10-15T11:20:26.4607123+02:00;True|2021-10-15T11:13:33.8524245+02:00;False|2021-10-15T10:30:42.4253422+02:00;False|2021-10-15T10:27:43.8339493+02:00;False|2021-10-15T10:23:05.0864739+02:00;False|2021-10-15T10:22:43.2958457+02:00;False|2021-10-15T10:22:15.0954116+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; \ No newline at end of file diff --git a/LiMan.UI/Properties/PublishProfiles/IIS02.pubxml.user b/LiMan.UI/Properties/PublishProfiles/IIS02.pubxml.user index e7d398d..43bb1b1 100644 --- a/LiMan.UI/Properties/PublishProfiles/IIS02.pubxml.user +++ b/LiMan.UI/Properties/PublishProfiles/IIS02.pubxml.user @@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5 - True|2021-10-21T06:47:02.7531067Z;True|2021-10-21T08:46:57.5039372+02:00;True|2021-10-21T08:46:50.4899105+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; + True|2021-11-08T15:55:31.8559198Z;True|2021-10-21T08:47:02.7531067+02:00;True|2021-10-21T08:46:57.5039372+02:00;True|2021-10-21T08:46:50.4899105+02:00;True|2021-10-15T10:15:10.5127570+02:00;False|2021-10-15T10:13:53.0299219+02:00;False|2021-10-15T08:58:38.3028788+02:00;False|2021-10-15T08:47:48.5789826+02:00;False|2021-10-14T19:32:56.5281204+02:00;False|2021-10-14T19:31:10.1629370+02:00;True|2021-05-26T19:49:30.0427896+02:00;False|2021-05-26T19:49:14.9065510+02:00;True|2021-05-25T17:48:33.3901785+02:00;True|2021-05-25T17:46:09.2063020+02:00;True|2021-05-25T17:42:47.8167539+02:00;True|2021-05-25T17:22:03.1877438+02:00;True|2021-05-25T17:21:05.1565775+02:00;True|2021-05-25T16:26:34.1426996+02:00;True|2021-05-25T16:14:28.2842402+02:00;True|2021-05-25T15:02:11.7131495+02:00; \ No newline at end of file diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index 222e9e1..dcc2fe1 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

Versione: 1.1.2111.0815

+

Versione: 1.1.2111.1310


Note di rilascio:
    diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index 81016c3..467c4e5 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2111.0815 +1.1.2111.1310 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index d0e1a7d..94f0be8 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2111.0815 + 1.1.2111.1310 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false diff --git a/LiMan.sln b/LiMan.sln index a163485..c71b9e6 100644 --- a/LiMan.sln +++ b/LiMan.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31727.386 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LiMan.GLS", "LiMan.GLS\LiMan.GLS.csproj", "{D9E7520A-2CB8-403A-A147-B7880FA47ED8}" EndProject