diff --git a/LiMan.DB/Controllers/DbController.cs b/LiMan.DB/Controllers/DbController.cs index a4b41f1..0f344bf 100644 --- a/LiMan.DB/Controllers/DbController.cs +++ b/LiMan.DB/Controllers/DbController.cs @@ -8,7 +8,6 @@ using Microsoft.Extensions.Configuration; using NLog; using System; using System.Collections.Generic; -using System.ComponentModel.Design; using System.Data; using System.IO; using System.Linq; @@ -116,168 +115,6 @@ namespace LiMan.DB.Controllers return dbResult; } - public List AuthUserGetFilt(string userName) - { - List dbResult = new List(); - using (LMDbContext localDbCtx = new LMDbContext(_configuration)) - { - DateTime oggi = DateTime.Today; - dbResult = localDbCtx - .DbSetUsers - .Where(x => x.Username == userName) - .ToList(); - } - return dbResult; - } - - public bool AuthUserUpsert(AuthUserModel newRec) - { - bool answ = false; - using (LMDbContext localDbCtx = new LMDbContext(_configuration)) - { - try - { - var currData = localDbCtx - .DbSetUsers - .Where(x => x.UserID == newRec.UserID) - .FirstOrDefault(); - if (currData != null) - { - currData.Username = newRec.Username; - currData.AD_Domain = newRec.AD_Domain; - currData.AD_User = newRec.AD_User; - // segno aggiornato - localDbCtx.Entry(currData).State = EntityState.Modified; - } - else - { - localDbCtx - .DbSetUsers - .Add(newRec); - } - localDbCtx.SaveChanges(); - answ = true; - } - catch (Exception exc) - { - Log.Error($"Errore in AuthUserUpsert | UserID: {newRec.UserID} | userName: {newRec.Username}{Environment.NewLine}{exc}"); - } - } - return answ; - } - - public List AuthRolesGetAll(string userName) - { - List dbResult = new List(); - using (LMDbContext localDbCtx = new LMDbContext(_configuration)) - { - DateTime oggi = DateTime.Today; - dbResult = localDbCtx - .DbSetRoles - .ToList(); - } - return dbResult; - } - - public bool AuthRoleUpsert(AuthRoleModel newRec) - { - bool answ = false; - using (LMDbContext localDbCtx = new LMDbContext(_configuration)) - { - try - { - var currData = localDbCtx - .DbSetRoles - .Where(x => x.RoleID == newRec.RoleID) - .FirstOrDefault(); - if (currData != null) - { - currData.Descrizione = newRec.Descrizione; - currData.Ruolo = newRec.Ruolo; - // segno aggiornato - localDbCtx.Entry(currData).State = EntityState.Modified; - } - else - { - localDbCtx - .DbSetRoles - .Add(newRec); - } - localDbCtx.SaveChanges(); - answ = true; - } - catch (Exception exc) - { - Log.Error($"Errore in AuthRoleUpsert | RoleID: {newRec.RoleID} | Ruolo: {newRec.Ruolo}{Environment.NewLine}{exc}"); - } - } - return answ; - } - - public List AuthClaimByUserID(int userID) - { - List dbResult = new List(); - using (LMDbContext localDbCtx = new LMDbContext(_configuration)) - { - DateTime oggi = DateTime.Today; - dbResult = localDbCtx - .DbSetClaims - .Where(x => x.UserID == userID) - .ToList(); - } - return dbResult; - } - - public List AuthClaimByUserName(string userName) - { - List dbResult = new List(); - using (LMDbContext localDbCtx = new LMDbContext(_configuration)) - { - DateTime oggi = DateTime.Today; - dbResult = localDbCtx - .DbSetClaims - .Where(x => x.UserNav.Username == userName) - .ToList(); - } - return dbResult; - } - - public bool AuthClaimUpsert(AuthClaimModel newRec) - { - bool answ = false; - using (LMDbContext localDbCtx = new LMDbContext(_configuration)) - { - try - { - var currData = localDbCtx - .DbSetClaims - .Where(x => x.ClaimID == newRec.ClaimID) - .FirstOrDefault(); - if (currData != null) - { - currData.UserID = newRec.UserID; - currData.RoleID = newRec.RoleID; - currData.DtMod = DateTime.Now; - // segno aggiornato - localDbCtx.Entry(currData).State = EntityState.Modified; - } - else - { - localDbCtx - .DbSetClaims - .Add(newRec); - } - localDbCtx.SaveChanges(); - answ = true; - } - catch (Exception exc) - { - Log.Error($"Errore in AuthClaimUpsert | ClaimID: {newRec.ClaimID} | UserID: {newRec.UserID} | RoleID: {newRec.RoleID}{Environment.NewLine}{exc}"); - } - } - return answ; - } - /// /// Elimino le licenze con veto scaduto /// @@ -435,6 +272,168 @@ namespace LiMan.DB.Controllers return fatto; } + public List AuthClaimByUserID(int userID) + { + List dbResult = new List(); + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + DateTime oggi = DateTime.Today; + dbResult = localDbCtx + .DbSetClaims + .Where(x => x.UserID == userID) + .ToList(); + } + return dbResult; + } + + public List AuthClaimByUserName(string userName) + { + List dbResult = new List(); + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + DateTime oggi = DateTime.Today; + dbResult = localDbCtx + .DbSetClaims + .Where(x => x.UserNav.Username == userName) + .ToList(); + } + return dbResult; + } + + public bool AuthClaimUpsert(AuthClaimModel newRec) + { + bool answ = false; + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + try + { + var currData = localDbCtx + .DbSetClaims + .Where(x => x.ClaimID == newRec.ClaimID) + .FirstOrDefault(); + if (currData != null) + { + currData.UserID = newRec.UserID; + currData.RoleID = newRec.RoleID; + currData.DtMod = DateTime.Now; + // segno aggiornato + localDbCtx.Entry(currData).State = EntityState.Modified; + } + else + { + localDbCtx + .DbSetClaims + .Add(newRec); + } + localDbCtx.SaveChanges(); + answ = true; + } + catch (Exception exc) + { + Log.Error($"Errore in AuthClaimUpsert | ClaimID: {newRec.ClaimID} | UserID: {newRec.UserID} | RoleID: {newRec.RoleID}{Environment.NewLine}{exc}"); + } + } + return answ; + } + + public List AuthRolesGetAll() + { + List dbResult = new List(); + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + DateTime oggi = DateTime.Today; + dbResult = localDbCtx + .DbSetRoles + .ToList(); + } + return dbResult; + } + + public bool AuthRoleUpsert(AuthRoleModel newRec) + { + bool answ = false; + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + try + { + var currData = localDbCtx + .DbSetRoles + .Where(x => x.RoleID == newRec.RoleID) + .FirstOrDefault(); + if (currData != null) + { + currData.Descrizione = newRec.Descrizione; + currData.Ruolo = newRec.Ruolo; + // segno aggiornato + localDbCtx.Entry(currData).State = EntityState.Modified; + } + else + { + localDbCtx + .DbSetRoles + .Add(newRec); + } + localDbCtx.SaveChanges(); + answ = true; + } + catch (Exception exc) + { + Log.Error($"Errore in AuthRoleUpsert | RoleID: {newRec.RoleID} | Ruolo: {newRec.Ruolo}{Environment.NewLine}{exc}"); + } + } + return answ; + } + + public List AuthUserGetFilt(string userName) + { + List dbResult = new List(); + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + DateTime oggi = DateTime.Today; + dbResult = localDbCtx + .DbSetUsers + .Where(x => x.Username == userName) + .ToList(); + } + return dbResult; + } + + public bool AuthUserUpsert(AuthUserModel newRec) + { + bool answ = false; + using (LMDbContext localDbCtx = new LMDbContext(_configuration)) + { + try + { + var currData = localDbCtx + .DbSetUsers + .Where(x => x.UserID == newRec.UserID) + .FirstOrDefault(); + if (currData != null) + { + currData.Username = newRec.Username; + currData.AD_Domain = newRec.AD_Domain; + currData.AD_User = newRec.AD_User; + // segno aggiornato + localDbCtx.Entry(currData).State = EntityState.Modified; + } + else + { + localDbCtx + .DbSetUsers + .Add(newRec); + } + localDbCtx.SaveChanges(); + answ = true; + } + catch (Exception exc) + { + Log.Error($"Errore in AuthUserUpsert | UserID: {newRec.UserID} | userName: {newRec.Username}{Environment.NewLine}{exc}"); + } + } + return answ; + } + public bool DbForceMigrate() { bool answ = false; diff --git a/LiMan.Transfer/Resources/ChangeLog.html b/LiMan.Transfer/Resources/ChangeLog.html index 6177c3f..ee39104 100644 --- a/LiMan.Transfer/Resources/ChangeLog.html +++ b/LiMan.Transfer/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

Versione: 1.1.2407.1315

+

Versione: 1.1.2407.1316


Note di rilascio:
    diff --git a/LiMan.Transfer/Resources/VersNum.txt b/LiMan.Transfer/Resources/VersNum.txt index a5ae106..937a42a 100644 --- a/LiMan.Transfer/Resources/VersNum.txt +++ b/LiMan.Transfer/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2407.1315 +1.1.2407.1316 diff --git a/LiMan.Transfer/Resources/manifest.xml b/LiMan.Transfer/Resources/manifest.xml index 2643761..5a3fc44 100644 --- a/LiMan.Transfer/Resources/manifest.xml +++ b/LiMan.Transfer/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2407.1315 + 1.1.2407.1316 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.Transfer.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false diff --git a/LiMan.UI/Data/LiManDataService.cs b/LiMan.UI/Data/LiManDataService.cs index f1c6578..1df7a2b 100644 --- a/LiMan.UI/Data/LiManDataService.cs +++ b/LiMan.UI/Data/LiManDataService.cs @@ -1,18 +1,22 @@ using Core; using Core.DTO; +using Liman.CadCam.DbModel; using LiMan.DB.Controllers; using LiMan.DB.DBModels; using Microsoft.AspNetCore.Identity.UI.Services; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Newtonsoft.Json; using NLog; +using StackExchange.Redis; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Runtime; using System.Text; using System.Threading.Tasks; using static Core.Enum; @@ -51,12 +55,76 @@ namespace LiMan.UI.Data #endregion Public Fields + /// + /// Oggetto per connessione a REDIS + /// + protected IConnectionMultiplexer redisConn = null!; + + /// + /// Oggetto DB redis da impiegare x chiamate R/W + /// + protected IDatabase redisDb = null!; + + protected Random rnd = new Random(); + protected static JsonSerializerSettings? JSSettings; + + /// + /// Durata cache lunga IN SECONDI + /// + protected int cacheTtlLong = 60 * 5; + + /// + /// Durata cache breve IN SECONDI + /// + protected int cacheTtlShort = 60 * 1; + + /// + /// Durata cache breve (1 min circa + perturbazione percentuale +/-10%) + /// + protected TimeSpan FastCache + { + get => TimeSpan.FromSeconds(cacheTtlShort * rnd.Next(900, 1100) / 1000); + } + + /// + /// Durata cache lunga (+ perturbazione percentuale +/-10%) + /// + protected TimeSpan LongCache + { + get => TimeSpan.FromSeconds(cacheTtlLong * rnd.Next(900, 1100) / 1000); + } + + /// + /// Durata cache MOLTO breve (10 sec circa + perturbazione percentuale +/-10%) + /// + protected TimeSpan UltraFastCache + { + get => TimeSpan.FromSeconds(cacheTtlShort / 6 * rnd.Next(900, 1100) / 1000); + } + + /// + /// Durata cache MOLTO lunga (+ perturbazione percentuale +/-10%) + /// + protected TimeSpan UltraLongCache + { + get => TimeSpan.FromSeconds(cacheTtlLong * 10 * rnd.Next(900, 1100) / 1000); + } + #region Public Constructors - public LiManDataService(IConfiguration configuration, ILogger logger, IMemoryCache memoryCache, IDistributedCache distributedCache, IEmailSender emailSender) + public LiManDataService(IConfiguration configuration, ILogger logger, IMemoryCache memoryCache, IDistributedCache distributedCache, IConnectionMultiplexer redisConnMult, IEmailSender emailSender) { _logger = logger; _configuration = configuration; + // Conf cache + redisConn = redisConnMult; + redisDb = this.redisConn.GetDatabase(); + + // json serializer... FIX errore loop circolare https://www.ryadel.com/en/jsonserializationexception-self-referencing-loop-detected-error-fix-entity-framework-asp-net-core/ + JSSettings = new JsonSerializerSettings() + { + ReferenceLoopHandling = ReferenceLoopHandling.Ignore + }; _emailSender = emailSender; // conf cache this.memoryCache = memoryCache; @@ -168,16 +236,16 @@ namespace LiMan.UI.Data return await Task.FromResult(done); } - public async Task> ApplicazioniNextGetAll() + public async Task> ApplicazioniNextGetAll() { - List dbResult = new List(); + List dbResult = new List(); string cacheKey = mHash("Next:Applicazioni"); string rawData; var redisDataList = await distributedCache.GetAsync(cacheKey); if (redisDataList != null) { rawData = Encoding.UTF8.GetString(redisDataList); - dbResult = JsonConvert.DeserializeObject>(rawData); + dbResult = JsonConvert.DeserializeObject>(rawData); } else { @@ -194,7 +262,7 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } - public async Task ApplicazioniNextUpdate(DB.DBModels.ApplicativoModel currItem) + public async Task ApplicazioniNextUpdate(ApplicativoModel currItem) { bool done = false; try @@ -226,10 +294,10 @@ namespace LiMan.UI.Data /// /// /// - public async Task> AttivazioniGetByLic(int IdxLic) + public async Task> AttivazioniGetByLic(int IdxLic) { Stopwatch stopWatch = new Stopwatch(); - List dbResult = new List(); + List dbResult = new List(); stopWatch.Start(); dbResult = dbControllerNext.AttivazioniGetByLic(IdxLic); stopWatch.Stop(); @@ -238,6 +306,308 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } + /// + /// Recupera elenco Claim dato UserID + /// + /// + /// + public async Task> AuthClaimByUserID(int userID) + { + string source = "DB"; + List? dbResult = new List(); + try + { + string currKey = $"{Const.rKeyConfig}:Auth:Claims:UID:{userID}"; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string? rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } + } + else + { + dbResult = dbControllerNext.AuthClaimByUserID(userID); + rawData = JsonConvert.SerializeObject(dbResult, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, LongCache); + // per evitare loopback uso deserialize... + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult != null) + { + dbResult = tempResult; + } + } + if (dbResult == null) + { + dbResult = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"AuthClaimByUserID | {source} in: {ts.TotalMilliseconds} ms"); + } + catch (Exception exc) + { + Log.Error($"Error during AuthClaimByUserID:{Environment.NewLine}{exc}"); + } + //return await Task.FromResult(dbResult); + return dbResult; + } + + /// + /// Recupera elenco Claim dato UserName + /// + /// + /// + public async Task> AuthClaimByUserName(string userName) + { + string source = "DB"; + List? dbResult = new List(); + try + { + string currKey = $"{Const.rKeyConfig}:Auth:Claims:UName:{userName}"; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string? rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } + } + else + { + dbResult = dbControllerNext.AuthClaimByUserName(userName); + rawData = JsonConvert.SerializeObject(dbResult, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, LongCache); + // per evitare loopback uso deserialize... + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult != null) + { + dbResult = tempResult; + } + } + if (dbResult == null) + { + dbResult = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"AuthClaimByUserName | {source} in: {ts.TotalMilliseconds} ms"); + } + catch (Exception exc) + { + Log.Error($"Error during AuthClaimByUserName:{Environment.NewLine}{exc}"); + } + //return await Task.FromResult(dbResult); + return dbResult; + } + + /// + /// Refresh globale cache redis + /// + /// + public async Task FlushRedisCache() + { + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + await Task.Delay(1); + RedisValue pattern = new RedisValue($"{Const.rKeyConfig}:*"); + bool answ = await ExecFlushRedisPattern(pattern); + stopWatch.Stop(); + Log.Debug($"FlushRedisCache in {stopWatch.Elapsed.TotalMilliseconds} ms"); + return answ; + } + + /// + /// Esegue flush memoria redis dato pattern + /// + /// + /// + protected async Task ExecFlushRedisPattern(RedisValue pattern) + { + bool answ = false; + var listEndpoints = redisConn.GetEndPoints(); + foreach (var endPoint in listEndpoints) + { + //var server = redisConnAdmin.GetServer(listEndpoints[0]); + var server = redisConn.GetServer(endPoint); + if (server != null) + { + var keyList = server.Keys(redisDb.Database, pattern); + foreach (var item in keyList) + { + await redisDb.KeyDeleteAsync(item); + } + answ = true; + } + } + + return answ; + } + + /// + /// Upsesrt del Claim di auth utente + /// + /// + /// + public async Task AuthClaimUpsert(AuthClaimModel newRec) + { + bool fatto = dbControllerNext.AuthClaimUpsert(newRec); + await FlushRedisCache(); + return fatto; + } + + /// + /// Recupera elenco Roles (completo) + /// + /// + public async Task> AuthRolesGetAll() + { + string source = "DB"; + List? dbResult = new List(); + try + { + string currKey = $"{Const.rKeyConfig}:Auth:Roles"; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string? rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } + } + else + { + dbResult = dbControllerNext.AuthRolesGetAll(); + rawData = JsonConvert.SerializeObject(dbResult, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, LongCache); + // per evitare loopback uso deserialize... + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult != null) + { + dbResult = tempResult; + } + } + if (dbResult == null) + { + dbResult = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"AuthRolesGetAll | {source} in: {ts.TotalMilliseconds} ms"); + } + catch (Exception exc) + { + Log.Error($"Error during AuthRolesGetAll:{Environment.NewLine}{exc}"); + } + //return await Task.FromResult(dbResult); + return dbResult; + } + + /// + /// Upsert del ROLE + /// + /// + /// + public async Task AuthRoleUpsert(AuthRoleModel newRec) + { + bool fatto = dbControllerNext.AuthRoleUpsert(newRec); + await FlushRedisCache(); + return fatto; + } + + /// + /// Recupera elenco Utenti UserName (idealmente 1...) + /// + /// + /// + public async Task> AuthUserGetFilt(string userName) + { + string source = "DB"; + List? dbResult = new List(); + try + { + string currKey = $"{Const.rKeyConfig}:Auth:Users:{userName}"; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string? rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } + } + else + { + dbResult = dbControllerNext.AuthUserGetFilt(userName); + rawData = JsonConvert.SerializeObject(dbResult, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, LongCache); + // per evitare loopback uso deserialize... + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult != null) + { + dbResult = tempResult; + } + } + if (dbResult == null) + { + dbResult = new List(); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Debug($"AuthUserGetFilt | {source} in: {ts.TotalMilliseconds} ms"); + } + catch (Exception exc) + { + Log.Error($"Error during AuthUserGetFilt:{Environment.NewLine}{exc}"); + } + //return await Task.FromResult(dbResult); + return dbResult; + } + + /// + /// Upsert AuthUser + /// + /// + /// + public async Task AuthUserUpsert(AuthUserModel newRec) + { + bool fatto = dbControllerNext.AuthUserUpsert(newRec); + await FlushRedisCache(); + return fatto; + } + public async Task DbForceMigrate() { return await Task.FromResult(dbControllerGLS.DbForceMigrate()); @@ -307,16 +677,16 @@ namespace LiMan.UI.Data return await Task.FromResult(done); } - public async Task> InstallazioniNextGetAll() + public async Task> InstallazioniNextGetAll() { - List dbResult = new List(); + List dbResult = new List(); string cacheKey = mHash("Next:Installazioni"); string rawData; var redisDataList = await distributedCache.GetAsync(cacheKey); if (redisDataList != null) { rawData = Encoding.UTF8.GetString(redisDataList); - dbResult = JsonConvert.DeserializeObject>(rawData); + dbResult = JsonConvert.DeserializeObject>(rawData); } else { @@ -333,7 +703,7 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } - public async Task InstallazioniNextUpdate(DB.DBModels.InstallazioneModel currItem) + public async Task InstallazioniNextUpdate(InstallazioneModel currItem) { bool done = false; try @@ -376,7 +746,7 @@ namespace LiMan.UI.Data var currLicenza = dbControllerNext.GetLicenza(IdxLicNext); // step 1: converto licenza, faccio upsert - var logLicNext = new DB.DBModels.LogLicenzaModel() + var logLicNext = new LogLicenzaModel() { CodApp = currItem.ApplicativoNavigation.Applicativo, CodInst = currItem.InstallazioneNavigation.Installazione, @@ -408,7 +778,7 @@ namespace LiMan.UI.Data { bool done = false; // step 1: controllo applicazione esistente - DB.DBModels.ApplicativoModel appNext = new DB.DBModels.ApplicativoModel() + ApplicativoModel appNext = new ApplicativoModel() { CodApp = currItem.ApplicativoNavigation.Applicativo, Descrizione = currItem.ApplicativoNavigation.Descrizione @@ -416,7 +786,7 @@ namespace LiMan.UI.Data bool step1 = dbControllerNext.UpsertApplicazione(appNext); // step 2: controllo installazione esistente - var instNext = new DB.DBModels.InstallazioneModel() + var instNext = new InstallazioneModel() { Cliente = currItem.InstallazioneNavigation.Installazione, CodInst = currItem.InstallazioneNavigation.Installazione, @@ -427,7 +797,7 @@ namespace LiMan.UI.Data bool step2 = dbControllerNext.UpsertInstallazione(instNext); // step 3: converto licenza, faccio upsert - var licNext = new DB.DBModels.LicenzaModel() + var licNext = new LicenzaModel() { CodApp = currItem.ApplicativoNavigation.Applicativo, CodInst = currItem.InstallazioneNavigation.Installazione, @@ -511,16 +881,16 @@ namespace LiMan.UI.Data return await Task.FromResult(done); } - public async Task> LicenzeNextGetAll() + public async Task> LicenzeNextGetAll() { - List dbResult = new List(); + List dbResult = new List(); string cacheKey = mHash("Next:Licenze"); string rawData; var redisDataList = await distributedCache.GetAsync(cacheKey); if (redisDataList != null) { rawData = Encoding.UTF8.GetString(redisDataList); - dbResult = JsonConvert.DeserializeObject>(rawData); + dbResult = JsonConvert.DeserializeObject>(rawData); } else { @@ -542,10 +912,10 @@ namespace LiMan.UI.Data /// /// /// - public async Task> LicenzeNextGetFilt(SelectNext CurrFilter) + public async Task> LicenzeNextGetFilt(SelectNext CurrFilter) { Stopwatch stopWatch = new Stopwatch(); - List dbResult = new List(); + List dbResult = new List(); stopWatch.Start(); dbResult = dbControllerNext.GetLicenzeFilt(CurrFilter.OnlyActive, CurrFilter.ApplicazioneSel, CurrFilter.InstallazioneSel); stopWatch.Stop(); @@ -554,7 +924,7 @@ namespace LiMan.UI.Data return await Task.FromResult(dbResult); } - public async Task LicenzeNextUpdate(DB.DBModels.LicenzaModel currItem) + public async Task LicenzeNextUpdate(LicenzaModel currItem) { bool done = false; @@ -590,7 +960,6 @@ namespace LiMan.UI.Data return answ; } - /// /// Statistiche del LOG chiamate all'API dato filtro /// diff --git a/LiMan.UI/LiMan.UI.csproj b/LiMan.UI/LiMan.UI.csproj index c02d1f5..fe6928e 100644 --- a/LiMan.UI/LiMan.UI.csproj +++ b/LiMan.UI/LiMan.UI.csproj @@ -2,7 +2,7 @@ net6.0 - 1.1.2407.1315 + 1.1.2407.1316 LiMan.UI LiMan.UI diff --git a/LiMan.UI/Resources/ChangeLog.html b/LiMan.UI/Resources/ChangeLog.html index 1b408db..a62ca2e 100644 --- a/LiMan.UI/Resources/ChangeLog.html +++ b/LiMan.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ License Manager -

    Versione: 1.1.2407.1315

    +

    Versione: 1.1.2407.1316


    Note di rilascio:
    • diff --git a/LiMan.UI/Resources/VersNum.txt b/LiMan.UI/Resources/VersNum.txt index a5ae106..937a42a 100644 --- a/LiMan.UI/Resources/VersNum.txt +++ b/LiMan.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2407.1315 +1.1.2407.1316 diff --git a/LiMan.UI/Resources/manifest.xml b/LiMan.UI/Resources/manifest.xml index c3a9771..dd35ec5 100644 --- a/LiMan.UI/Resources/manifest.xml +++ b/LiMan.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2407.1315 + 1.1.2407.1316 https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html false