diff --git a/MP.AppAuth/AppAuthContext.cs b/MP.AppAuth/AppAuthContext.cs index 35fedc43..7a770a8f 100644 --- a/MP.AppAuth/AppAuthContext.cs +++ b/MP.AppAuth/AppAuthContext.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Options; using MP.AppAuth.Models; using NLog; using System; @@ -23,9 +24,23 @@ namespace MP.AppAuth { } + private DbContextOptions _options; public AppAuthContext(IConfiguration configuration) { _configuration = configuration; + string connStr = _configuration.GetConnectionString("MP.Land.Auth"); + if (string.IsNullOrEmpty(connStr)) + { + connStr = _configuration.GetConnectionString("MP.Land"); + } + if (string.IsNullOrEmpty(connStr)) + { + connStr = _configuration.GetConnectionString("MP.Data"); + } + _options = new DbContextOptionsBuilder() + .UseSqlServer(connStr) + .Options; + try { // se non ci fosse... crea o migra! @@ -39,6 +54,7 @@ namespace MP.AppAuth public AppAuthContext(DbContextOptions options) : base(options) { + _options = options; try { // se non ci fosse... crea o migra! diff --git a/MP.AppAuth/Controllers/AppAuthController.cs b/MP.AppAuth/Controllers/AppAuthController.cs index 24757db7..bd6047d5 100644 --- a/MP.AppAuth/Controllers/AppAuthController.cs +++ b/MP.AppAuth/Controllers/AppAuthController.cs @@ -1,4 +1,5 @@ -using Microsoft.Extensions.Configuration; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; using MP.AppAuth.Models; using NLog; using System; @@ -9,14 +10,14 @@ using System.Threading.Tasks; namespace MP.AppAuth.Controllers { - public class AppAuthController : IDisposable + public class AppAuthController { #region Public Constructors public AppAuthController(IConfiguration configuration) { _configuration = configuration; - dbCtx = new AppAuthContext(configuration); + Log.Info("Avviata classe AppAuthController"); } @@ -116,11 +117,6 @@ namespace MP.AppAuth.Controllers return dbResult; } - public void Dispose() - { - // Clear database context - dbCtx.Dispose(); - } /// /// Elenco completo permessi2funzione @@ -193,33 +189,7 @@ namespace MP.AppAuth.Controllers return dbResult; } - public void ResetController() - { - dbCtx = new AppAuthContext(_configuration); - Log.Info("Effettuato reset AppAuthController"); - } - - /// - /// Annulla modifiche su una specifica entity (cancel update) - /// - /// - /// - public bool RollBackEntity(object item) - { - bool answ = false; - try - { - if (dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Deleted || dbCtx.Entry(item).State == Microsoft.EntityFrameworkCore.EntityState.Modified) - { - dbCtx.Entry(item).Reload(); - } - } - catch (Exception exc) - { - Log.Error($"Eccezione in rollBackEntity{Environment.NewLine}{exc}"); - } - return answ; - } + /// /// Elenco Record x gestione Update @@ -259,7 +229,6 @@ namespace MP.AppAuth.Controllers #region Private Fields private static IConfiguration _configuration; - private static AppAuthContext dbCtx; private static Logger Log = LogManager.GetCurrentClassLogger(); #endregion Private Fields diff --git a/MP.AppAuth/Services/AppAuthService.cs b/MP.AppAuth/Services/AppAuthService.cs index cef52a0a..7ab866af 100644 --- a/MP.AppAuth/Services/AppAuthService.cs +++ b/MP.AppAuth/Services/AppAuthService.cs @@ -96,7 +96,7 @@ namespace MP.AppAuth.Services }; // conf DB - string connStr = _configuration.GetConnectionString("MP.Land"); + string connStr = _configuration.GetConnectionString("MP.Land.Auth"); if (string.IsNullOrEmpty(connStr)) { _logger.LogError("ConnString empty!"); @@ -431,10 +431,6 @@ namespace MP.AppAuth.Services public void Dispose() { // Clear database controller - if (dbController != null) - { - dbController.Dispose(); - } if (MpDbController != null) { MpDbController.Dispose(); diff --git a/MP.Data/Controllers/MpLandController.cs b/MP.Data/Controllers/MpLandController.cs index 956c460c..9a77ad18 100644 --- a/MP.Data/Controllers/MpLandController.cs +++ b/MP.Data/Controllers/MpLandController.cs @@ -19,7 +19,11 @@ namespace MP.Data.Controllers public MpLandController(IConfiguration configuration) { _configuration = configuration; - string connStr = _configuration.GetConnectionString("MP.Data"); + string connStr = _configuration.GetConnectionString("MP.Land"); + if(string.IsNullOrEmpty(connStr)) + { + connStr = _configuration.GetConnectionString("MP.Data"); + } options = new DbContextOptionsBuilder() .UseSqlServer(connStr) .Options; diff --git a/MP.IOC/Properties/PublishProfiles/IIS01.pubxml.user b/MP.IOC/Properties/PublishProfiles/IIS01.pubxml.user index f06abead..15901b1b 100644 --- a/MP.IOC/Properties/PublishProfiles/IIS01.pubxml.user +++ b/MP.IOC/Properties/PublishProfiles/IIS01.pubxml.user @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAdCoESbxryUqXde3FfEOCTwAAAAACAAAAAAADZgAAwAAAABAAAAAFrH1vByj45Qn06hO/OH6tAAAAAASAAACgAAAAEAAAAIUK5NiEpc4lc11Op6/CLx8YAAAAMecN12fzIN9e3E8R/nu0ATe2PAsMy7M8FAAAAKbUyki2vkSFehjbpB8wCVVVa055 - False|2026-05-08T09:06:51.2202890Z||;True|2026-05-08T10:37:55.0049896+02:00||;False|2026-05-08T10:37:05.1546068+02:00||;False|2026-05-08T10:36:33.0311629+02:00||;False|2026-05-08T10:35:55.7742437+02:00||;True|2026-04-17T19:09:49.4900600+02:00||;True|2026-04-03T12:55:15.0251473+02:00||;True|2026-04-03T10:03:02.5833820+02:00||;True|2026-04-03T09:55:55.5274684+02:00||;True|2026-04-03T09:52:44.9063312+02:00||;False|2026-04-03T09:45:49.5943015+02:00||;True|2024-11-04T08:56:17.3071781+01:00||;True|2023-02-14T17:41:26.3850692+01:00||;True|2023-02-14T17:31:39.4933399+01:00||; + True|2026-05-08T09:26:08.1731328Z||;False|2026-05-08T11:06:51.2202890+02:00||;True|2026-05-08T10:37:55.0049896+02:00||;False|2026-05-08T10:37:05.1546068+02:00||;False|2026-05-08T10:36:33.0311629+02:00||;False|2026-05-08T10:35:55.7742437+02:00||;True|2026-04-17T19:09:49.4900600+02:00||;True|2026-04-03T12:55:15.0251473+02:00||;True|2026-04-03T10:03:02.5833820+02:00||;True|2026-04-03T09:55:55.5274684+02:00||;True|2026-04-03T09:52:44.9063312+02:00||;False|2026-04-03T09:45:49.5943015+02:00||;True|2024-11-04T08:56:17.3071781+01:00||;True|2023-02-14T17:41:26.3850692+01:00||;True|2023-02-14T17:31:39.4933399+01:00||; \ No newline at end of file diff --git a/MP.Land/MP.Land.csproj b/MP.Land/MP.Land.csproj index 4b406421..4f1a232f 100644 --- a/MP.Land/MP.Land.csproj +++ b/MP.Land/MP.Land.csproj @@ -3,7 +3,7 @@ net8.0 MP.Land - 8.16.2605.0411 + 8.16.2605.0811 Debug;Release;Debug_LiManDebug en True diff --git a/MP.Land/Pages/IobList.razor.cs b/MP.Land/Pages/IobList.razor.cs index 87e6ca55..90157bb1 100644 --- a/MP.Land/Pages/IobList.razor.cs +++ b/MP.Land/Pages/IobList.razor.cs @@ -173,18 +173,6 @@ namespace MP.Land.Pages return answ; } -#if false - protected Core.Objects.IOB_data CurrIobInfo(string idxMacc) - { - Core.Objects.IOB_data answ = new Core.Objects.IOB_data(); - if (DictIobInfo.ContainsKey(idxMacc)) - { - answ = DictIobInfo[idxMacc]; - } - return answ; - } -#endif - protected void DataInit() { isLoading = true; @@ -219,17 +207,6 @@ namespace MP.Land.Pages return answ; } -#if false - protected string IobExeTrim(string IdxMacchina) - { - string answ = MacIobConf(IdxMacchina, "IobExe"); - if (!string.IsNullOrEmpty(answ) && answ.Contains(",")) - { - answ = answ.Substring(0, answ.IndexOf(',')); - } - return answ; - } -#endif protected override async Task OnInitializedAsync() { diff --git a/MP.Land/Pages/UserQr.razor.cs b/MP.Land/Pages/UserQr.razor.cs index 49f50c64..6d121f15 100644 --- a/MP.Land/Pages/UserQr.razor.cs +++ b/MP.Land/Pages/UserQr.razor.cs @@ -143,11 +143,9 @@ namespace MP.Land.Pages private async void OnFilterUpdated() { isLoading = true; - await Task.Delay(1); await InvokeAsync(StateHasChanged); ListRecords = null; currPage = 1; - await Task.Delay(1); await ReloadData(); } @@ -158,7 +156,6 @@ namespace MP.Land.Pages await InvokeAsync(StateHasChanged); ListRecords = null; currPage = 1; - await Task.Delay(1); await ReloadData(); } @@ -166,11 +163,9 @@ namespace MP.Land.Pages { isLoading = true; // importante altrimenti NON mostra update UI - await Task.Delay(1); SearchRecords = await DataService.AnagOperByGroupList(groupName, AppMService.SearchVal); ListRecords = SearchRecords.Skip((currPage - 1) * numRecord).Take(numRecord).ToList(); totalCount = SearchRecords.Count(); - await Task.Delay(1); isLoading = false; StateHasChanged(); } diff --git a/MP.Land/Resources/ChangeLog.html b/MP.Land/Resources/ChangeLog.html index 01aed9ae..65e63b56 100644 --- a/MP.Land/Resources/ChangeLog.html +++ b/MP.Land/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo Tablet MAPO - DotNet6 -

Versione: 8.16.2605.0411

+

Versione: 8.16.2605.0811


Note di rilascio:
    diff --git a/MP.Land/Resources/VersNum.txt b/MP.Land/Resources/VersNum.txt index af1dc925..3249ffa8 100644 --- a/MP.Land/Resources/VersNum.txt +++ b/MP.Land/Resources/VersNum.txt @@ -1 +1 @@ -8.16.2605.0411 +8.16.2605.0811 diff --git a/MP.Land/Resources/manifest.xml b/MP.Land/Resources/manifest.xml index d230416a..e201bc34 100644 --- a/MP.Land/Resources/manifest.xml +++ b/MP.Land/Resources/manifest.xml @@ -1,6 +1,6 @@ - 8.16.2605.0411 + 8.16.2605.0811 https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/MP.Land.zip https://nexus.steamware.net/repository/SWS/MP-LAND/stable/LAST/ChangeLog.html false diff --git a/MP.Land/appsettings.json b/MP.Land/appsettings.json index b3be2a6d..09dcc181 100644 --- a/MP.Land/appsettings.json +++ b/MP.Land/appsettings.json @@ -58,6 +58,7 @@ "ConnectionStrings": { "DefaultConnection": "Server=SQL2016DEV;Database=MoonPro;Trusted_Connection=True;MultipleActiveResultSets=true", "MP.All": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;", + "MP.Data": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;", "MP.Flux": "Server=SQL2016DEV;Database=MoonPro_FluxData;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;", "MP.Land": "Server=SQL2016DEV;Database=MoonPro;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;", "MP.Land.Auth": "Server=SQL2016DEV;Database=MoonPro_Anagrafica;User ID=sa;Password=keyhammer16;integrated security=False;MultipleActiveResultSets=True;App=MP.Land;",