Merge branch 'release/AddNewLicenseMethod'

This commit is contained in:
Samuele Locatelli
2021-11-13 11:02:08 +01:00
28 changed files with 301 additions and 564 deletions
+20
View File
@@ -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
}
}
+5 -1
View File
@@ -8,7 +8,11 @@ namespace Core
{
public class UserLicenseRequest
{
#region Public Properties
public string MasterKey { get; set; } = "";
public Dictionary<string, string> ParamDict { get; set; } = new Dictionary<string, string>();
#endregion Public Properties
}
}
}
+28 -1
View File
@@ -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
/// <summary>
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE
/// </summary>
/// <param name="AppInfo">Info licenza in formato LicenseCoord</param>
/// <returns></returns>
[HttpPost()]
public async Task<List<DB.DTO.ApplicativoDTO>> Get([FromBody] LicenseCoord AppInfo)
{
var result = await _DataService.LicenzeSearch(AppInfo.CodInst, AppInfo.CodApp, AppInfo.MasterKey, false);
return result;
}
/// <summary>
/// Effettua refresh del payload calcolato ed aggiorna record ed infine lo restituisce
/// </summary>
/// <param name="AppInfo">Info licenza in formato LicenseCoord</param>
// POST api/attivazioni/refreshPayload
[HttpPost("refreshPayload")]
public async Task<DB.DTO.ApplicativoDTO> RefreshPayload([FromBody] LicenseCoord AppInfo)
{
var done = await _DataService.LicenzaRefreshPayload(AppInfo);
return done;
}
#endregion Public Methods
}
}
+20 -1
View File
@@ -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
/// <summary>
/// Effettua refresh del payload della licenza dato info + enigma generato dal client
/// </summary>
/// <param name="appInfo"></param>
/// <returns></returns>
internal async Task<DB.DTO.ApplicativoDTO> 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
/// <summary>
+21
View File
@@ -147,6 +147,20 @@
<param name="Chiave">Chiave licenza da validare</param>
<returns></returns>
</member>
<member name="M:LiMan.APi.Controllers.LicenzaController.Get(Core.LicenseCoord)">
POST api/licenza
<summary>
Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE
</summary>
<param name="AppInfo">Info licenza in formato LicenseCoord</param>
<returns></returns>
</member>
<member name="M:LiMan.APi.Controllers.LicenzaController.RefreshPayload(Core.LicenseCoord)">
<summary>
Effettua refresh del payload calcolato ed aggiorna record ed infine lo restituisce
</summary>
<param name="AppInfo">Info licenza in formato LicenseCoord</param>
</member>
<member name="T:LiMan.APi.Data.ApiDataService">
<summary>
Classe astrazione accesso dati
@@ -159,6 +173,13 @@
<param name="configuration"></param>
<param name="logger"></param>
</member>
<member name="M:LiMan.APi.Data.ApiDataService.LicenzaRefreshPayload(Core.LicenseCoord)">
<summary>
Effettua refresh del payload della licenza dato info + enigma generato dal client
</summary>
<param name="appInfo"></param>
<returns></returns>
</member>
<member name="M:LiMan.APi.Data.ApiDataService.ApplicativiSearch(System.String,System.String,System.Boolean)">
<summary>
Elenco licenze dato cliente
@@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5</EncryptedPassword>
<History>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;</History>
<History>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;</History>
</PropertyGroup>
</Project>
@@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5</EncryptedPassword>
<History>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;</History>
<History>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;</History>
</PropertyGroup>
</Project>
+69
View File
@@ -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;
}
/// <summary>
/// Effettua refresh del payload della licenza dato info + enigma generato dal client
/// </summary>
/// <param name="codInst"></param>
/// <param name="codApp"></param>
/// <param name="masterKey"></param>
/// <param name="enigma"></param>
/// <returns></returns>
public Task<bool> 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);
}
/// <summary>
/// Annulla modifiche su una specifica entity (cancel update)
/// </summary>
+25 -25
View File
@@ -4,7 +4,7 @@
<tr>
<th>
<button type="button" class="btn btn-sm btn-warning btn-block" @onclick="close()"><i class="fas fa-times"></i></button>
<button type="button" class="btn btn-sm btn-warning btn-block" value="Cancel" @onclick="close"><i class="fas fa-times"></i></button>
</th>
<th>#</th>
<th>Impiego</th>
@@ -16,35 +16,35 @@
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.IdxLic)">
<td class="text-nowrap">
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
<i class="oi oi-lock-unlocked"></i>
</button>
</td>
<td>
<b>@record.IdxSubLic</b>
</td>
<td>
@record.CodImpiego
</td>
<td>
@record.Chiave
</td>
<td>
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
</td>
<td class="text-right">
@if (record.Locked)
<tr class="@checkSelect(record.IdxLic)">
<td class="text-nowrap">
<button class="btn btn-sm btn-info" @onclick="() => UnLock(record)" title="Edit record">
<i class="oi oi-lock-unlocked"></i>
</button>
</td>
<td>
<b>@record.IdxSubLic</b>
</td>
<td>
@record.CodImpiego
</td>
<td>
@record.Chiave
</td>
<td>
<span class="@cssScadenza(record.VetoUnlock)">@($"{record.VetoUnlock:yyyy.MM.dd}")</span>
</td>
<td class="text-right">
@if (record.Locked)
{
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
<span aria-hidden="true" title="Licenza Bloccata"><i class="fas fa-lock text-danger"></i></span>
}
else
{
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
<span aria-hidden="true" title="Licenza Libera"><i class="fas fa-unlock-alt text-success"></i></span>
}
</td>
</tr>
</td>
</tr>
}
</tbody>
</table>
+9 -15
View File
@@ -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<int> DataReset { get; set; }
[Parameter]
public EventCallback<int> 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);
}
/// <summary>
@@ -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();
+12 -6
View File
@@ -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();
//}
}
}
@@ -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();
}
+7 -1
View File
@@ -1,4 +1,5 @@
@using LiMan.UI.Components
<div class="card">
<div class="card-header">
<div class="row">
@@ -7,6 +8,11 @@
</div>
<div class="col-9">
<div class="d-flex flex-row-reverse justify-content-between">
<div class="p-2">
<button class="btn btn-sm btn-success" @onclick="() => AddNew()" title="Nuovo record">
<i class="fas fa-plus"></i>
</button>
</div>
<div class="p-2">
<div class="input-group input-group-sm">
<div class="input-group-prepend">
@@ -168,7 +174,7 @@
@if (showActivations)
{
<div class="col small table-info p-1">
<Activations MasterLicence="@currRecord"></Activations>
<Activations MasterLicence="@currRecord" DataReset="ResetData" DataUpdated="UpdateData"></Activations>
</div>
}
</div>
+18
View File
@@ -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;
}
/// <summary>
/// formatta testo secondo scadenza:
/// scadenza > 60gg --> verde
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Version>1.1.2111.0815</Version>
<Version>1.1.2111.1310</Version>
<RootNamespace>LiMan.UI</RootNamespace>
<AssemblyName>LiMan.UI</AssemblyName>
</PropertyGroup>
+13 -80
View File
@@ -1,84 +1,17 @@
@page "/Applicazioni"
@using LiMan.UI.Components
@using LiMan.UI.Data
<div class="card">
<div class="card-header table-primary">
<div class="row">
<div class="col-12 col-lg-4">
<div class="d-flex">
<div class="px-2">
<h3>Applicazioni</h3>
</div>
<div class="px-2">
<div class="form-group mb-0">
@*<button id="btnForceCheck" class="btn btn-warning btn-sm" @onclick="() => ForceCheck(30)" title="Analisi Modifiche ultimi 30gg">
<i class="fas fa-sync-alt"></i> Update (30gg) <i class="far fa-folder-open"></i>
</button>*@
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-body py-1">
@if (currRecord != null)
{
@*<FileEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" TagList="@TagList" MacList="@MacList"></FileEditor>*@
}
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th></th>
<th>Applicazione</th>
<th class="text-right">Descrizione</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.Applicativo)">
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record">
<i class="oi oi-pencil"></i>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<b>@record.Applicativo</b>
</td>
<td class="text-right">
<div>@record.Descrizione</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
<div class="card-footer py-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
@inject MessageService AppMService
<ListApplicazioni></ListApplicazioni>
@code {
protected override void OnInitialized()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Elenco Applicazioni";
AppMService.PageIcon = "oi oi-list-rich";
}
}
-146
View File
@@ -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<AnagApplicazioni> ListRecords;
private List<AnagApplicazioni> 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
}
}
+13 -88
View File
@@ -1,92 +1,17 @@
@page "/Installazioni"
@using LiMan.UI.Components
@using LiMan.UI.Data
<div class="card">
<div class="card-header table-primary">
<div class="row">
<div class="col-12 col-lg-4">
<div class="d-flex">
<div class="px-2">
<h3>Installazioni</h3>
</div>
<div class="px-2">
<div class="form-group mb-0">
@*<button id="btnForceCheck" class="btn btn-warning btn-sm" @onclick="() => ForceCheck(30)" title="Analisi Modifiche ultimi 30gg">
<i class="fas fa-sync-alt"></i> Update (30gg) <i class="far fa-folder-open"></i>
</button>*@
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card-body py-1">
@if (currRecord != null)
{
@*<FileEditor currItem="@currRecord" DataReset="ResetData" DataUpdated="UpdateData" TagList="@TagList" MacList="@MacList"></FileEditor>*@
}
@if (ListRecords == null)
{
<LoadingData></LoadingData>
}
else if (totalCount == 0)
{
<div class="alert alert-warning text-center display-4">Nessun record trovato</div>
}
else
{
<div class="row">
<div class="col-12">
<table class="table table-sm table-striped table-responsive-lg">
<thead>
<tr>
<th></th>
<th>Installazione</th>
<th class="text-right">Descrizione</th>
<th class="text-right">Contatto</th>
<th class="text-right">Email</th>
</tr>
</thead>
<tbody>
@foreach (var record in ListRecords)
{
<tr class="@checkSelect(record.Installazione)">
<td class="text-nowrap">
@if (currRecord == null)
{
<button class="btn btn-sm btn-info" @onclick="() => Edit(record)" title="Edit record">
<i class="oi oi-pencil"></i>
</button>
}
else
{
<button class="btn btn-sm btn-secondary disabled">
<i class="oi oi-pencil"></i>
</button>
}
</td>
<td>
<b>@record.Installazione</b>
</td>
<td class="text-right">
<div>@record.Descrizione</div>
</td>
<td class="text-right">
<div>@record.Contatto</div>
</td>
<td class="text-right">
<div>@record.Email</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
}
</div>
<div class="card-footer py-1">
<DataPager PageSize="numRecord" currPage="currPage" numRecordChanged="PagerReloadNum" numPageChanged="PagerReloadPage" totalCount="totalCount" showLoading="isLoading" />
</div>
</div>
@inject MessageService AppMService
<ListInstallazioni></ListInstallazioni>
@code {
protected override void OnInitialized()
{
AppMService.ShowSearch = false;
AppMService.PageName = "Elenco Installazioni/Clienti";
AppMService.PageIcon = "oi oi-list-rich";
}
}
-146
View File
@@ -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<AnagInstallazioni> ListRecords;
private List<AnagInstallazioni> 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
}
}
+1 -30
View File
@@ -5,36 +5,7 @@
<div class="px-2">
<div class="row">
<div class="col-12">
<ul class="nav nav-tabs nav-justified">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#TabLicenze">Licenze</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#TabAnag">Anagrafiche Applicazioni/Installazioni</a>
</li>
</ul>
</div>
<div class="col-12">
<!-- Tab panes -->
<div class="tab-content border">
<div class="tab-pane container-fluid active" id="TabLicenze">
<div class="row">
<div class="col-12 px-0">
<ListLicenze></ListLicenze>
</div>
</div>
</div>
<div class="tab-pane container-fluid" id="TabAnag">
<div class="row small">
<div class="col-5 px-0">
<ListApplicazioni></ListApplicazioni>
</div>
<div class="col-7 px-0">
<ListInstallazioni></ListInstallazioni>
</div>
</div>
</div>
</div>
<ListLicenze></ListLicenze>
</div>
</div>
</div>
+20 -1
View File
@@ -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
}
}
@@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5</EncryptedPassword>
<History>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;</History>
<History>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;</History>
</PropertyGroup>
</Project>
@@ -7,6 +7,6 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAk75miMJLMkCTEelQutKpbwAAAAACAAAAAAADZgAAwAAAABAAAAA7RC2yFYQ+sbph7Gm3hrEMAAAAAASAAACgAAAAEAAAAFhL9j1HkRjMaqEESfncpZcYAAAAIMz57CMDX9ZLAPLwms1/yHQTf/r/v74FFAAAAB6WaNF8er6HZmelU4da+AsQFSC5</EncryptedPassword>
<History>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;</History>
<History>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;</History>
</PropertyGroup>
</Project>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 1.1.2111.0815</h4>
<h4>Versione: 1.1.2111.1310</h4>
<br />
Note di rilascio:
<ul>
+1 -1
View File
@@ -1 +1 @@
1.1.2111.0815
1.1.2111.1310
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>1.1.2111.0815</version>
<version>1.1.2111.1310</version>
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+10 -10
View File
@@ -17,21 +17,21 @@
<span class="fas fa-key pr-1" aria-hidden="true"></span>Gestione Licenze NEXT
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Applicazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Applicazioni
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="Installazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Installazioni/Clienti
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="LiManGLS">
<span class="fas fa-lock pr-1" aria-hidden="true"></span>Licenze Legacy STW
</NavLink>
</li>
@*<li class="nav-item px-3">
<NavLink class="nav-link" href="Applicazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Applicazioni
</NavLink>
</li>*@
@*<li class="nav-item px-3">
<NavLink class="nav-link" href="Installazioni">
<span class="oi oi-list-rich" aria-hidden="true"></span> Elenco Installazioni
</NavLink>
</li>*@
</ul>
</div>
+2 -2
View File
@@ -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