diff --git a/Core/Enum.cs b/Core/Enum.cs index 687d62f..be8d03c 100644 --- a/Core/Enum.cs +++ b/Core/Enum.cs @@ -69,6 +69,7 @@ namespace Core public static Dictionary AppType = new Dictionary{ { "", "---Selezionare---" }, { "Cli", "Cli (Console)" }, + { "EgwACC", "EgwAppCtrCenter" }, { "LicenceApp", "LicenceApp" }, { "Machine", "Machine" }, { "WebApp", "WebApp" }, diff --git a/LiMan.Api/Controllers/AppTaskController.cs b/LiMan.Api/Controllers/AppTaskController.cs index 6a90a09..d239261 100644 --- a/LiMan.Api/Controllers/AppTaskController.cs +++ b/LiMan.Api/Controllers/AppTaskController.cs @@ -248,7 +248,7 @@ namespace LiMan.APi.Controllers { bool extractDone = false; // recupero applicativi connessi - var listLic = await dataService.ApplicativiSearch(CodInst, CodApp, false); + var listLic = await dataService.AppDtoSearch(CodInst, CodApp, false); var currLic = listLic.Where(x => x.IsActive).FirstOrDefault(); // procedo SOLO SE ho una licenza attiva x questo cliente if (currLic != null) diff --git a/LiMan.Api/Controllers/ApplicazioneController.cs b/LiMan.Api/Controllers/ApplicazioneController.cs index 7d21cd0..4e96046 100644 --- a/LiMan.Api/Controllers/ApplicazioneController.cs +++ b/LiMan.Api/Controllers/ApplicazioneController.cs @@ -60,7 +60,7 @@ namespace LiMan.APi.Controllers [HttpGet("{id}")] public async Task> Get(string id, string CodApp) { - var result = await dataService.ApplicativiSearch(id, CodApp, true); + var result = await dataService.AppDtoSearch(id, CodApp, true); await dataService.recordCall(id, CodApp, $"GET:api/applicazione"); return result; } diff --git a/LiMan.Api/Controllers/FilesaveController.cs b/LiMan.Api/Controllers/FilesaveController.cs index 86ed5f0..fdd8834 100644 --- a/LiMan.Api/Controllers/FilesaveController.cs +++ b/LiMan.Api/Controllers/FilesaveController.cs @@ -314,7 +314,7 @@ namespace LiMan.APi.Controllers { bool extractDone = false; // recupero applicativi connessi - var listLic = await dataService.ApplicativiSearch(CodInst, CodApp, false); + var listLic = await dataService.AppDtoSearch(CodInst, CodApp, false); var currLic = listLic.Where(x => x.IsActive).FirstOrDefault(); // procedo SOLO SE ho una licenza attiva x questo cliente if (currLic != null) diff --git a/LiMan.Api/Controllers/ReleaseController.cs b/LiMan.Api/Controllers/ReleaseController.cs index f385656..c0e0ef1 100644 --- a/LiMan.Api/Controllers/ReleaseController.cs +++ b/LiMan.Api/Controllers/ReleaseController.cs @@ -215,7 +215,7 @@ namespace LiMan.APi.Controllers if (licUploader != null && licUploader.Count > 0) { // in primis cerco app... - var appList = await dataService.ApplicativiGetAll(); + var appList = await dataService.ApplicNextGetAll(true); ApplicativoModel recApp = new ApplicativoModel(); if (appList != null) { @@ -231,7 +231,7 @@ namespace LiMan.APi.Controllers TplConnString = "", Tipo = CurrReq.Tipo }; - await dataService.ApplicativoUpsert(recApp); + await dataService.ApplicNextUpdate(recApp); } //converto in una release... ReleaseModel newRec = new ReleaseModel() diff --git a/LiMan.Api/Data/ApiDataService.cs b/LiMan.Api/Data/ApiDataService.cs index bc2ce79..97a11e1 100644 --- a/LiMan.Api/Data/ApiDataService.cs +++ b/LiMan.Api/Data/ApiDataService.cs @@ -81,59 +81,6 @@ namespace LiMan.APi.Data #region Public Methods - /// Elenco Applicativi (all) - public async Task> ApplicativiGetAll() - { - List dbResult = new List(); - Stopwatch stopWatch = new Stopwatch(); - stopWatch.Start(); - dbResult = dbController.GetApplicazioni(); - stopWatch.Stop(); - TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per ApplicativiGetAll: {ts.TotalMilliseconds} ms"); - - return await Task.FromResult(dbResult); - } - - /// - /// Elenco licenze dato cliente - /// - /// Codice Installaizone /Cliente - /// Codice Applicazione - /// Indica se nascondere i dati sensibili - /// - public async Task> ApplicativiSearch(string CodInst, string CodApp, bool HideData) - { - List dbResult = new List(); - Stopwatch stopWatch = new Stopwatch(); - stopWatch.Start(); - dbResult = dbController.GetApplicativiFilt(true, CodApp, CodInst, HideData); - stopWatch.Stop(); - TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB per ApplicativiByCliente: {ts.TotalMilliseconds} ms"); - - return await Task.FromResult(dbResult); - } - - /// - /// Aggiornameto/Inserimento record applicativo - /// - /// record Release - /// - public async Task ApplicativoUpsert(ApplicativoModel newRec) - { - await Task.Delay(1); - bool fatto = false; - Stopwatch stopWatch = new Stopwatch(); - stopWatch.Start(); - // inserisco - fatto = dbController.ApplicativoUpsert(newRec); - stopWatch.Stop(); - TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuato upsert su DB per ApplicativoUpsert | {newRec.CodApp} | {ts.TotalMilliseconds} ms"); - return fatto; - } - /// /// Elenco licenze dato cliente /// diff --git a/LiMan.DB/Controllers/DbController.cs b/LiMan.DB/Controllers/DbController.cs index e9d3e89..5d67dd8 100644 --- a/LiMan.DB/Controllers/DbController.cs +++ b/LiMan.DB/Controllers/DbController.cs @@ -34,6 +34,7 @@ namespace LiMan.DB.Controllers #region Public Methods +#if false /// /// Upsert record applicativo /// @@ -73,7 +74,8 @@ namespace LiMan.DB.Controllers } } return fatto; - } + } +#endif /// /// Verifica se una applcazione abbia record correlati... @@ -114,7 +116,7 @@ namespace LiMan.DB.Controllers } catch (Exception exc) { - Log.Error($"Eccezione in ApplicazioniHasChild:{Environment.NewLine}{exc}"); + Log.Error($"Eccezione in ApplicHasChild:{Environment.NewLine}{exc}"); } } return answ; @@ -147,7 +149,7 @@ namespace LiMan.DB.Controllers } catch (Exception exc) { - Log.Error($"Eccezione in ApplicazioniNextDelete:{Environment.NewLine}{exc}"); + Log.Error($"Eccezione in ApplicNextDelete:{Environment.NewLine}{exc}"); } } return done; @@ -183,7 +185,7 @@ namespace LiMan.DB.Controllers } catch (Exception exc) { - Log.Error($"Eccezione in ApplicazioniNextUpdate:{Environment.NewLine}{exc}"); + Log.Error($"Eccezione in ApplicNextUpdate:{Environment.NewLine}{exc}"); } } return done; diff --git a/LiMan.DB/Services/CommonDataServices.cs b/LiMan.DB/Services/CommonDataServices.cs index d4b4414..5271a0f 100644 --- a/LiMan.DB/Services/CommonDataServices.cs +++ b/LiMan.DB/Services/CommonDataServices.cs @@ -92,7 +92,27 @@ namespace LiMan.DB.Services #region Public Methods - public async Task ApplicazioniHasChild(string CodApp) + /// + /// Elenco licenze dato cliente + /// + /// Codice Installaizone /Cliente + /// Codice Applicazione + /// Indica se nascondere i dati sensibili + /// + public async Task> AppDtoSearch(string CodInst, string CodApp, bool HideData) + { + List dbResult = new List(); + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + dbResult = dbController.GetApplicativiFilt(true, CodApp, CodInst, HideData); + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Trace($"Effettuata lettura da DB per ApplicativiByCliente: {ts.TotalMilliseconds} ms"); + + return await Task.FromResult(dbResult); + } + + public async Task ApplicHasChild(string CodApp) { string source = "DB"; bool dbResult = false; @@ -114,11 +134,11 @@ namespace LiMan.DB.Services redisHashKeySet(currKey, CodApp, rawData, UltraLongCache.Minutes); } sw.Stop(); - Log.Debug($"ApplicazioniHasChild | {source} in: {sw.Elapsed.TotalMilliseconds:N2} ms"); + Log.Debug($"ApplicHasChild | {source} in: {sw.Elapsed.TotalMilliseconds:N2} ms"); } catch (Exception exc) { - Log.Error($"Error during ApplicazioniHasChild:{Environment.NewLine}{exc}"); + Log.Error($"Error during ApplicHasChild:{Environment.NewLine}{exc}"); } await Task.Delay(0); return dbResult; @@ -129,7 +149,7 @@ namespace LiMan.DB.Services /// /// /// - public async Task ApplicazioniNextDelete(ApplicativoModel currItem) + public async Task ApplicNextDelete(ApplicativoModel currItem) { bool done = false; try @@ -144,12 +164,12 @@ namespace LiMan.DB.Services } catch (Exception exc) { - Log.Error($"Eccezione in ApplicazioniNextDelete:{Environment.NewLine}{exc}"); + Log.Error($"Eccezione in ApplicNextDelete:{Environment.NewLine}{exc}"); } return done; } - public async Task> ApplicazioniNextGetAll() + public async Task> ApplicNextGetAll(bool forceDb) { string source = "DB"; List dbResult = new List(); @@ -159,7 +179,7 @@ namespace LiMan.DB.Services Stopwatch sw = new Stopwatch(); sw.Start(); string? rawData = await redisDb.StringGetAsync(currKey); - if (!string.IsNullOrEmpty(rawData)) + if (!string.IsNullOrEmpty(rawData) && !forceDb) { source = "REDIS"; var tempResult = JsonConvert.DeserializeObject>(rawData); @@ -183,16 +203,16 @@ namespace LiMan.DB.Services dbResult = new List(); } sw.Stop(); - Log.Debug($"ApplicazioniNextGetAll | {source} in: {sw.Elapsed.TotalMilliseconds:N2} ms"); + Log.Debug($"ApplicNextGetAll | {source} in: {sw.Elapsed.TotalMilliseconds:N2} ms"); } catch (Exception exc) { - Log.Error($"Error during ApplicazioniNextGetAll:{Environment.NewLine}{exc}"); + Log.Error($"Error during ApplicNextGetAll:{Environment.NewLine}{exc}"); } return dbResult; } - public async Task ApplicazioniNextUpdate(ApplicativoModel currItem) + public async Task ApplicNextUpdate(ApplicativoModel currItem) { bool done = false; try @@ -202,7 +222,7 @@ namespace LiMan.DB.Services } catch (Exception exc) { - Log.Error($"Eccezione in ApplicazioniNextUpdate:{Environment.NewLine}{exc}"); + Log.Error($"Eccezione in ApplicNextUpdate:{Environment.NewLine}{exc}"); } return done; } @@ -1457,12 +1477,12 @@ namespace LiMan.DB.Services /// public bool TaskReqReset(string CodImp) { - RedisKey currKey = (RedisKey)$"{rKeyTaskReq}:{CodImp}"; - bool answ = redisHashDictDelete(currKey); + bool okReq = redisHashDictDelete((RedisKey)$"{rKeyTaskReq}:{CodImp}"); + bool okRun = redisHashDictDelete((RedisKey)$"{rKeyTaskRun}:{CodImp}"); redisHashKeyDelete((RedisKey)$"{rKeyTaskReq}List", CodImp); redisHashKeyDelete((RedisKey)$"{rKeyTaskRun}List", CodImp); redisHashKeyDelete((RedisKey)$"{rKeyTaskDone}List", CodImp); - return answ; + return okReq && okRun; } /// diff --git a/LiMan.UI/Components/EditApplicazioni.razor.cs b/LiMan.UI/Components/EditApplicazioni.razor.cs index 7143cb1..ad4b96b 100644 --- a/LiMan.UI/Components/EditApplicazioni.razor.cs +++ b/LiMan.UI/Components/EditApplicazioni.razor.cs @@ -109,7 +109,7 @@ namespace LiMan.UI.Components { if (_currItem != null) { - await DataService.ApplicazioniNextUpdate(_currItem); + await DataService.ApplicNextUpdate(_currItem); await DataUpdated.InvokeAsync(0); } else diff --git a/LiMan.UI/Components/EditLicenze.razor.cs b/LiMan.UI/Components/EditLicenze.razor.cs index 47330d1..2db15de 100644 --- a/LiMan.UI/Components/EditLicenze.razor.cs +++ b/LiMan.UI/Components/EditLicenze.razor.cs @@ -72,7 +72,7 @@ namespace LiMan.UI.Components _currItem = value; var pUpd = Task.Run(async () => { - ListApp = await DataService.ApplicazioniNextGetAll(); + ListApp = await DataService.ApplicNextGetAll(false); ListInstall = await DataService.InstallazioniNextGetAll(); }); pUpd.Wait(); diff --git a/LiMan.UI/Components/ListAppShort.razor.cs b/LiMan.UI/Components/ListAppShort.razor.cs index f2b524f..c2d528c 100644 --- a/LiMan.UI/Components/ListAppShort.razor.cs +++ b/LiMan.UI/Components/ListAppShort.razor.cs @@ -49,6 +49,7 @@ namespace LiMan.UI.Components protected override void OnParametersSet() { + currPage = 1; ReloadData(); } diff --git a/LiMan.UI/Components/ListApplicazioni.razor.cs b/LiMan.UI/Components/ListApplicazioni.razor.cs index f722fb1..111b2e3 100644 --- a/LiMan.UI/Components/ListApplicazioni.razor.cs +++ b/LiMan.UI/Components/ListApplicazioni.razor.cs @@ -117,7 +117,7 @@ namespace LiMan.UI.Components if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler eliminare il record? Se ci sono record correlati questo non sarĂ  comunque possibile")) return; - await DataService.ApplicazioniNextDelete(rec2del); + await DataService.ApplicNextDelete(rec2del); await ReloadAllData(); } @@ -140,7 +140,7 @@ namespace LiMan.UI.Components { var pUpd = Task.Run(async () => { - answ = await DataService.ApplicazioniHasChild(currRec.CodApp); + answ = await DataService.ApplicHasChild(currRec.CodApp); }); pUpd.Wait(); } @@ -290,7 +290,7 @@ namespace LiMan.UI.Components isLoading = true; //SearchRecords = null; - SearchRecords = await DataService.ApplicazioniNextGetAll(); + SearchRecords = await DataService.ApplicNextGetAll(false); if (!string.IsNullOrEmpty(appTipoSel)) { SearchRecords = SearchRecords.Where(x => x.Tipo == appTipoSel).ToList(); diff --git a/LiMan.UI/Components/ListInfoShort.razor.cs b/LiMan.UI/Components/ListInfoShort.razor.cs index 40cd725..6c4e4cd 100644 --- a/LiMan.UI/Components/ListInfoShort.razor.cs +++ b/LiMan.UI/Components/ListInfoShort.razor.cs @@ -46,6 +46,7 @@ namespace LiMan.UI.Components protected override void OnParametersSet() { + currPage = 1; ReloadData(); } diff --git a/LiMan.UI/Components/ListLicenze.razor.cs b/LiMan.UI/Components/ListLicenze.razor.cs index 2037c18..0d582b8 100644 --- a/LiMan.UI/Components/ListLicenze.razor.cs +++ b/LiMan.UI/Components/ListLicenze.razor.cs @@ -388,7 +388,7 @@ namespace LiMan.UI.Components isLoading = true; ListRecords = null; // se ho un tipoApp filtrato --> filtro applicazioni - ListApp = await DataService.ApplicazioniNextGetAll(); + ListApp = await DataService.ApplicNextGetAll(false); if (!string.IsNullOrEmpty(AppTipoSel)) { ListApp = ListApp.Where(x => x.Tipo == AppTipoSel || string.IsNullOrEmpty(x.Tipo)).ToList(); diff --git a/LiMan.UI/Components/TargetSetup.razor b/LiMan.UI/Components/TargetSetup.razor index 5570667..3b9904f 100644 --- a/LiMan.UI/Components/TargetSetup.razor +++ b/LiMan.UI/Components/TargetSetup.razor @@ -57,7 +57,8 @@ App Type - Path + Path + Search Pattern Enabled Update @@ -101,6 +102,9 @@ + + +
@@ -108,7 +112,7 @@
- @if (item.ApplicationType == "WinApp") + @if (item.ApplicationType == "WinApp" || item.ApplicationType == "EgwACC") { } diff --git a/LiMan.UI/Components/Tickets.razor.cs b/LiMan.UI/Components/Tickets.razor.cs index e7a0c60..b69fd3b 100644 --- a/LiMan.UI/Components/Tickets.razor.cs +++ b/LiMan.UI/Components/Tickets.razor.cs @@ -302,20 +302,6 @@ namespace LiMan.UI.Components #region Private Methods - //[Parameter] - //public LicenzaModel MasterLicence - //{ - // get - // { - // return _masterLic; - // } - // set - // { - // _masterLic = value; - // var pUpd = Task.Run(async () => await ReloadAllData()); - // pUpd.Wait(); - // } - //} private async Task FullReload() { await DataService.FlushRedisCache(); @@ -328,7 +314,7 @@ namespace LiMan.UI.Components idxTicketSel = 0; await Task.Delay(1); showTickets = false; - ListApp = await DataService.ApplicazioniNextGetAll(); + ListApp = await DataService.ApplicNextGetAll(false); ListInstall = await DataService.InstallazioniNextGetAll(); //bool StatoRichiesta = true; //SearchRecords = await LMDService.LicenzeNextGetFilt(AppMServ.DetailDBFilter);