From 59249c189a0af764b5a3a5817d944eac36118ece Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Fri, 24 Apr 2026 18:52:21 +0200 Subject: [PATCH] Aggiunta descrizione selezione file report --- .../DataServiceCollectionExtensions.cs | 6 ++- Lux.API/Lux.API.csproj | 2 +- Lux.API/Program.cs | 11 +++++ .../Components/Compo/Common/PrintModal.razor | 41 +++++++++++-------- .../Compo/Common/PrintModal.razor.cs | 40 +++++++++++++++--- Lux.UI/GlobalUsings.cs | 1 + Lux.UI/Lux.UI.csproj | 2 +- Lux.UI/Program.cs | 11 +++++ Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 11 files changed, 91 insertions(+), 29 deletions(-) diff --git a/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs b/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs index 7007fc62..3bc2078b 100644 --- a/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs +++ b/EgwCoreLib.Lux.Data/DataServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ -using EgwCoreLib.Lux.Data.Repository.Supplier; +using EgwCoreLib.Lux.Data.Repository.Report; +using EgwCoreLib.Lux.Data.Repository.Supplier; using EgwCoreLib.Lux.Data.Services.Catalog; using EgwCoreLib.Lux.Data.Services.Config; using EgwCoreLib.Lux.Data.Services.Cost; @@ -7,6 +8,7 @@ using EgwCoreLib.Lux.Data.Services.Internal; using EgwCoreLib.Lux.Data.Services.Items; using EgwCoreLib.Lux.Data.Services.Job; using EgwCoreLib.Lux.Data.Services.Production; +using EgwCoreLib.Lux.Data.Services.Report; using EgwCoreLib.Lux.Data.Services.Sales; using EgwCoreLib.Lux.Data.Services.Supplier; using EgwCoreLib.Lux.Data.Services.Utils; @@ -55,6 +57,7 @@ namespace EgwCoreLib.Lux.Data services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); + services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); @@ -89,6 +92,7 @@ namespace EgwCoreLib.Lux.Data services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); + services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); services.TryAddScoped(); diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 388af9cf..e23c72bd 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2604.2417 + 1.1.2604.2418 diff --git a/Lux.API/Program.cs b/Lux.API/Program.cs index 4f056aec..90fe23da 100644 --- a/Lux.API/Program.cs +++ b/Lux.API/Program.cs @@ -144,6 +144,17 @@ builder.Services.AddDbContextFactory(options => .EnableDetailedErrors(false) .LogTo(_ => { }); // disabilita EF logging; }); +builder.Services.AddDbContextFactory(options => +{ + var conn = builder.Configuration.GetConnectionString("Lux.All"); + options.UseMySql(conn, ServerVersion.AutoDetect(conn), mySqlOptions => + { + mySqlOptions.EnableStringComparisonTranslations(); + }) + .EnableSensitiveDataLogging(false) + .EnableDetailedErrors(false) + .LogTo(_ => { }); // disabilita EF logging; +}); // fix serializazzione senza loop builder.Services.AddControllers().AddJsonOptions(options => diff --git a/Lux.UI/Components/Compo/Common/PrintModal.razor b/Lux.UI/Components/Compo/Common/PrintModal.razor index 0619ca20..ea180723 100644 --- a/Lux.UI/Components/Compo/Common/PrintModal.razor +++ b/Lux.UI/Components/Compo/Common/PrintModal.razor @@ -1,24 +1,29 @@  \ No newline at end of file diff --git a/Lux.UI/Components/Compo/Common/PrintModal.razor.cs b/Lux.UI/Components/Compo/Common/PrintModal.razor.cs index ae9d8b20..352c3f8a 100644 --- a/Lux.UI/Components/Compo/Common/PrintModal.razor.cs +++ b/Lux.UI/Components/Compo/Common/PrintModal.razor.cs @@ -1,5 +1,6 @@ -using System.Drawing.Drawing2D; -using System.Threading.Tasks; +using EgwCoreLib.Lux.Data.DbModel.Report; +using EgwCoreLib.Lux.Data.Services.Report; +using Newtonsoft.Json; namespace Lux.UI.Components.Compo.Common { @@ -18,14 +19,27 @@ namespace Lux.UI.Components.Compo.Common [Inject] private IFileService FService { get; set; } = null!; - protected override void OnInitialized() + [Inject] + private IReportService RService { get; set; } = null!; + + protected override async Task OnInitializedAsync() { + isLoading = true; LoadFileList(); - //base.OnInitialized(); + ReportList = await RService.GetAllAsync(); + ReportModel currReport = ReportList.FirstOrDefault(x => x.Name.Contains(repType)) ?? new(); + // fix alias disponibili + if (!string.IsNullOrEmpty(currReport.FileConfDataRaw)) + { + DictAlias = JsonConvert.DeserializeObject>(currReport.FileConfDataRaw) ?? new(); + } + isLoading = false; } + private List ReportList = new(); + private Dictionary DictAlias = new(); private List ListRepFiles = new List(); - private bool selectOptPrint = false; + private bool isLoading = false; private string DoPrint(string SelFile) { @@ -46,5 +60,21 @@ namespace Lux.UI.Components.Compo.Common ListRepFiles = rawList.Select(x => Path.GetFileName(x)).ToList(); var SelFile = ListRepFiles.FirstOrDefault(); } + + /// + /// Recupero descrizione report + /// + /// Nome file + /// + private string Descrizione(string currFileName) + { + string ans = ""; + // cerco nel dizionario... + if (DictAlias.ContainsKey(currFileName)) + { + ans = DictAlias[currFileName]; + } + return ans; + } } } \ No newline at end of file diff --git a/Lux.UI/GlobalUsings.cs b/Lux.UI/GlobalUsings.cs index 6b281258..43e1aca4 100644 --- a/Lux.UI/GlobalUsings.cs +++ b/Lux.UI/GlobalUsings.cs @@ -17,6 +17,7 @@ global using EgwCoreLib.Lux.Data.Services.General; global using EgwCoreLib.Lux.Data.Services.Items; global using EgwCoreLib.Lux.Data.Services.Job; global using EgwCoreLib.Lux.Data.Services.Production; +global using EgwCoreLib.Lux.Data.Services.Report; global using EgwCoreLib.Lux.Data.Services.Sales; global using EgwCoreLib.Lux.Data.Services.Utils; global using EgwCoreLib.Lux.Data.Services.Warehouse; diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index b0122013..34d71993 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 1.1.2604.2417 + 1.1.2604.2418 diff --git a/Lux.UI/Program.cs b/Lux.UI/Program.cs index 3fe22804..5e1d4633 100644 --- a/Lux.UI/Program.cs +++ b/Lux.UI/Program.cs @@ -168,6 +168,17 @@ builder.Services.AddDbContextFactory(options => //.LogTo(_ => { }, Microsoft.Extensions.Logging.LogLevel.None); // disabilita EF logging }); +builder.Services.AddDbContextFactory(options => +{ + options.UseMySql(conn, ServerVersion.AutoDetect(conn), mySqlOptions => + { + mySqlOptions.EnableStringComparisonTranslations(); + }) + .EnableSensitiveDataLogging(false) + .EnableDetailedErrors(true); + //.LogTo(_ => { }, Microsoft.Extensions.Logging.LogLevel.None); // disabilita EF logging +}); + builder.Services.AddDatabaseDeveloperPageExceptionFilter(); // registrazione in blocco servizi con metodo extension custom diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 81f2d48a..5e89572c 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2604.2417

+

Versione: 1.1.2604.2418


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 89a26560..519b970e 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2604.2417 +1.1.2604.2418 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 88ff86d4..e71165c8 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2604.2417 + 1.1.2604.2418 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false