diff --git a/EgwCoreLib.Lux.Core/Enums.cs b/EgwCoreLib.Lux.Core/Enums.cs index d63b363a..ca95df68 100644 --- a/EgwCoreLib.Lux.Core/Enums.cs +++ b/EgwCoreLib.Lux.Core/Enums.cs @@ -77,6 +77,25 @@ BomAlt } + /// + /// Tipologia immagine + /// + public enum ImageType + { + /// + /// Non definita (da calcolare...) + /// + ND = 0, + /// + /// Calcolata (es JWD, BTL) + /// + Calculated, + /// + /// Fissa (tipicamente prodotto da rivendita/servizio) + /// + Fixed + } + /// /// Tipologia item per Source (modalità costruzione) /// diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs index 2f9eefc8..847a163b 100644 --- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs +++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs @@ -4439,9 +4439,10 @@ namespace EgwCoreLib.Lux.Data.Controllers if (currRec != null) { currRec.FileName = updRec.FileName; +#if false currRec.FileResource = updRec.FileResource; - currRec.FileSize = updRec.FileSize; - currRec.SerStruct = updRec.SerStruct; + currRec.FileSize = updRec.FileSize; +#endif dbCtx.Entry(currRec).State = EntityState.Modified; } diff --git a/EgwCoreLib.Lux.Data/DbModel/Items/SellingItemModel.cs b/EgwCoreLib.Lux.Data/DbModel/Items/SellingItemModel.cs index 6c870292..79d01c0d 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Items/SellingItemModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Items/SellingItemModel.cs @@ -84,6 +84,11 @@ namespace EgwCoreLib.Lux.Data.DbModel.Items /// public string ItemSteps { get; set; } = ""; + /// + /// Tipo immagine da visualizzare + /// + public ImageType ImgType { get; set; } = ImageType.ND; + /// /// Restituisce UID da impiegare x immagine /// @@ -93,21 +98,23 @@ namespace EgwCoreLib.Lux.Data.DbModel.Items get => ImgUrl(SellingItemID); } +#if false /// /// Nomi risorsa file associato alla riga offerta (es per BTL) /// URI come risorsa dentro folder offerta/riga-offerta/guid /// public string FileResource { get; set; } = ""; - /// - /// Nomi file originale associato alla riga offerta (es per BTL) - /// - public string FileName { get; set; } = ""; - /// /// Dimensione del file (per visualizzazione rapida) /// - public long FileSize { get; set; } = 0; + public long FileSize { get; set; } = 0; +#endif + + /// + /// Nomi file (fixed) da mostrare e salvare + /// + public string FileName { get; set; } = ""; /// /// Indica protetto = NON consentito edit completo (da definire...) diff --git a/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs b/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs index 32ed69a7..505f9e0c 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs @@ -63,17 +63,24 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales [NotMapped] public bool CalcEnabled { - get - { + get => ImgType == ImageType.Calculated; +#if false + { bool answ = false; if (SellingItemNav != null) { answ = SellingItemNav.SourceType == ItemSourceType.Jwd || SellingItemNav.SourceType == ItemSourceType.FileBTL; } return answ; - } + } +#endif } + /// + /// Tipo immagine da visualizzare + /// + public ImageType ImgType { get; set; } = ImageType.ND; + /// /// Restituisce UID da impiegare x immagine /// @@ -102,7 +109,6 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales //answ = $"SP.{SellingItemID:X12}"; answ = SellingItemModel.ImgUrl(SellingItemID); } - //if (TemplateRowID > 0 && TemplateRowNav != null) //{ // answ = TemplateRowNav.ImgUID; diff --git a/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs b/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs index e6d18d1c..ecc5ad5c 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs @@ -151,17 +151,24 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales [NotMapped] public bool CalcEnabled { - get - { + get => ImgType == ImageType.Calculated; +#if false + { bool answ = false; if (SellingItemNav != null) { answ = SellingItemNav.SourceType == ItemSourceType.Jwd || SellingItemNav.SourceType == ItemSourceType.FileBTL; } return answ; - } + } +#endif } + /// + /// Tipo immagine da visualizzare + /// + public ImageType ImgType { get; set; } = ImageType.ND; + /// /// Restituisce UID da impiegare x immagine /// @@ -179,14 +186,16 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales else { // cerco in primis se ha template... - if (TemplateRowID > 0 && TemplateRowNav != null) + if (TemplateRowID != null && TemplateRowID > 0) { - answ = TemplateRowNav.TemplateRowUID; + //answ= $"TR.{TemplateRowID:X16}"; + answ = TemplateRowModel.ImgUrl(TemplateRowID ?? 0); } // altrimenti da selling item... - else if (SellingItemID > 0 && SellingItemNav != null) + else if (SellingItemID > 0) { - answ = $"PROD.{SellingItemID:X12}"; + //answ = $"SP.{SellingItemID:X12}"; + answ = SellingItemModel.ImgUrl(SellingItemID); } } return answ; diff --git a/EgwCoreLib.Lux.Data/DbModel/Sales/TemplateRowModel.cs b/EgwCoreLib.Lux.Data/DbModel/Sales/TemplateRowModel.cs index 97dc16a4..266c33e9 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Sales/TemplateRowModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Sales/TemplateRowModel.cs @@ -1,6 +1,7 @@ using EgwCoreLib.Lux.Data.DbModel.Items; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; +using static EgwCoreLib.Lux.Core.Enums; // // This is here so CodeMaid doesn't reorganize this document @@ -60,6 +61,11 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales get => ImgUrl(TemplateRowID); } + /// + /// Tipo immagine da visualizzare + /// + public ImageType ImgType { get; set; } = ImageType.ND; + /// /// ID dell'articolo di vendita di riferimento /// diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index ac691e4a..972f87e4 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 1.1.2603.1119 + 1.1.2603.1205 diff --git a/Lux.UI/Components/Compo/Item/SellingItemEdit.razor.cs b/Lux.UI/Components/Compo/Item/SellingItemEdit.razor.cs index 8acdd16f..c1fa824a 100644 --- a/Lux.UI/Components/Compo/Item/SellingItemEdit.razor.cs +++ b/Lux.UI/Components/Compo/Item/SellingItemEdit.razor.cs @@ -101,17 +101,24 @@ namespace Lux.UI.Components.Compo.Item { // calcolo path + nome del file trusted... string folderPath = FolderPath(); - string trustedFileName = Path.GetRandomFileName(); +#if false + string trustedFileName = Path.GetRandomFileName(); +#endif + // Estensione originale + string extension = Path.GetExtension(file.Name); + string newFileName = $"{CurrRecord.ImgUID}{extension}"; // elimino vecchio file... - FService.DeleteOldFile(folderPath, CurrRecord.FileResource); + FService.DeleteOldFile(folderPath, CurrRecord.FileName); // salvo nuovo file... - FService.SaveFileContent(folderPath, trustedFileName, rawContent); + FService.SaveFileContent(folderPath, newFileName, rawContent); // aggiorno dati sul DB... - CurrRecord.FileResource = trustedFileName; CurrRecord.FileName = file.Name; - CurrRecord.FileSize = rawContent.LongCount(); +#if false + CurrRecord.FileResource = newFileName; + CurrRecord.FileSize = rawContent.LongCount(); +#endif await DLService.SellingItemUpdateFileDataAsync(CurrRecord); } } diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index 53c2573c..8f50bf4b 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.2603.1119 + 1.1.2603.1205 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index fef2b0a2..4cb9a08a 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 1.1.2603.1119

+

Versione: 1.1.2603.1205


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 02b1da09..2205792a 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -1.1.2603.1119 +1.1.2603.1205 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 953cfed7..28e4dc6e 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.1.2603.1119 + 1.1.2603.1205 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false