diff --git a/EgwCoreLib.Lux.Core/DictUtils.cs b/EgwCoreLib.Lux.Core/DictUtils.cs new file mode 100644 index 00000000..ec4af79e --- /dev/null +++ b/EgwCoreLib.Lux.Core/DictUtils.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EgwCoreLib.Lux.Core +{ + public class DictUtils + { + #region Public Methods + + /// + /// Comparatore equality obj dizionario + /// + /// + /// + /// + /// + /// + public static bool DictAreEqual(Dictionary dict1, Dictionary dict2) + { + // Handle null cases + if (dict1 == null || dict2 == null) + return dict1 == dict2; + + // Quick size check + if (dict1.Count != dict2.Count) + return false; + + // Compare each key-value pair + foreach (var kvp in dict1) + { + if (!dict2.TryGetValue(kvp.Key, out TValue value)) + return false; // Key missing in dict2 + + if (!EqualityComparer.Default.Equals(kvp.Value, value)) + return false; // Value mismatch + } + + return true; + } + + #endregion Public Methods + } +} \ No newline at end of file diff --git a/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj b/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj index cf161881..fdc9023c 100644 --- a/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj +++ b/EgwCoreLib.Lux.Core/EgwCoreLib.Lux.Core.csproj @@ -21,8 +21,9 @@ - - + + + diff --git a/EgwCoreLib.Lux.Core/Enums.cs b/EgwCoreLib.Lux.Core/Enums.cs index 6339f28a..d388a467 100644 --- a/EgwCoreLib.Lux.Core/Enums.cs +++ b/EgwCoreLib.Lux.Core/Enums.cs @@ -86,6 +86,7 @@ namespace EgwCoreLib.Lux.Core BomAlt } +#if false /// /// Modo chiamata Engine /// @@ -96,8 +97,10 @@ namespace EgwCoreLib.Lux.Core Preview, Bom, HardwareModelList - } + } +#endif +#if false /// /// SubMode di chiamata Engine /// @@ -107,9 +110,11 @@ namespace EgwCoreLib.Lux.Core LIST = 1, CALCSASH = 2, SASHOPTIONS = 3 - } + } +#endif +#if false /// /// Elenco produttori Hardware /// @@ -119,6 +124,7 @@ namespace EgwCoreLib.Lux.Core AGB = 1, MAICO = 2, ROTO = 3 - } + } +#endif } } diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs index b3c1711a..3e401d2a 100644 --- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs +++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs @@ -1502,6 +1502,19 @@ namespace EgwCoreLib.Lux.Data.Controllers if (currRec == null) { dbCtx.DbSetOfferRow.Add(updRec); + // se ci sono record successivi li devo spostare... + var list2move = dbCtx + .DbSetOfferRow + .Where(x => x.OfferID == updRec.OfferID && x.RowNum >= updRec.RowNum) + .ToList(); + if (list2move != null && list2move.Count > 0) + { + foreach (var item2move in list2move) + { + item2move.RowNum++; + dbCtx.Entry(item2move).State = EntityState.Modified; + } + } } // altrimenti aggiorno else diff --git a/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs b/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs index 2cf93528..89d8f57a 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Sales/OfferRowModel.cs @@ -50,7 +50,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales /// /// ID dell'articolo di vendita offerto /// - public int SellingItemID { get; set; } + public int? SellingItemID { get; set; } /// /// Quantità della risorsa @@ -209,6 +209,6 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales /// Navigazione Item /// [ForeignKey("SellingItemID")] - public virtual SellingItemModel SellingItemNav { get; set; } = null!; + public virtual SellingItemModel? SellingItemNav { get; set; } } } diff --git a/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs b/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs index 68f12fda..441700fc 100644 --- a/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/Sales/OrderRowModel.cs @@ -46,7 +46,7 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales /// /// ID dell'articolo di vendita Orderto /// - public int SellingItemID { get; set; } + public int? SellingItemID { get; set; } /// /// Costo dei componeti BOM (RockBottom) @@ -164,6 +164,6 @@ namespace EgwCoreLib.Lux.Data.DbModel.Sales /// Navigazione Item /// [ForeignKey("SellingItemID")] - public virtual SellingItemModel SellingItemNav { get; set; } = null!; + public virtual SellingItemModel? SellingItemNav { get; set; } } } diff --git a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj index 74a1610f..60fe44c1 100644 --- a/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj +++ b/EgwCoreLib.Lux.Data/EgwCoreLib.Lux.Data.csproj @@ -27,16 +27,16 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/EgwCoreLib.Lux.Data/Migrations/20251021075301_InitDb.Designer.cs b/EgwCoreLib.Lux.Data/Migrations/20251021091403_InitDb.Designer.cs similarity index 96% rename from EgwCoreLib.Lux.Data/Migrations/20251021075301_InitDb.Designer.cs rename to EgwCoreLib.Lux.Data/Migrations/20251021091403_InitDb.Designer.cs index b444175a..9865197e 100644 --- a/EgwCoreLib.Lux.Data/Migrations/20251021075301_InitDb.Designer.cs +++ b/EgwCoreLib.Lux.Data/Migrations/20251021091403_InitDb.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace EgwCoreLib.Lux.Data.Migrations { [DbContext(typeof(DataLayerContext))] - [Migration("20251021075301_InitDb")] + [Migration("20251021091403_InitDb")] partial class InitDb { /// @@ -1252,13 +1252,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 1, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(608), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(610), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(143), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(144), OffertState = 0, RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(605) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(140) }, new { @@ -1272,13 +1272,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 2, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(622), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(624), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(156), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(157), OffertState = 0, RefNum = 2, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(621) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(155) }, new { @@ -1292,13 +1292,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 4, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(632), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(633), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(166), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(167), OffertState = 0, RefNum = 3, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(630) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(164) }, new { @@ -1312,13 +1312,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 3, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(641), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(643), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(175), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(177), OffertState = 0, RefNum = 4, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(640) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(174) }); }); @@ -1393,7 +1393,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("RowNum") .HasColumnType("int"); - b.Property("SellingItemID") + b.Property("SellingItemID") .HasColumnType("int"); b.Property("SerStruct") @@ -1415,33 +1415,6 @@ namespace EgwCoreLib.Lux.Data.Migrations b.ToTable("sales_offer_row"); b.HasData( - new - { - OfferRowID = 1, - AwaitBom = false, - AwaitPrice = false, - BomCost = 900.0, - BomOk = true, - BomPrice = 950.0, - Envir = 1, - FileName = "", - FileResource = "", - FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(766), - ItemBOM = "", - ItemOk = true, - ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(768), - Note = "Finestra Vetro Fisso 2025", - OfferID = 1, - OfferRowUID = "SOR.25.00000001", - Qty = 3.0, - RowNum = 1, - SellingItemID = 2, - SerStruct = "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", - StepCost = 0.0, - StepPrice = 0.0 - }, new { OfferRowID = 2, @@ -1454,11 +1427,11 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(782), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(424), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(783), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(426), Note = "Finestra Anta Singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000002", @@ -1470,6 +1443,33 @@ namespace EgwCoreLib.Lux.Data.Migrations StepPrice = 0.0 }, new + { + OfferRowID = 1, + AwaitBom = false, + AwaitPrice = false, + BomCost = 900.0, + BomOk = true, + BomPrice = 950.0, + Envir = 1, + FileName = "", + FileResource = "", + FileSize = 0L, + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(440), + ItemBOM = "", + ItemOk = true, + ItemSteps = "{}", + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(441), + Note = "Finestra Vetro Fisso 2025", + OfferID = 1, + OfferRowUID = "SOR.25.00000001", + Qty = 3.0, + RowNum = 2, + SellingItemID = 2, + SerStruct = "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", + StepCost = 0.0, + StepPrice = 0.0 + }, + new { OfferRowID = 3, AwaitBom = false, @@ -1481,17 +1481,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(794), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(452), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(796), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(454), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000003", Qty = 3.0, - RowNum = 2, - SellingItemID = 2, + RowNum = 3, + SellingItemID = 3, SerStruct = "{}", StepCost = 0.0, StepPrice = 0.0 @@ -1508,17 +1508,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(807), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(465), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(809), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(466), Note = "Installazione serramento", OfferID = 1, OfferRowUID = "SOR.25.00000004", Qty = 3.0, - RowNum = 3, - SellingItemID = 3, + RowNum = 4, + SellingItemID = 4, SerStruct = "{}", StepCost = 0.0, StepPrice = 0.0 @@ -1535,17 +1535,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(840), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(499), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(842), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(501), Note = "Demo file 01", OfferID = 2, OfferRowUID = "SOR.25.00000005", Qty = 10.0, RowNum = 1, - SellingItemID = 4, + SellingItemID = 5, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1562,17 +1562,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(853), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(512), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(855), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(514), Note = "Demo file 02", OfferID = 2, OfferRowUID = "SOR.25.00000006", Qty = 4.0, RowNum = 1, - SellingItemID = 4, + SellingItemID = 5, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1589,17 +1589,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(884), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(543), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(886), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(545), Note = "Demo file 01", OfferID = 3, OfferRowUID = "SOR.25.00000007", Qty = 4.0, RowNum = 1, - SellingItemID = 5, + SellingItemID = 6, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1616,17 +1616,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(897), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(555), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(899), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(557), Note = "Demo file 02", OfferID = 3, OfferRowUID = "SOR.25.00000008", Qty = 12.0, RowNum = 1, - SellingItemID = 5, + SellingItemID = 6, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1643,17 +1643,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(927), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(585), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(929), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(587), Note = "Demo file 01", OfferID = 4, OfferRowUID = "SOR.25.00000009", Qty = 6.0, RowNum = 1, - SellingItemID = 6, + SellingItemID = 7, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1670,17 +1670,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(940), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(598), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(942), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(600), Note = "Demo file 02", OfferID = 4, OfferRowUID = "SOR.25.0000000A", Qty = 4.0, RowNum = 1, - SellingItemID = 6, + SellingItemID = 7, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1791,7 +1791,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("RowNum") .HasColumnType("int"); - b.Property("SellingItemID") + b.Property("SellingItemID") .HasColumnType("int"); b.Property("SerStruct") @@ -1871,8 +1871,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 1, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(281), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(332), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9815), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9876), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1884,8 +1884,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 2, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(335), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(337), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9879), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9881), MovCod = "CAR", Note = "DEMO", QtyRec = 8.0, @@ -1897,8 +1897,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 3, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(339), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(340), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9883), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9884), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1910,8 +1910,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 4, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(343), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(344), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9886), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9888), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1923,8 +1923,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 5, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(346), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(348), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9890), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9891), MovCod = "CAR", Note = "DEMO", QtyRec = 10.0, @@ -1936,8 +1936,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 6, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(350), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(351), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9894), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9895), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1949,8 +1949,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 7, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(354), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(355), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9897), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9898), MovCod = "CAR", Note = "DEMO", QtyRec = 50.0, @@ -1962,8 +1962,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 8, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(357), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(359), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9901), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9902), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1975,8 +1975,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 9, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(361), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(363), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9904), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9906), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1988,8 +1988,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 10, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(365), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(366), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9908), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9909), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2730,8 +2730,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.HasOne("EgwCoreLib.Lux.Data.DbModel.Items.SellingItemModel", "SellingItemNav") .WithMany() .HasForeignKey("SellingItemID") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.Navigation("OfferNav"); @@ -2776,8 +2775,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.HasOne("EgwCoreLib.Lux.Data.DbModel.Items.SellingItemModel", "SellingItemNav") .WithMany() .HasForeignKey("SellingItemID") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.Navigation("OrderNav"); diff --git a/EgwCoreLib.Lux.Data/Migrations/20251021075301_InitDb.cs b/EgwCoreLib.Lux.Data/Migrations/20251021091403_InitDb.cs similarity index 91% rename from EgwCoreLib.Lux.Data/Migrations/20251021075301_InitDb.cs rename to EgwCoreLib.Lux.Data/Migrations/20251021091403_InitDb.cs index e085cf81..5cf6bf26 100644 --- a/EgwCoreLib.Lux.Data/Migrations/20251021075301_InitDb.cs +++ b/EgwCoreLib.Lux.Data/Migrations/20251021091403_InitDb.cs @@ -592,7 +592,7 @@ namespace EgwCoreLib.Lux.Data.Migrations Envir = table.Column(type: "int", nullable: false), OfferRowUID = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), - SellingItemID = table.Column(type: "int", nullable: false), + SellingItemID = table.Column(type: "int", nullable: true), Qty = table.Column(type: "double", nullable: false), BomCost = table.Column(type: "double", nullable: false), BomPrice = table.Column(type: "double", nullable: false), @@ -714,7 +714,7 @@ namespace EgwCoreLib.Lux.Data.Migrations .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), OrderID = table.Column(type: "int", nullable: false), RowNum = table.Column(type: "int", nullable: false), - SellingItemID = table.Column(type: "int", nullable: false), + SellingItemID = table.Column(type: "int", nullable: true), BomCost = table.Column(type: "double", nullable: false), Qty = table.Column(type: "double", nullable: false), BomPrice = table.Column(type: "double", nullable: false), @@ -1027,10 +1027,10 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "OfferID", "ConsNote", "CustomerID", "DealerID", "Description", "DictPresel", "Discount", "DueDateProm", "DueDateReq", "Envir", "Inserted", "Modified", "OffertState", "RefNum", "RefRev", "RefYear", "ValidUntil" }, values: new object[,] { - { 1, "", 2, 2, "Offerta per tre serramenti", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 1, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(608), new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(610), 0, 1, 1, 2024, new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(605) }, - { 2, "", 2, 2, "Offerta BEAM", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 2, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(622), new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(624), 0, 2, 1, 2024, new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(621) }, - { 3, "", 2, 2, "Offerta Cabinet", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 4, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(632), new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(633), 0, 3, 1, 2024, new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(630) }, - { 4, "", 2, 2, "Offerta Wall", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 3, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(641), new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(643), 0, 4, 1, 2024, new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(640) } + { 1, "", 2, 2, "Offerta per tre serramenti", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 1, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(143), new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(144), 0, 1, 1, 2024, new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(140) }, + { 2, "", 2, 2, "Offerta BEAM", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 2, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(156), new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(157), 0, 2, 1, 2024, new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(155) }, + { 3, "", 2, 2, "Offerta Cabinet", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 4, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(166), new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(167), 0, 3, 1, 2024, new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(164) }, + { 4, "", 2, 2, "Offerta Wall", "", 0.0, new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), 3, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(175), new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(177), 0, 4, 1, 2024, new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(174) } }); migrationBuilder.InsertData( @@ -1057,16 +1057,16 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "OfferRowID", "AwaitBom", "AwaitPrice", "BomCost", "BomOk", "BomPrice", "Envir", "FileName", "FileResource", "FileSize", "Inserted", "ItemBOM", "ItemOk", "ItemSteps", "Modified", "Note", "OfferID", "OfferRowUID", "Qty", "RowNum", "SellingItemID", "SerStruct", "StepCost", "StepPrice" }, values: new object[,] { - { 1, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(766), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(768), "Finestra Vetro Fisso 2025", 1, "SOR.25.00000001", 3.0, 1, 2, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0 }, - { 2, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(782), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(783), "Finestra Anta Singola 2025", 1, "SOR.25.00000002", 3.0, 1, 1, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"bIsSashVertical\":true,\"SashList\":[{\"nSashId\":1,\"OpeningType\":\"TILTTURN_LEFT\",\"bHasHandle\":true,\"dDimension\":100.0}],\"SashType\":\"NULL\",\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"Hardware\":\"000558\",\"IdGroup\":2,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":3,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"SASH\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0 }, - { 3, false, false, 160.0, true, 200.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(794), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(796), "Persiana per Finestra anta singola 2025", 1, "SOR.25.00000003", 3.0, 2, 2, "{}", 0.0, 0.0 }, - { 4, false, false, 200.0, true, 250.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(807), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(809), "Installazione serramento", 1, "SOR.25.00000004", 3.0, 3, 3, "{}", 0.0, 0.0 }, - { 5, false, false, 800.0, true, 1150.0, 2, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(840), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(842), "Demo file 01", 2, "SOR.25.00000005", 10.0, 1, 4, "", 0.0, 0.0 }, - { 6, false, false, 600.0, true, 950.0, 2, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(853), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(855), "Demo file 02", 2, "SOR.25.00000006", 4.0, 1, 4, "", 0.0, 0.0 }, - { 7, false, false, 200.0, true, 250.0, 3, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(884), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(886), "Demo file 01", 3, "SOR.25.00000007", 4.0, 1, 5, "", 0.0, 0.0 }, - { 8, false, false, 50.0, true, 80.0, 3, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(897), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(899), "Demo file 02", 3, "SOR.25.00000008", 12.0, 1, 5, "", 0.0, 0.0 }, - { 9, false, false, 800.0, true, 1150.0, 4, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(927), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(929), "Demo file 01", 4, "SOR.25.00000009", 6.0, 1, 6, "", 0.0, 0.0 }, - { 10, false, false, 600.0, true, 950.0, 4, "", "", 0L, new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(940), "", true, "{}", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(942), "Demo file 02", 4, "SOR.25.0000000A", 4.0, 1, 6, "", 0.0, 0.0 } + { 1, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(440), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(441), "Finestra Vetro Fisso 2025", 1, "SOR.25.00000001", 3.0, 2, 2, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0 }, + { 2, false, false, 900.0, true, 950.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(424), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(426), "Finestra Anta Singola 2025", 1, "SOR.25.00000002", 3.0, 1, 1, "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"bIsSashVertical\":true,\"SashList\":[{\"nSashId\":1,\"OpeningType\":\"TILTTURN_LEFT\",\"bHasHandle\":true,\"dDimension\":100.0}],\"SashType\":\"NULL\",\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"Hardware\":\"000558\",\"IdGroup\":2,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":3,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"SASH\"}],\"AreaType\":\"FRAME\"}]}", 0.0, 0.0 }, + { 3, false, false, 160.0, true, 200.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(452), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(454), "Persiana per Finestra anta singola 2025", 1, "SOR.25.00000003", 3.0, 3, 3, "{}", 0.0, 0.0 }, + { 4, false, false, 200.0, true, 250.0, 1, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(465), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(466), "Installazione serramento", 1, "SOR.25.00000004", 3.0, 4, 4, "{}", 0.0, 0.0 }, + { 5, false, false, 800.0, true, 1150.0, 2, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(499), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(501), "Demo file 01", 2, "SOR.25.00000005", 10.0, 1, 5, "", 0.0, 0.0 }, + { 6, false, false, 600.0, true, 950.0, 2, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(512), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(514), "Demo file 02", 2, "SOR.25.00000006", 4.0, 1, 5, "", 0.0, 0.0 }, + { 7, false, false, 200.0, true, 250.0, 3, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(543), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(545), "Demo file 01", 3, "SOR.25.00000007", 4.0, 1, 6, "", 0.0, 0.0 }, + { 8, false, false, 50.0, true, 80.0, 3, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(555), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(557), "Demo file 02", 3, "SOR.25.00000008", 12.0, 1, 6, "", 0.0, 0.0 }, + { 9, false, false, 800.0, true, 1150.0, 4, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(585), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(587), "Demo file 01", 4, "SOR.25.00000009", 6.0, 1, 7, "", 0.0, 0.0 }, + { 10, false, false, 600.0, true, 950.0, 4, "", "", 0L, new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(598), "", true, "{}", new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(600), "Demo file 02", 4, "SOR.25.0000000A", 4.0, 1, 7, "", 0.0, 0.0 } }); migrationBuilder.InsertData( @@ -1103,16 +1103,16 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "StockMovID", "CodDoc", "DtCreate", "MovCod", "Note", "QtyRec", "StockStatusId", "UnitVal", "UserId" }, values: new object[,] { - { 1, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(281), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" }, - { 2, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(335), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" }, - { 3, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(339), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" }, - { 4, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(343), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" }, - { 5, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(346), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" }, - { 6, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(350), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" }, - { 7, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(354), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" }, - { 8, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(357), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" }, - { 9, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(361), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" }, - { 10, "", new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(365), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" } + { 1, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9815), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" }, + { 2, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9879), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" }, + { 3, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9883), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" }, + { 4, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9886), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" }, + { 5, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9890), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" }, + { 6, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9894), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" }, + { 7, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9897), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" }, + { 8, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9901), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" }, + { 9, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9904), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" }, + { 10, "", new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9908), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" } }); migrationBuilder.InsertData( diff --git a/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs b/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs index b8064972..a41ef387 100644 --- a/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs +++ b/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs @@ -1249,13 +1249,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 1, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(608), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(610), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(143), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(144), OffertState = 0, RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(605) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(140) }, new { @@ -1269,13 +1269,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 2, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(622), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(624), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(156), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(157), OffertState = 0, RefNum = 2, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(621) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(155) }, new { @@ -1289,13 +1289,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 4, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(632), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(633), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(166), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(167), OffertState = 0, RefNum = 3, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(630) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(164) }, new { @@ -1309,13 +1309,13 @@ namespace EgwCoreLib.Lux.Data.Migrations DueDateProm = new DateTime(2025, 12, 20, 0, 0, 0, 0, DateTimeKind.Local), DueDateReq = new DateTime(2025, 11, 20, 0, 0, 0, 0, DateTimeKind.Local), Envir = 3, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(641), - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(643), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(175), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(177), OffertState = 0, RefNum = 4, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 11, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(640) + ValidUntil = new DateTime(2025, 11, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(174) }); }); @@ -1390,7 +1390,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("RowNum") .HasColumnType("int"); - b.Property("SellingItemID") + b.Property("SellingItemID") .HasColumnType("int"); b.Property("SerStruct") @@ -1412,33 +1412,6 @@ namespace EgwCoreLib.Lux.Data.Migrations b.ToTable("sales_offer_row"); b.HasData( - new - { - OfferRowID = 1, - AwaitBom = false, - AwaitPrice = false, - BomCost = 900.0, - BomOk = true, - BomPrice = 950.0, - Envir = 1, - FileName = "", - FileResource = "", - FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(766), - ItemBOM = "", - ItemOk = true, - ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(768), - Note = "Finestra Vetro Fisso 2025", - OfferID = 1, - OfferRowUID = "SOR.25.00000001", - Qty = 3.0, - RowNum = 1, - SellingItemID = 2, - SerStruct = "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", - StepCost = 0.0, - StepPrice = 0.0 - }, new { OfferRowID = 2, @@ -1451,11 +1424,11 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(782), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(424), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(783), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(426), Note = "Finestra Anta Singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000002", @@ -1467,6 +1440,33 @@ namespace EgwCoreLib.Lux.Data.Migrations StepPrice = 0.0 }, new + { + OfferRowID = 1, + AwaitBom = false, + AwaitPrice = false, + BomCost = 900.0, + BomOk = true, + BomPrice = 950.0, + Envir = 1, + FileName = "", + FileResource = "", + FileSize = 0L, + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(440), + ItemBOM = "", + ItemOk = true, + ItemSteps = "{}", + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(441), + Note = "Finestra Vetro Fisso 2025", + OfferID = 1, + OfferRowUID = "SOR.25.00000001", + Qty = 3.0, + RowNum = 2, + SellingItemID = 2, + SerStruct = "{\"ProfilePath\":\"Profilo78\",\"Material\":\"Abete\",\"ColorMaterial\":\"White\",\"Glass\":\"Vetro BE 2S 4/12/4\",\"AreaList\":[{\"Shape\":\"RECTANGLE\",\"DimensionList\":[{\"nIndex\":1,\"sName\":\"Width\",\"dValue\":800.0},{\"nIndex\":2,\"sName\":\"Height\",\"dValue\":1200.0}],\"JointList\":[{\"nIndex\":1,\"JointType\":\"FULL_H\"},{\"nIndex\":2,\"JointType\":\"FULL_H\"},{\"nIndex\":3,\"JointType\":\"FULL_H\"},{\"nIndex\":4,\"JointType\":\"FULL_H\"}],\"BottomRail\":false,\"BottomRailQty\":0,\"IdGroup\":1,\"AreaList\":[{\"FillType\":\"GLASS\",\"IdGroup\":4,\"AreaList\":[],\"AreaType\":\"FILL\"}],\"AreaType\":\"FRAME\"}]}", + StepCost = 0.0, + StepPrice = 0.0 + }, + new { OfferRowID = 3, AwaitBom = false, @@ -1478,17 +1478,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(794), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(452), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(796), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(454), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, OfferRowUID = "SOR.25.00000003", Qty = 3.0, - RowNum = 2, - SellingItemID = 2, + RowNum = 3, + SellingItemID = 3, SerStruct = "{}", StepCost = 0.0, StepPrice = 0.0 @@ -1505,17 +1505,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(807), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(465), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(809), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(466), Note = "Installazione serramento", OfferID = 1, OfferRowUID = "SOR.25.00000004", Qty = 3.0, - RowNum = 3, - SellingItemID = 3, + RowNum = 4, + SellingItemID = 4, SerStruct = "{}", StepCost = 0.0, StepPrice = 0.0 @@ -1532,17 +1532,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(840), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(499), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(842), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(501), Note = "Demo file 01", OfferID = 2, OfferRowUID = "SOR.25.00000005", Qty = 10.0, RowNum = 1, - SellingItemID = 4, + SellingItemID = 5, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1559,17 +1559,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(853), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(512), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(855), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(514), Note = "Demo file 02", OfferID = 2, OfferRowUID = "SOR.25.00000006", Qty = 4.0, RowNum = 1, - SellingItemID = 4, + SellingItemID = 5, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1586,17 +1586,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(884), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(543), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(886), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(545), Note = "Demo file 01", OfferID = 3, OfferRowUID = "SOR.25.00000007", Qty = 4.0, RowNum = 1, - SellingItemID = 5, + SellingItemID = 6, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1613,17 +1613,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(897), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(555), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(899), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(557), Note = "Demo file 02", OfferID = 3, OfferRowUID = "SOR.25.00000008", Qty = 12.0, RowNum = 1, - SellingItemID = 5, + SellingItemID = 6, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1640,17 +1640,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(927), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(585), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(929), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(587), Note = "Demo file 01", OfferID = 4, OfferRowUID = "SOR.25.00000009", Qty = 6.0, RowNum = 1, - SellingItemID = 6, + SellingItemID = 7, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1667,17 +1667,17 @@ namespace EgwCoreLib.Lux.Data.Migrations FileName = "", FileResource = "", FileSize = 0L, - Inserted = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(940), + Inserted = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(598), ItemBOM = "", ItemOk = true, ItemSteps = "{}", - Modified = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(942), + Modified = new DateTime(2025, 10, 21, 11, 14, 2, 982, DateTimeKind.Local).AddTicks(600), Note = "Demo file 02", OfferID = 4, OfferRowUID = "SOR.25.0000000A", Qty = 4.0, RowNum = 1, - SellingItemID = 6, + SellingItemID = 7, SerStruct = "", StepCost = 0.0, StepPrice = 0.0 @@ -1788,7 +1788,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Property("RowNum") .HasColumnType("int"); - b.Property("SellingItemID") + b.Property("SellingItemID") .HasColumnType("int"); b.Property("SerStruct") @@ -1868,8 +1868,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 1, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(281), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(332), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9815), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9876), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1881,8 +1881,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 2, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(335), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(337), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9879), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9881), MovCod = "CAR", Note = "DEMO", QtyRec = 8.0, @@ -1894,8 +1894,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 3, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(339), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(340), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9883), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9884), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1907,8 +1907,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 4, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(343), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(344), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9886), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9888), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1920,8 +1920,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 5, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(346), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(348), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9890), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9891), MovCod = "CAR", Note = "DEMO", QtyRec = 10.0, @@ -1933,8 +1933,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 6, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(350), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(351), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9894), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9895), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1946,8 +1946,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 7, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(354), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(355), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9897), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9898), MovCod = "CAR", Note = "DEMO", QtyRec = 50.0, @@ -1959,8 +1959,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 8, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(357), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(359), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9901), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9902), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1972,8 +1972,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 9, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(361), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(363), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9904), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9906), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1985,8 +1985,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 10, CodDoc = "", - DtCreate = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(365), - DtMod = new DateTime(2025, 10, 21, 9, 53, 0, 823, DateTimeKind.Local).AddTicks(366), + DtCreate = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9908), + DtMod = new DateTime(2025, 10, 21, 11, 14, 2, 981, DateTimeKind.Local).AddTicks(9909), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -2727,8 +2727,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.HasOne("EgwCoreLib.Lux.Data.DbModel.Items.SellingItemModel", "SellingItemNav") .WithMany() .HasForeignKey("SellingItemID") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.Navigation("OfferNav"); @@ -2773,8 +2772,7 @@ namespace EgwCoreLib.Lux.Data.Migrations b.HasOne("EgwCoreLib.Lux.Data.DbModel.Items.SellingItemModel", "SellingItemNav") .WithMany() .HasForeignKey("SellingItemID") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); + .OnDelete(DeleteBehavior.Restrict); b.Navigation("OrderNav"); diff --git a/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs b/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs index 6ac3f512..ad5d69ab 100644 --- a/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs +++ b/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs @@ -282,28 +282,28 @@ namespace EgwCoreLib.Lux.Data // inizializzazione dei valori di default x Offerta 1 = WINDOW modelBuilder.Entity().HasData( - new OfferRowModel { OfferRowID = 1, OfferID = 1, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, OfferRowUID = $"SOR.{DateTime.Today:yy}.{1:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 900, BomPrice = 950, SellingItemID = 2, Qty = 3, RowNum = 1, SerStruct = jwdVetroFisso, Note = "Finestra Vetro Fisso 2025", ItemSteps = "{}", BomOk = true, ItemOk = true }, new OfferRowModel { OfferRowID = 2, OfferID = 1, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, OfferRowUID = $"SOR.{DateTime.Today:yy}.{2:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 900, BomPrice = 950, SellingItemID = 1, Qty = 3, RowNum = 1, SerStruct = jwdAntaSingola, Note = "Finestra Anta Singola 2025", ItemSteps = "{}", BomOk = true, ItemOk = true }, - new OfferRowModel { OfferRowID = 3, OfferID = 1, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, OfferRowUID = $"SOR.{DateTime.Today:yy}.{3:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 160, BomPrice = 200, SellingItemID = 2, Qty = 3, RowNum = 2, SerStruct = "{}", Note = "Persiana per Finestra anta singola 2025", ItemSteps = "{}", BomOk = true, ItemOk = true }, - new OfferRowModel { OfferRowID = 4, OfferID = 1, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, OfferRowUID = $"SOR.{DateTime.Today:yy}.{4:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 200, BomPrice = 250, SellingItemID = 3, Qty = 3, RowNum = 3, SerStruct = "{}", Note = "Installazione serramento", ItemSteps = "{}", BomOk = true, ItemOk = true } + new OfferRowModel { OfferRowID = 1, OfferID = 1, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, OfferRowUID = $"SOR.{DateTime.Today:yy}.{1:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 900, BomPrice = 950, SellingItemID = 2, Qty = 3, RowNum = 2, SerStruct = jwdVetroFisso, Note = "Finestra Vetro Fisso 2025", ItemSteps = "{}", BomOk = true, ItemOk = true }, + new OfferRowModel { OfferRowID = 3, OfferID = 1, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, OfferRowUID = $"SOR.{DateTime.Today:yy}.{3:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 160, BomPrice = 200, SellingItemID = 3, Qty = 3, RowNum = 3, SerStruct = "{}", Note = "Persiana per Finestra anta singola 2025", ItemSteps = "{}", BomOk = true, ItemOk = true }, + new OfferRowModel { OfferRowID = 4, OfferID = 1, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, OfferRowUID = $"SOR.{DateTime.Today:yy}.{4:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 200, BomPrice = 250, SellingItemID = 4, Qty = 3, RowNum = 4, SerStruct = "{}", Note = "Installazione serramento", ItemSteps = "{}", BomOk = true, ItemOk = true } ); // inizializzazione dei valori di default x Offerta 2 = BEAM modelBuilder.Entity().HasData( - new OfferRowModel { OfferRowID = 5, OfferID = 2, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.BEAM, OfferRowUID = $"SOR.{DateTime.Today:yy}.{5:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 800, BomPrice = 1150, SellingItemID = 4, Qty = 10, RowNum = 1, SerStruct = "", Note = "Demo file 01", ItemSteps = "{}", BomOk = true, ItemOk = true }, - new OfferRowModel { OfferRowID = 6, OfferID = 2, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.BEAM, OfferRowUID = $"SOR.{DateTime.Today:yy}.{6:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 600, BomPrice = 950, SellingItemID = 4, Qty = 4, RowNum = 1, SerStruct = "", Note = "Demo file 02", ItemSteps = "{}", BomOk = true, ItemOk = true } + new OfferRowModel { OfferRowID = 5, OfferID = 2, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.BEAM, OfferRowUID = $"SOR.{DateTime.Today:yy}.{5:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 800, BomPrice = 1150, SellingItemID = 5, Qty = 10, RowNum = 1, SerStruct = "", Note = "Demo file 01", ItemSteps = "{}", BomOk = true, ItemOk = true }, + new OfferRowModel { OfferRowID = 6, OfferID = 2, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.BEAM, OfferRowUID = $"SOR.{DateTime.Today:yy}.{6:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 600, BomPrice = 950, SellingItemID = 5, Qty = 4, RowNum = 1, SerStruct = "", Note = "Demo file 02", ItemSteps = "{}", BomOk = true, ItemOk = true } ); // inizializzazione dei valori di default x Offerta 3 = CABINET modelBuilder.Entity().HasData( - new OfferRowModel { OfferRowID = 7, OfferID = 3, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WALL, OfferRowUID = $"SOR.{DateTime.Today:yy}.{7:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 200, BomPrice = 250, SellingItemID = 5, Qty = 4, RowNum = 1, SerStruct = "", Note = "Demo file 01", ItemSteps = "{}", BomOk = true, ItemOk = true }, - new OfferRowModel { OfferRowID = 8, OfferID = 3, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WALL, OfferRowUID = $"SOR.{DateTime.Today:yy}.{8:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 50, BomPrice = 80, SellingItemID = 5, Qty = 12, RowNum = 1, SerStruct = "", Note = "Demo file 02", ItemSteps = "{}", BomOk = true, ItemOk = true } + new OfferRowModel { OfferRowID = 7, OfferID = 3, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WALL, OfferRowUID = $"SOR.{DateTime.Today:yy}.{7:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 200, BomPrice = 250, SellingItemID = 6, Qty = 4, RowNum = 1, SerStruct = "", Note = "Demo file 01", ItemSteps = "{}", BomOk = true, ItemOk = true }, + new OfferRowModel { OfferRowID = 8, OfferID = 3, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WALL, OfferRowUID = $"SOR.{DateTime.Today:yy}.{8:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 50, BomPrice = 80, SellingItemID = 6, Qty = 12, RowNum = 1, SerStruct = "", Note = "Demo file 02", ItemSteps = "{}", BomOk = true, ItemOk = true } ); // inizializzazione dei valori di default x Offerta 4 = WALL modelBuilder.Entity().HasData( - new OfferRowModel { OfferRowID = 9, OfferID = 4, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.CABINET, OfferRowUID = $"SOR.{DateTime.Today:yy}.{9:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 800, BomPrice = 1150, SellingItemID = 6, Qty = 6, RowNum = 1, SerStruct = "", Note = "Demo file 01", ItemSteps = "{}", BomOk = true, ItemOk = true }, - new OfferRowModel { OfferRowID = 10, OfferID = 4, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.CABINET, OfferRowUID = $"SOR.{DateTime.Today:yy}.{10:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 600, BomPrice = 950, SellingItemID = 6, Qty = 4, RowNum = 1, SerStruct = "", Note = "Demo file 02", ItemSteps = "{}", BomOk = true, ItemOk = true } + new OfferRowModel { OfferRowID = 9, OfferID = 4, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.CABINET, OfferRowUID = $"SOR.{DateTime.Today:yy}.{9:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 800, BomPrice = 1150, SellingItemID = 7, Qty = 6, RowNum = 1, SerStruct = "", Note = "Demo file 01", ItemSteps = "{}", BomOk = true, ItemOk = true }, + new OfferRowModel { OfferRowID = 10, OfferID = 4, Envir = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.CABINET, OfferRowUID = $"SOR.{DateTime.Today:yy}.{10:X8}", Inserted = DateTime.Now, Modified = DateTime.Now, BomCost = 600, BomPrice = 950, SellingItemID = 7, Qty = 4, RowNum = 1, SerStruct = "", Note = "Demo file 02", ItemSteps = "{}", BomOk = true, ItemOk = true } ); } diff --git a/EgwCoreLib.Lux.Data/Services/BaseServ.cs b/EgwCoreLib.Lux.Data/Services/BaseServ.cs index ae8c8181..71dba4b3 100644 --- a/EgwCoreLib.Lux.Data/Services/BaseServ.cs +++ b/EgwCoreLib.Lux.Data/Services/BaseServ.cs @@ -14,12 +14,12 @@ using System.Threading.Tasks; namespace EgwCoreLib.Lux.Data.Services { /// - /// Classe base per i servizi che fornisce funzionalità comuni come + /// Classe base per i servizi che fornisce funzionalità comuni come /// - connessione a Redis /// - configurazione - /// - gestione dei messaggi - /// - strategie di caching. - /// + /// - gestione dei messaggi + /// - strategie di caching. + /// /// Questa classe agisce come modello per altri servizi derivati. /// public class BaseServ @@ -41,7 +41,11 @@ namespace EgwCoreLib.Lux.Data.Services // channel name setup svgChannel = _config.GetValue("ServerConf:SvgChannel") ?? "Egw:svg:img"; bomChannel = _config.GetValue("ServerConf:BomChannel") ?? "Egw:bom"; - updateChannel = _config.GetValue("ServerConf:UpdateChannel") ?? "Egw-update"; + updateChannel = _config.GetValue("ServerConf:UpdateChannel") ?? "Egw:update"; + shapeChannel = _config.GetValue("ServerConf:ShapeChannel") ?? "Egw:shape:curr"; + hwListChannel = _config.GetValue("ServerConf:HwListChannel") ?? "Egw:hw:list"; + hwOptChannel = _config.GetValue("ServerConf:HwOptChannel") ?? "Egw:hw:opt"; + profListChannel = _config.GetValue("ServerConf:ProfListChannel") ?? "Egw:prof:list"; // Appends ":*" to the channels to enable wildcard subscription for dynamic events if (!svgChannel.EndsWith(":*")) { @@ -55,6 +59,22 @@ namespace EgwCoreLib.Lux.Data.Services { updateChannel += ":*"; } + if (!shapeChannel.EndsWith(":*")) + { + shapeChannel += ":*"; + } + if (!hwListChannel.EndsWith(":*")) + { + hwListChannel += ":*"; + } + if (!hwOptChannel.EndsWith(":*")) + { + hwOptChannel += ":*"; + } + if (!profListChannel.EndsWith(":*")) + { + profListChannel += ":*"; + } // Configurazione serializzatore JSON per risolvere errore di loop circolare JSSettings = new JsonSerializerSettings() @@ -63,9 +83,13 @@ namespace EgwCoreLib.Lux.Data.Services }; // Configurazione pipe dei messaggi - CalcDonePipe = new MessagePipe(redisConn, svgChannel); - BomPipe = new MessagePipe(RedisConn, bomChannel); - UpdatePipe = new MessagePipe(RedisConn, updateChannel); + PipeSvg = new MessagePipe(redisConn, svgChannel); + PipeBom = new MessagePipe(RedisConn, bomChannel); + PipeUpdate = new MessagePipe(RedisConn, updateChannel); + PipeShape = new MessagePipe(RedisConn, shapeChannel); + PipeHwList = new MessagePipe(RedisConn, hwListChannel); + PipeHwOpt = new MessagePipe(RedisConn, hwOptChannel); + PipeProfList = new MessagePipe(RedisConn, profListChannel); } #endregion Public Constructors @@ -75,18 +99,41 @@ namespace EgwCoreLib.Lux.Data.Services /// /// Pipe dei messaggi per la comunicazione riguardo update calcolo BOM /// - public MessagePipe BomPipe { get; set; } = null!; + public MessagePipe PipeBom { get; set; } = null!; /// - /// Pipe dei messaggi per la comunicazione tra servizi di calcolo e interfaccia utente. - /// I messaggi vengono inviati sul canale Redis definito da svgChannel. + /// Pipe dei messaggi per ritorno HwList da Engine di calcolo verso interfaccia utente. + /// I messaggi vengono inviati sul canale Redis definito da HwListChannel. /// - public MessagePipe CalcDonePipe { get; set; } = null!; + public MessagePipe PipeHwList { get; set; } = null!; + /// + /// Pipe dei messaggi per ritorno HwOptions calcolate da Engine di calcolo verso interfaccia utente. + /// I messaggi vengono inviati sul canale Redis definito da HwOptChannel. + /// + public MessagePipe PipeHwOpt { get; set; } = null!; + + /// + /// Pipe dei messaggi per ritorno ProfileList calcolate da Engine di calcolo verso interfaccia utente. + /// I messaggi vengono inviati sul canale Redis definito da ProfListChannel. + /// + public MessagePipe PipeProfList { get; set; } = null!; + + /// + /// Pipe dei messaggi per ritorno Shape calcolate da Engine di calcolo verso interfaccia utente. + /// I messaggi vengono inviati sul canale Redis definito da ShapeChannel. + /// + public MessagePipe PipeShape { get; set; } = null!; + + /// + /// Pipe dei messaggi per ritorno SVG calcolati da Engine di calcolo verso interfaccia utente. + /// I messaggi vengono inviati sul canale Redis definito da SvgChannel. + /// + public MessagePipe PipeSvg { get; set; } = null!; /// /// Pipe dei messaggi per la comunicazione riguardo update generico UI /// - public MessagePipe UpdatePipe { get; set; } = null!; + public MessagePipe PipeUpdate { get; set; } = null!; #endregion Public Properties @@ -178,12 +225,31 @@ namespace EgwCoreLib.Lux.Data.Services /// private int cacheTtlShort = 60 * 1; + /// + /// Canale ritorno Hw List + /// + private string hwListChannel = ""; + /// + /// Canale ritorno Hw Options + /// + private string hwOptChannel = ""; + + /// + /// Canale ritorno Profile List + /// + private string profListChannel = ""; + /// /// Generatore di numeri casuali utilizzato per introdurre variabilità dinamica nelle durate della cache /// (simula variazioni reali nella freschezza dei dati e nei tempi di scadenza). /// private Random rnd = new Random(); + /// + /// Canale ritorno shape calcolate + /// + private string shapeChannel = ""; + /// /// Nome del canale Redis utilizzato per l'invio/ricezione di messaggi relativi a img svg. /// Predefinito a "svg:img" con suffisso ":*". diff --git a/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs b/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs index c7be39bf..2458baa7 100644 --- a/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs +++ b/EgwCoreLib.Lux.Data/Services/ConfigDataService.cs @@ -16,6 +16,7 @@ namespace EgwCoreLib.Lux.Data.Services { public class ConfigDataService : BaseServ { + #region Public Constructors public ConfigDataService(IConfiguration configuration, IConnectionMultiplexer RedisConn) : base(configuration, RedisConn) { @@ -23,11 +24,15 @@ namespace EgwCoreLib.Lux.Data.Services Log.Info($"ConfigDataService | Init OK"); } + #endregion Public Constructors + + #region Public Methods + /// - /// restituisce l'elenco dell'HW valido in memoria + /// Restituisce l'elenco dell'HW valido da cache REDIS /// /// - public List ElencoHw(Constants.EXECENVIRONMENTS execEnvironment, string HwReq = "HW.AGB") + public List HwModelList(Constants.EXECENVIRONMENTS execEnvironment, string HwReq = "HW.AGB") { List result = new List(); // leggo obj da redis cache @@ -38,16 +43,36 @@ namespace EgwCoreLib.Lux.Data.Services { var currList = JsonConvert.DeserializeObject>($"{rawData}"); result = currList ?? new List(); - //var currList = JsonConvert.DeserializeObject($"{rawData}"); - //if (currList != null && currList.ListItem != null) - //{ - // result = currList.ListItem; - //} } return result; } + /// + /// Restituisce l'elenco dei profili da cache REDIS + /// + /// + public List ProfileList(Constants.EXECENVIRONMENTS execEnvironment, string ProfReq = "Default") + { + List result = new List(); + // leggo obj da redis cache + var currKey = $"{redisBaseKey}:{execEnvironment}:PROFLIST:{ProfReq}"; + RedisValue rawData = redisDb.StringGet(currKey); + // prendo solo i valori validi (Description <> FamilyName) + if (rawData.HasValue) + { + var currList = JsonConvert.DeserializeObject>($"{rawData}"); + result = currList ?? new List(); + } + return result; + } + + #endregion Public Methods + + #region Private Fields + private static Logger Log = LogManager.GetCurrentClassLogger(); private string redisBaseKey = "Lux"; + + #endregion Private Fields } -} +} \ No newline at end of file diff --git a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs index 68ec8871..e1a67c73 100644 --- a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs +++ b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs @@ -155,6 +155,7 @@ namespace EgwCoreLib.Lux.Data.Services /// Elenco completo Config Profile /// /// + [Obsolete("Superato da gestione profili direttametne dal Calc")] public async Task> ConfProfileGetAllAsync() { string source = "DB"; @@ -853,7 +854,7 @@ namespace EgwCoreLib.Lux.Data.Services return fatto; } - + /// /// Effettua eliminazione della riga offerta /// @@ -1000,24 +1001,37 @@ namespace EgwCoreLib.Lux.Data.Services { try { - // salvo il set come oggetti deserializzati/testati? -#if false - // deserializzo la Bom... - var bomList = JsonConvert.DeserializeObject>(rawContent); - if (bomList != null) - { - // verifico 1:1 gli item ricevuti dalla BOM sul DB con eventuale insert - dbController.ItemUpsertFromBom(bomList); - // salvo la BOM nel record del DB relativo all'oggetto richiesto - dbController.OfferUpsertFromBom(uID, bomList); - } -#endif + // non effettuo salvataggio sul DB perché master del dato è esterno e lo lasceremo solo in cache REDIS + await Task.Delay(1); } catch { } } - await Task.Delay(1); } + + /// + /// Esegue salvataggio ProfileList sul DB + /// + /// UID dell'item offerta di cui si è ricevuto la BOM + /// Environment dell'item + /// HardwareModelList serializzata + /// + public async Task SaveProfileListAsync(string uID, Constants.EXECENVIRONMENTS execEnvironment, string rawContent) + { + // salvo sul DB il risultato della BOM + if (!string.IsNullOrEmpty(rawContent)) + { + try + { + // non effettuo salvataggio sul DB perché master del dato è esterno e lo lasceremo solo in cache REDIS + await Task.Delay(1); + } + catch { } + } + } + + + #endregion Public Methods #region Protected Fields diff --git a/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs b/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs index 20f1c660..26aed900 100644 --- a/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs +++ b/EgwCoreLib.Lux.Data/Services/ImageCacheService.cs @@ -21,12 +21,17 @@ namespace EgwCoreLib.Lux.Data.Services { _config = config; _redisService = redisService; - svgChannel = _config.GetValue("ServerConf:SvgChannel") ?? "svg:img"; + // conf channels x comunicazione broadcast + hwOptChannel = _config.GetValue("ServerConf:HwOptChannel") ?? "Egw:hw"; + svgChannel = _config.GetValue("ServerConf:SvgChannel") ?? "Egw:svg:img"; + bomChannel = _config.GetValue("ServerConf:BomChannel") ?? "Egw:bom"; + hmlChannel = _config.GetValue("ServerConf:HwListChannel") ?? "Egw:hml"; + profListChannel = _config.GetValue("ServerConf:ProfListChannel") ?? "Egw:prof"; + updateChannel = _config.GetValue("ServerConf:UpdateChannel") ?? "Egw:update"; + // conf tag x cache liveTag = _config.GetValue("ServerConf:ImageLiveTag") ?? "svg"; cacheTag = _config.GetValue("ServerConf:ImageFileTag") ?? "svgfile"; calcTag = _config.GetValue("ServerConf:ImageCalcTag") ?? "svg-preview"; - bomChannel = _config.GetValue("ServerConf:BomChannel") ?? "Egw-bom"; - updateChannel = _config.GetValue("ServerConf:UpdateChannel") ?? "Egw-update"; // verifico la url base apiUrl = _config.GetValue("ServerConf:Prog.ApiUrl") ?? "https://iis01.egalware.com/lux/srv/api"; imgBasePath = _config.GetValue("ServerConf:ImageBaseUrl") ?? "window"; @@ -118,7 +123,7 @@ namespace EgwCoreLib.Lux.Data.Services string tag = isLive ? liveTag : cacheTag; if (imgUID.EndsWith(".svg")) { - imgUID.Replace(".svg",""); + imgUID.Replace(".svg", ""); } string rndImg = $"{DateTime.Now:HHmmssfff}"; string fullUrl = $"{baseUrl}/{tag}/{imgUID}-{rndImg}.svg?envir={envir}".Replace("////", "//"); @@ -151,6 +156,23 @@ namespace EgwCoreLib.Lux.Data.Services return $"{rawVal}"; } + /// + /// Salva e invia su channel richiesto un update x UID + /// è attesao un refresh per chi sottoscrive il canale + /// + /// + /// + public async Task PublishUpdateAsync(string uid, Constants.EXECENVIRONMENTS env) + { + bool done = false; + // invio notifica sul canale di update generale... + string notifyChannel = $"{updateChannel}:{env}"; + // contenuto è UID + long numSent = await _redisService.PublishAsync(notifyChannel, $"{uid}"); + done = numSent > 0; + return done; + } + /// /// Calcola URL immagine dato /// @@ -188,24 +210,7 @@ namespace EgwCoreLib.Lux.Data.Services } /// - /// Salva e invia su channel richiesto un update x UID - /// è attesao un refresh per chi sottoscrive il canale - /// - /// - /// - public async Task PublishUpdateAsync(string uid, Constants.EXECENVIRONMENTS env) - { - bool done = false; - // invio notifica sul canale di update generale... - string notifyChannel = $"{updateChannel}:{env}"; - // contenuto è UID - long numSent = await _redisService.PublishAsync(notifyChannel, $"{uid}"); - done = numSent > 0; - return done; - } - - /// - /// Salva e invia su channel img redis SVG per il doc richiesto + /// Salva e invia su channel dedicato HML l'elenco degli HarwareModel (conf preferiti) gestiti /// /// /// @@ -220,6 +225,22 @@ namespace EgwCoreLib.Lux.Data.Services return done; } + /// + /// Salva e invia su channel profile list gestiti + /// + /// + /// + public async Task SaveProfileListAsync(string uid, Constants.EXECENVIRONMENTS env, string rawData) + { + // salvo img in cache + string currKey = $"{redisBaseKey}:{env}:PROFLIST:{uid.Replace("/", ":")}"; + var done = await _redisService.SetAsync(currKey, rawData); + // invio notifica nuova svg generata sul canale... viene inviato solo svg con ID nel canale + string notifyChannel = $"{profListChannel}:{uid}"; + long numSent = await _redisService.PublishAsync(notifyChannel, rawData); + return done; + } + /// /// Salva e invia su channel img redis SVG per il doc richiesto /// @@ -253,6 +274,23 @@ namespace EgwCoreLib.Lux.Data.Services long numSent = await _redisService.PublishAsync(notifyChannel, svgContent); return done; } + /// + /// Salva e invia su channel l'XML delle HW options per il doc richiesto + /// + /// + /// + /// + public async Task SaveHwOptAsync(string uid, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS env, string xmlContent) + { + // salvo img in cache + string currKey = $"{redisBaseKey}:{env}:HwOpt:{uid.Replace("/", ":")}"; + // lascio in cache 15 min x poterlo verificare + var done = await _redisService.SetAsync(currKey, xmlContent, TimeSpan.FromMinutes(15)); + // invio notifica nuova XML sul canale (inviato solo XML pulito con ID nel canale) + string notifyChannel = $"{hwOptChannel}:{uid}"; + long numSent = await _redisService.PublishAsync(notifyChannel, xmlContent); + return done; + } #endregion Public Methods @@ -265,15 +303,16 @@ namespace EgwCoreLib.Lux.Data.Services private readonly string apiUrl = ""; private readonly string bomChannel = "bom:item"; - private readonly string updateChannel = "ui:update"; private readonly string cacheTag = "svgfile"; private readonly string calcTag = "svgpreview"; private readonly string hmlChannel = "hml:item"; + private readonly string hwOptChannel = "hw:opt"; private readonly string imgBasePath = ""; private readonly string liveTag = "svg"; - + private readonly string profListChannel = "prof:list"; + private readonly string shapeChannel = "shape:curr"; private readonly string svgChannel = "svg:img"; - + private readonly string updateChannel = "ui:update"; private IConfiguration _config; private string imageBaseUrl = ""; diff --git a/Lux.API/Controllers/GenericController.cs b/Lux.API/Controllers/GenericController.cs index 9ff26c35..048c9b62 100644 --- a/Lux.API/Controllers/GenericController.cs +++ b/Lux.API/Controllers/GenericController.cs @@ -1,4 +1,5 @@ -using EgwCoreLib.Lux.Core.RestPayload; +using Egw.Window.Data; +using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.Services; using EgwMultiEngineManager.Data; using Microsoft.AspNetCore.Mvc; @@ -45,7 +46,11 @@ namespace Lux.API.Controllers // controllo se mancassero parametri... if (!DictExec.ContainsKey("Mode")) { - DictExec.Add("Mode", "1"); + DictExec.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}"); + } + if (!DictExec.ContainsKey("SubMode")) + { + DictExec.Add("SubMode", $"{(int)Enums.QuestionConfSubModes.NULL}"); } if (!DictExec.ContainsKey("UID")) { @@ -84,7 +89,7 @@ namespace Lux.API.Controllers { Dictionary DictExec = new Dictionary(); // cablata la BOM - DictExec.Add("Mode", "2"); + DictExec.Add("Mode", $"{(int)Enums.QuestionModes.BOM}"); // UID cablato x ora... DictExec.Add("UID", id); DictExec.Add("Jwd", currSer); diff --git a/Lux.API/Controllers/WindowController.cs b/Lux.API/Controllers/WindowController.cs index ba65ee5f..479b52aa 100644 --- a/Lux.API/Controllers/WindowController.cs +++ b/Lux.API/Controllers/WindowController.cs @@ -1,4 +1,5 @@ -using EgwCoreLib.Lux.Core; +using Egw.Window.Data; +using EgwCoreLib.Lux.Core; using EgwCoreLib.Lux.Data.DbModel.Config; using EgwCoreLib.Lux.Data.Services; using EgwMultiEngineManager.Data; @@ -60,7 +61,7 @@ namespace Lux.API.Controllers if (!string.IsNullOrEmpty(currJwd)) { Dictionary DictExec = new Dictionary(); - DictExec.Add("Mode", "2"); + DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.BOM}"); // UID cablato x ora... DictExec.Add("UID", id); DictExec.Add("Jwd", currJwd); @@ -102,11 +103,11 @@ namespace Lux.API.Controllers private async Task sendHwReq() { Dictionary DictExec = new Dictionary(); - DictExec.Add("Mode", $"{(int)Enums.EngineQueryType.HardwareModelList}"); + DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.HARDWARE}"); // da rivedere? DictExec.Add("UID", "HW.AGB"); - DictExec.Add("SubMode", $"{(int)Enums.EngineSubMode.LIST}"); - DictExec.Add("Manufacturer", $"{(int)Enums.EngineHwManufacturers.AGB}"); + DictExec.Add("SubMode", $"{(int)Egw.Window.Data.Enums.QuestionHwSubModes.LIST}"); + DictExec.Add("Manufacturer", $"{(int)Egw.Window.Data.Enums.HardwareManufacturers.AGB}"); int nId = 1; // da modificare con tipo richiesta... QuestionDTO currArgs = new QuestionDTO(nId, EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, DictExec); @@ -127,7 +128,7 @@ namespace Lux.API.Controllers Stopwatch sw = new Stopwatch(); sw.Start(); string hwReq = id ?? "HW.AGB"; - var answ = _confService.ElencoHw(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, hwReq); + var answ = _confService.HwModelList(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, hwReq); if (answ == null || answ.Count == 0) { await sendHwReq(); @@ -238,7 +239,7 @@ namespace Lux.API.Controllers if (!string.IsNullOrEmpty(currJwd)) { Dictionary DictExec = new Dictionary(); - DictExec.Add("Mode", "1"); + DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.PREVIEW}"); // UID cablato x ora... DictExec.Add("UID", id); DictExec.Add("Jwd", currJwd); diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 66cd3fbd..9b1d0a0b 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 0.9.2510.2109 + 0.9.2510.2211 diff --git a/Lux.API/Services/ExternalMessageProcessor.cs b/Lux.API/Services/ExternalMessageProcessor.cs index dd41589f..06b671b6 100644 --- a/Lux.API/Services/ExternalMessageProcessor.cs +++ b/Lux.API/Services/ExternalMessageProcessor.cs @@ -43,34 +43,82 @@ namespace Lux.API.Services { if (retData.Args != null && retData.Args.Count > 0) { + /*------------------------------------------ + * Richieste "continue" di stato/update * + * ----------------------------------------*/ + + // gestione ritorno preview SVG if (retData.Args.ContainsKey("Svg")) { - // dovrei leggere dagli args l'IUID dell'SVG ritornato... - // salvo SVG - string newSvg = retData.Args["Svg"]; + // recupero UID ed SVG string UID = retData.Args["UID"]; + string newSvg = retData.Args["Svg"]; + // reinvio in redis (cache + channel) await cacheService.SaveSvgAsync(UID, retData.ExecEnvironment, newSvg); } + + // gesitone ritorno BOM if (retData.Args.ContainsKey("BOM")) { - string newBom = retData.Args["BOM"]; + // recupero UID e BOM string UID = retData.Args["UID"]; - // salvo BOM ricevuta RAW in redis + string newBom = retData.Args["BOM"]; + // salvo BOM ricevuta RAW in redis (cache) await cacheService.SaveBomAsync(UID, retData.ExecEnvironment, newBom); // salvo la BOM completa con i dati recuperati dal DB await dbService.SaveBomAsync(UID, retData.ExecEnvironment, newBom); - - // pubblico refresh info così da segnalare richeista di update conseguente + // pubblico refresh info così da segnalare richiesta di update conseguente await cacheService.PublishUpdateAsync(UID, retData.ExecEnvironment); } + + // gestione ritorno tipo Shape + if (retData.Args.ContainsKey("SashShape")) + { + //// salvo HardwareList ricevuta + //string profList = retData.Args["HardwareModelList"]; + //string UID = retData.Args["UID"]; + //await cacheService.SaveHmlAsync(UID, retData.ExecEnvironment, profList); + //await dbService.SaveHmlAsync(UID, retData.ExecEnvironment, profList); + } + + // gestione ritorno opzioni HW + if (retData.Args.ContainsKey("HardwareOptions")) + { + // recupero UID ed SVG + string UID = retData.Args["UID"]; + string newHwOpt = retData.Args["HardwareOptions"]; + // reinvio in redis (cache + channel) + await cacheService.SaveHwOptAsync(UID, retData.ExecEnvironment, newHwOpt); + } + + + /*------------------------------------------ + * Richieste "one shot" di configurazione + * - fare 1/gg o su richiesta utente + * ----------------------------------------*/ + + // Gestione ritorno lista preferiti HW (ammissibili) if (retData.Args.ContainsKey("HardwareModelList")) { - // salvo HardwareList ricevuta - string newHml = retData.Args["HardwareModelList"]; + // recupero UID e lista preferiti HW string UID = retData.Args["UID"]; + string newHml = retData.Args["HardwareModelList"]; + // salvo HardwareList ricevuta await cacheService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml); await dbService.SaveHmlAsync(UID, retData.ExecEnvironment, newHml); } + + // gestione ritorno lista profili VALIDI per JWD + if (retData.Args.ContainsKey("ProfileList")) + { + // recupero UID e elenco profili validi + string UID = retData.Args["UID"]; + string profList = retData.Args["ProfileList"]; + // salvo ProfileList ricevuta + await cacheService.SaveProfileListAsync(UID, retData.ExecEnvironment, profList); + await dbService.SaveProfileListAsync(UID, retData.ExecEnvironment, profList); + } + } } } diff --git a/Lux.API/appsettings.Development.json b/Lux.API/appsettings.Development.json index e186d4f6..5da17538 100644 --- a/Lux.API/appsettings.Development.json +++ b/Lux.API/appsettings.Development.json @@ -7,8 +7,8 @@ }, "ServerConf": { "BaseUrl": "/lux/srv/", - "PubChannel": "EgwDevEngineInput", - "SubChannel": "EgwDevEngineOutput", + //"PubChannel": "EgwDevEngineInput", + //"SubChannel": "EgwDevEngineOutput", "ImageBaseUrl": "https://iis01.egalware.com/lux/srv/api/window/" } } diff --git a/Lux.API/appsettings.json b/Lux.API/appsettings.json index 827253c5..fe1e88e4 100644 --- a/Lux.API/appsettings.json +++ b/Lux.API/appsettings.json @@ -59,10 +59,15 @@ "PubChannel": "EgwEngineInput", "SubChannel": "EgwEngineOutput", "SvgChannel": "Egw:svg:img", + "ShapeChannel": "Egw:shape:curr", + "HwListChannel": "Egw:hw:list", + "HwOptChannel": "Egw:hw:opt", + "ProfListChannel": "Egw:prof:list", "BomChannel": "Egw:bom", "UpdateChannel": "Egw:update", "BaseUrl": "/lux/srv/", "ImageBaseUrl": "https://iis01.egalware.com/lux/srv/api/window/", + "ImageCalcTag": "svg-preview", "ImageLiveTag": "svg", "ImageFileTag": "svgfile" } diff --git a/Lux.UI.Client/Lux.UI.Client.csproj b/Lux.UI.Client/Lux.UI.Client.csproj index 5a9cb290..46fe6e3e 100644 --- a/Lux.UI.Client/Lux.UI.Client.csproj +++ b/Lux.UI.Client/Lux.UI.Client.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/Lux.UI/Components/Compo/Config/HardwareMan.razor b/Lux.UI/Components/Compo/Config/HardwareMan.razor index 4b250fb1..9d40f7fe 100644 --- a/Lux.UI/Components/Compo/Config/HardwareMan.razor +++ b/Lux.UI/Components/Compo/Config/HardwareMan.razor @@ -1,8 +1,13 @@ 
-
+
-
-
Conf. Hardware
+
+
+
Conf. Hardware
+
+
+ +
@@ -10,7 +15,7 @@
- +
@@ -31,8 +36,8 @@ - @* *@ diff --git a/Lux.UI/Components/Compo/Config/HardwareMan.razor.cs b/Lux.UI/Components/Compo/Config/HardwareMan.razor.cs index 475beebb..98252058 100644 --- a/Lux.UI/Components/Compo/Config/HardwareMan.razor.cs +++ b/Lux.UI/Components/Compo/Config/HardwareMan.razor.cs @@ -1,17 +1,42 @@ +using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.DbModel.Config; +using EgwCoreLib.Lux.Data.DbModel.Sales; using EgwCoreLib.Lux.Data.Services; +using EgwMultiEngineManager.Data; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; +using System.Threading.Tasks; namespace Lux.UI.Components.Compo.Config { - public partial class HardwareMan + public partial class HardwareMan : IDisposable { + #region Public Methods + + /// + /// Dispose sottoscrizione canale + /// + public void Dispose() + { + DLService.PipeHwList.EA_NewMessage -= PipeHwList_EA_NewMessage; + } + + #endregion Public Methods + #region Protected Properties [Inject] protected ConfigDataService CDService { get; set; } = null!; + [Inject] + protected IConfiguration Config { get; set; } = null!; + + [Inject] + protected CalcRequestService CService { get; set; } = null!; + + [Inject] + protected DataLayerServices DLService { get; set; } = null!; + [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; @@ -34,21 +59,20 @@ namespace Lux.UI.Components.Compo.Config #region Protected Methods /// - /// Reset selezione + /// Richiesta update elenco HW preferiti/configurati /// - protected void DoReset() + protected async Task DoReqUpdate() { - EditRecord = null; - SelRecord = null; + // chiamata richiesta update da calc + await callRefreshHwList(confHw); } - /// - /// Selezione articolo x display info - /// - /// - protected void DoSelect(HardwareModel curRec) + protected override void OnInitialized() { - SelRecord = curRec; + apiUrl = Config.GetValue("ServerConf:Prog.ApiUrl") ?? ""; + genericBasePath = Config.GetValue("ServerConf:GenericBaseUrl") ?? ""; + calcTag = Config.GetValue("ServerConf:CalcTag") ?? "calc"; + DLService.PipeHwList.EA_NewMessage += PipeHwList_EA_NewMessage; } protected override void OnParametersSet() @@ -79,80 +103,85 @@ namespace Lux.UI.Components.Compo.Config #region Private Fields private List AllRecords = new(); + + private string apiUrl = ""; + + private string calcTag = "calc"; + + /// + /// Conf HW corrente (produttore) - gestire con conf? + /// + private string confHw = "HW.AGB"; + private int currPage = 1; - private HardwareModel? EditRecord = null; + + private string genericBasePath = "generic"; + private bool isLoading = false; + private List ListRecords = new(); + private int numRecord = 5; - private HardwareModel? SelRecord = null; + private int totalCount = 0; #endregion Private Fields #region Private Properties + private string btnResetCss + { + get => string.IsNullOrEmpty(searchVal) ? "btn-outline-light" : "btn-primary"; + } + private string searchVal { get; set; } = string.Empty; #endregion Private Properties -#if false - /// - /// impossta record x eliminazione - /// - /// - protected async Task DoDelete(HardwareModel selRec) - { - if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il record? Dettagli: {selRec.HardwareID} | {selRec.Description} | {selRec.Thickness}")) - return; - - // esegue eliminazione del record... - await CDService.ConfHardwareDeleteAsync(selRec); - - EditRecord = null; - SelRecord = null; - await ReloadData(); - UpdateTable(); - } - - /// - /// Edit articolo selezionato - /// - /// - protected void DoEdit(HardwareModel curRec) - { - EditRecord = curRec; - } -#endif -#if false - private async Task DoAdd() - { - // aggiungo un nuovo record in coda... - EditRecord = new HardwareModel() - { - Description = "New Glass", - Code = "", - Thickness = 30 - }; - await DoSave(EditRecord); - } - - private async Task DoSave(HardwareModel currRec) - { - // salvo - await CDService.ConfHardwareUpsertAsync(currRec); - await ResetEdit(); - UpdateTable(); - EditRecord = null; - SelRecord = null; - } -#endif - #region Private Methods + /// + /// Effettua vera richiesta della BOM + /// + /// + /// + private async Task callRefreshHwList(string reqUid) + { + Dictionary DictExec = new Dictionary(); + DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.HARDWARE}"); + // da rivedere? + DictExec.Add("UID", reqUid); + DictExec.Add("SubMode", $"{(int)Egw.Window.Data.Enums.QuestionHwSubModes.LIST}"); + DictExec.Add("Manufacturer", $"{(int)Egw.Window.Data.Enums.HardwareManufacturers.AGB}"); + CalcRequestDTO req = new CalcRequestDTO() + { + EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, + DictExec = DictExec + }; + // svuotiamo cache dati... + AllRecords = new List(); + isLoading = true; + + // chiamo la chiamata POST alla API, che manda la richiesta via REDIS + await CService.CallRestPost($"{apiUrl}/{genericBasePath}", $"{calcTag}/{reqUid}", req); + } + + /// + /// Ricevuto update da Calc x elenco HW: aggiorno! + /// + /// + /// + private void PipeHwList_EA_NewMessage(object? sender, EventArgs e) + { + ReloadData(); + UpdateTable(); + _ = InvokeAsync(StateHasChanged); + } + private void ReloadData() { isLoading = true; - AllRecords = CDService.ElencoHw(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, "HW.AGB"); + AllRecords = CDService.HwModelList(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, confHw); // se ho ricerca testuale faccio filtro ulteriore... if (string.IsNullOrEmpty(SearchVal)) { @@ -172,15 +201,6 @@ namespace Lux.UI.Components.Compo.Config totalCount = AllRecords.Count; } -#if false - private void ResetEdit() - { - // reset edit - EditRecord = null; - ReloadData(); - } -#endif - /// /// Filtro e paginazione /// diff --git a/Lux.UI/Components/Compo/Config/ProfileMan.razor b/Lux.UI/Components/Compo/Config/ProfileMan.razor index 7830abbc..af861de3 100644 --- a/Lux.UI/Components/Compo/Config/ProfileMan.razor +++ b/Lux.UI/Components/Compo/Config/ProfileMan.razor @@ -1,8 +1,13 @@ 
-
+
-
-
Conf. Profilo
+
+
+
Conf. Profilo
+
+
+ +
@@ -10,7 +15,7 @@
- +
@@ -31,16 +36,7 @@
- + + Cod. IDFam.
- - @* *@ - - - @@ -48,20 +44,7 @@ @foreach (var item in ListRecords) { - - - - - + } diff --git a/Lux.UI/Components/Compo/Config/ProfileMan.razor.cs b/Lux.UI/Components/Compo/Config/ProfileMan.razor.cs index dd879512..4f2def61 100644 --- a/Lux.UI/Components/Compo/Config/ProfileMan.razor.cs +++ b/Lux.UI/Components/Compo/Config/ProfileMan.razor.cs @@ -1,14 +1,37 @@ +using EgwCoreLib.Lux.Core.RestPayload; using EgwCoreLib.Lux.Data.DbModel.Config; using EgwCoreLib.Lux.Data.Services; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; +using System.ComponentModel; namespace Lux.UI.Components.Compo.Config { - public partial class ProfileMan + public partial class ProfileMan : IDisposable { + #region Public Methods + + /// + /// Dispose sottoscrizione canale + /// + public void Dispose() + { + DLService.PipeProfList.EA_NewMessage -= PipeProfList_EA_NewMessage; + } + + #endregion Public Methods + #region Protected Properties + [Inject] + protected ConfigDataService CDService { get; set; } = null!; + + [Inject] + protected IConfiguration Config { get; set; } = null!; + + [Inject] + protected CalcRequestService CService { get; set; } = null!; + [Inject] protected DataLayerServices DLService { get; set; } = null!; @@ -23,7 +46,7 @@ namespace Lux.UI.Components.Compo.Config if (searchVal != value) { searchVal = value; - _ = FullUpdate(); + FullUpdate(); } } } @@ -33,52 +56,25 @@ namespace Lux.UI.Components.Compo.Config #region Protected Methods /// - /// impossta record x eliminazione + /// Richiesta update elenco HW preferiti/configurati /// - /// - protected async Task DoDelete(ProfileModel selRec) + protected async Task DoReqUpdate() { - if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il record? Dettagli: {selRec.ProfileID} | {selRec.Description} | {selRec.Thickness}")) - return; - - // esegue eliminazione del record... - await DLService.ConfProfileDeleteAsync(selRec); - - EditRecord = null; - SelRecord = null; - await ReloadData(); - UpdateTable(); + // chiamata richiesta update da calc + await callRefreshProfList(); } - /// - /// Edit articolo selezionato - /// - /// - protected void DoEdit(ProfileModel curRec) + protected override void OnInitialized() { - EditRecord = curRec; + apiUrl = Config.GetValue("ServerConf:Prog.ApiUrl") ?? ""; + genericBasePath = Config.GetValue("ServerConf:GenericBaseUrl") ?? ""; + calcTag = Config.GetValue("ServerConf:CalcTag") ?? "calc"; + DLService.PipeProfList.EA_NewMessage += PipeProfList_EA_NewMessage; } - /// - /// Reset selezione - /// - protected void DoReset() + protected override void OnParametersSet() { - EditRecord = null; - } - - /// - /// Selezione articolo x display info - /// - /// - protected void DoSelect(ProfileModel curRec) - { - SelRecord = curRec; - } - - protected override async Task OnParametersSetAsync() - { - await ReloadData(); + ReloadData(); UpdateTable(); } @@ -103,84 +99,108 @@ namespace Lux.UI.Components.Compo.Config #region Private Fields - private List AllRecords = new(); + private List AllRecords = new(); + + private string apiUrl = ""; + + private string calcTag = "calc"; + + /// + /// Per eventuale gestione multi-profilo su multi tenant + /// + private string confProf = "Default"; + private int currPage = 1; - private ProfileModel? EditRecord = null; + + private string genericBasePath = "generic"; + private bool isLoading = false; - private List ListRecords = new(); + + private List ListRecords = new(); + private int numRecord = 5; - private ProfileModel? SelRecord = null; + private int totalCount = 0; #endregion Private Fields #region Private Properties + private string btnResetCss + { + get => string.IsNullOrEmpty(searchVal) ? "btn-outline-light" : "btn-primary"; + } + private string searchVal { get; set; } = string.Empty; #endregion Private Properties #region Private Methods - private async Task DoAdd() + /// + /// Effettua vera richiesta della BOM + /// + /// + private async Task callRefreshProfList() { - // aggiungo un nuovo record in coda... - EditRecord = new ProfileModel() + Dictionary DictExec = new Dictionary(); + DictExec.Add("Mode", $"{(int)Egw.Window.Data.Enums.QuestionModes.CONFIG}"); + // preparo args + string reqUid = "Default"; + DictExec.Add("UID", reqUid); + DictExec.Add("SubMode", $"{(int)Egw.Window.Data.Enums.QuestionConfSubModes.PROFILELIST}"); + CalcRequestDTO req = new CalcRequestDTO() { - Description = "New Glass", - Code = "", - Thickness = 30 + EnvType = EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, + DictExec = DictExec }; - await DoSave(EditRecord); + // svuotiamo cache dati... + AllRecords = new List(); + isLoading = true; + + // chiamo la chiamata POST alla API, che manda la richiesta via REDIS + await CService.CallRestPost($"{apiUrl}/{genericBasePath}", $"{calcTag}/{reqUid}", req); } - private async Task DoSave(ProfileModel currRec) + private void FullUpdate() { - // salvo - await DLService.ConfProfileUpsertAsync(currRec); - await ResetEdit(); + ReloadData(); UpdateTable(); - EditRecord = null; - SelRecord = null; } - private async Task FullUpdate() + /// + /// Ricevuto update da Calc x elenco profili: aggiorno! + /// + /// + /// + private void PipeProfList_EA_NewMessage(object? sender, EventArgs e) { - await ReloadData(); - UpdateTable(); - await InvokeAsync(StateHasChanged); + FullUpdate(); + _ = InvokeAsync(StateHasChanged); } - private async Task ReloadData() + private void ReloadData() { isLoading = true; - AllRecords = await DLService.ConfProfileGetAllAsync(); + + AllRecords = CDService.ProfileList(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, confProf); // se ho ricerca testuale faccio filtro ulteriore... if (string.IsNullOrEmpty(SearchVal)) { AllRecords = AllRecords - .OrderBy(x => x.Description) + .OrderBy(x => x) .ToList(); } else { AllRecords = AllRecords - .Where(x => - x.Description.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase) || - x.Code.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase)) - .OrderBy(x => x.Description) + .Where(x => x.Contains(SearchVal, StringComparison.InvariantCultureIgnoreCase)) + .OrderBy(x => x) .ToList(); } totalCount = AllRecords.Count; } - private async Task ResetEdit() - { - // reset edit - EditRecord = null; - await ReloadData(); - } - /// /// Filtro e paginazione /// diff --git a/Lux.UI/Components/Compo/OfferCommonPar.razor.cs b/Lux.UI/Components/Compo/OfferCommonPar.razor.cs index fdd8684a..40757b5d 100644 --- a/Lux.UI/Components/Compo/OfferCommonPar.razor.cs +++ b/Lux.UI/Components/Compo/OfferCommonPar.razor.cs @@ -22,6 +22,9 @@ namespace Lux.UI.Components.Compo #region Protected Properties + [Inject] + protected ConfigDataService CDService { get; set; } = null!; + [Inject] protected DataLayerServices DLService { get; set; } = null!; @@ -73,7 +76,7 @@ namespace Lux.UI.Components.Compo // leggo dati di base var AllColors = await DLService.GenValGetFiltAsync("WoodCol"); var AllConfGlass = await DLService.ConfGlassGetAllAsync(); - var AllConfProfile = await DLService.ConfProfileGetAllAsync(); + var AllConfProfile = CDService.ProfileList(EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS.WINDOW, "Default"); var AllConfWood = await DLService.ConfWoodGetAllAsync(); // conversione tipi ListColors = AllColors @@ -82,9 +85,7 @@ namespace Lux.UI.Components.Compo ListGlass = AllConfGlass .Select(x => x.Description) .ToList(); - ListProfiles = AllConfProfile - .Select(x => x.Description) - .ToList(); + ListProfiles = AllConfProfile; ListWood = AllConfWood .Select(x => x.Description) .ToList(); diff --git a/Lux.UI/Components/Compo/OfferDelivery.razor b/Lux.UI/Components/Compo/OfferDelivery.razor new file mode 100644 index 00000000..c4719fda --- /dev/null +++ b/Lux.UI/Components/Compo/OfferDelivery.razor @@ -0,0 +1,34 @@ +
+ @if (isLoading) + { + + } + else + { + +
+
+ + +
+@*
+
*@ +
+ + +
+
+
+
+
- - IDCod.DescrizioneSize mm - -
@item.ProfileID@item.Code@item.Description@($"{item.Thickness:N2}") - @if (false) - { - - } - else - { - - } - @item