diff --git a/EgwCoreLib.Lux.Core/Enum.cs b/EgwCoreLib.Lux.Core/Enums.cs similarity index 98% rename from EgwCoreLib.Lux.Core/Enum.cs rename to EgwCoreLib.Lux.Core/Enums.cs index 31ed9df..c9e7706 100644 --- a/EgwCoreLib.Lux.Core/Enum.cs +++ b/EgwCoreLib.Lux.Core/Enums.cs @@ -1,6 +1,6 @@ namespace EgwCoreLib.Lux.Core { - public class Enum + public class Enums { public enum OfferStates { diff --git a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs index 0acb967..4188cac 100644 --- a/EgwCoreLib.Lux.Data/Controllers/LuxController.cs +++ b/EgwCoreLib.Lux.Data/Controllers/LuxController.cs @@ -91,7 +91,11 @@ namespace EgwCoreLib.Lux.Data.Controllers } return dbResult; } - + /// + /// Elenco item da ricerca + /// + /// + /// public List ItemGetSearch(string term) { List dbResult = new List(); @@ -112,7 +116,55 @@ namespace EgwCoreLib.Lux.Data.Controllers } return dbResult; } + /// + /// Elenco item da ricerca async + /// + /// + /// + public async Task> ItemGetSearchAsync(string term) + { + List dbResult = new List(); + //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) + using (DataLayerContext dbCtx = new DataLayerContext()) + { + try + { + dbResult = await dbCtx + .DbSetItem + .Where(x => x.Description.Contains(term) || string.IsNullOrEmpty(term)) + .ToListAsync(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante ItemGetSearchAsync{Environment.NewLine}{exc}"); + } + } + return dbResult; + } + /// + /// Elenco completo ItemGroup gestiti async + /// + /// + public async Task> ItemGroupGetAllAsync() + { + List dbResult = new List(); + //using (DataLayerContext dbCtx = new DataLayerContext(configuration)) + using (DataLayerContext dbCtx = new DataLayerContext()) + { + try + { + dbResult = await dbCtx + .DbSetItemGroup + .ToListAsync(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante ItemGroupGetAllAsync{Environment.NewLine}{exc}"); + } + } + return dbResult; + } /// /// Elenco completo ItemGroup gestiti /// @@ -131,7 +183,7 @@ namespace EgwCoreLib.Lux.Data.Controllers } catch (Exception exc) { - Log.Error($"Eccezione durante ItemGroupGetAll{Environment.NewLine}{exc}"); + Log.Error($"Eccezione durante ItemGroupGetAllAsync{Environment.NewLine}{exc}"); } } return dbResult; @@ -204,7 +256,7 @@ namespace EgwCoreLib.Lux.Data.Controllers ItemModel newRec = new ItemModel() { CodGroup = item.ClassCode, - ItemType = Core.Enum.ItemClassType.Bom, + ItemType = Core.Enums.ItemClassType.Bom, IsService = false, // da calcolare meglio x gruppo ItemCode = 0, @@ -314,7 +366,7 @@ namespace EgwCoreLib.Lux.Data.Controllers // recupero il subset item da BOM / BomAlt... var bomGenList = dbCtx .DbSetItem - .Where(x => (x.ItemType == Core.Enum.ItemClassType.Bom || x.ItemType == Core.Enum.ItemClassType.BomAlt)) + .Where(x => (x.ItemType == Core.Enums.ItemClassType.Bom || x.ItemType == Core.Enums.ItemClassType.BomAlt)) .ToList(); // ciclo! @@ -412,7 +464,7 @@ namespace EgwCoreLib.Lux.Data.Controllers // recupero il subset item da BOM... var bomGenList = dbCtx .DbSetItem - .Where(x => x.ItemType == Core.Enum.ItemClassType.Bom) + .Where(x => x.ItemType == Core.Enums.ItemClassType.Bom) .ToList(); // calcolo il NUOVO costo e lo aggiorno... diff --git a/EgwCoreLib.Lux.Data/DbModel/ItemModel.cs b/EgwCoreLib.Lux.Data/DbModel/ItemModel.cs index 3d502d9..71e877b 100644 --- a/EgwCoreLib.Lux.Data/DbModel/ItemModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/ItemModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using static EgwCoreLib.Lux.Core.Enum; +using static EgwCoreLib.Lux.Core.Enums; namespace EgwCoreLib.Lux.Data.DbModel { diff --git a/EgwCoreLib.Lux.Data/DbModel/OfferModel.cs b/EgwCoreLib.Lux.Data/DbModel/OfferModel.cs index e061684..36406cd 100644 --- a/EgwCoreLib.Lux.Data/DbModel/OfferModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/OfferModel.cs @@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -using static EgwCoreLib.Lux.Core.Enum; +using static EgwCoreLib.Lux.Core.Enums; namespace EgwCoreLib.Lux.Data.DbModel { diff --git a/EgwCoreLib.Lux.Data/DbModel/OrderModel.cs b/EgwCoreLib.Lux.Data/DbModel/OrderModel.cs index 50838a1..cc544a5 100644 --- a/EgwCoreLib.Lux.Data/DbModel/OrderModel.cs +++ b/EgwCoreLib.Lux.Data/DbModel/OrderModel.cs @@ -6,7 +6,7 @@ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -using static EgwCoreLib.Lux.Core.Enum; +using static EgwCoreLib.Lux.Core.Enums; namespace EgwCoreLib.Lux.Data.DbModel { diff --git a/EgwCoreLib.Lux.Data/Migrations/20250808131854_InitDb.Designer.cs b/EgwCoreLib.Lux.Data/Migrations/20250808143628_InitDb.Designer.cs similarity index 96% rename from EgwCoreLib.Lux.Data/Migrations/20250808131854_InitDb.Designer.cs rename to EgwCoreLib.Lux.Data/Migrations/20250808143628_InitDb.Designer.cs index e2e5789..4f00571 100644 --- a/EgwCoreLib.Lux.Data/Migrations/20250808131854_InitDb.Designer.cs +++ b/EgwCoreLib.Lux.Data/Migrations/20250808143628_InitDb.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace EgwCoreLib.Lux.Data.Migrations { [DbContext(typeof(DataLayerContext))] - [Migration("20250808131854_InitDb")] + [Migration("20250808143628_InitDb")] partial class InitDb { /// @@ -718,13 +718,13 @@ namespace EgwCoreLib.Lux.Data.Migrations CustomerID = 2, DealerID = 2, Description = "Offerta per tre serramenti", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9764), - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9766), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4215), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4216), OffertState = 0, RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 9, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9761) + ValidUntil = new DateTime(2025, 9, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4212) }); }); @@ -799,14 +799,14 @@ namespace EgwCoreLib.Lux.Data.Migrations new { OfferRowID = 1, - BomOk = false, + BomOk = true, Cost = 950.0, Environment = "WINDOW", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9790), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4243), ItemBOM = "", - ItemOk = false, + ItemOk = true, ItemSPP = "{}", - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9791), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4245), Note = "Finestra anta singola 2025", OfferID = 1, OfferRowUID = "OFF0000000001", @@ -818,14 +818,14 @@ namespace EgwCoreLib.Lux.Data.Migrations new { OfferRowID = 2, - BomOk = false, + BomOk = true, Cost = 160.0, Environment = "WINDOW", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9798), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4252), ItemBOM = "", - ItemOk = false, + ItemOk = true, ItemSPP = "{}", - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9799), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4253), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, OfferRowUID = "OFF0000000002", @@ -837,14 +837,14 @@ namespace EgwCoreLib.Lux.Data.Migrations new { OfferRowID = 3, - BomOk = false, + BomOk = true, Cost = 200.0, Environment = "WINDOW", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9805), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4259), ItemBOM = "", - ItemOk = false, + ItemOk = true, ItemSPP = "{}", - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9806), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4261), Note = "Installazione serramento", OfferID = 1, OfferRowUID = "OFF0000000003", @@ -1385,8 +1385,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 1, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9506), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9552), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3939), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3987), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1398,8 +1398,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 2, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9555), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9556), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3989), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3991), MovCod = "CAR", Note = "DEMO", QtyRec = 8.0, @@ -1411,8 +1411,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 3, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9559), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9560), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3993), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3995), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1424,8 +1424,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 4, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9562), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9564), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3997), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3998), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1437,8 +1437,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 5, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9566), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9567), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4000), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4002), MovCod = "CAR", Note = "DEMO", QtyRec = 10.0, @@ -1450,8 +1450,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 6, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9569), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9571), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4004), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4006), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1463,8 +1463,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 7, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9573), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9574), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4008), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4009), MovCod = "CAR", Note = "DEMO", QtyRec = 50.0, @@ -1476,8 +1476,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 8, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9576), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9578), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4011), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4013), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1489,8 +1489,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 9, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9580), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9581), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4015), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4017), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1502,8 +1502,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 10, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9583), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9585), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4019), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4020), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1814,7 +1814,7 @@ namespace EgwCoreLib.Lux.Data.Migrations modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferRowModel", b => { b.HasOne("EgwCoreLib.Lux.Data.DbModel.OfferModel", "OfferNav") - .WithMany() + .WithMany("OfferRowNav") .HasForeignKey("OfferID") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); @@ -1962,6 +1962,11 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Navigation("ItemNav"); }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferModel", b => + { + b.Navigation("OfferRowNav"); + }); #pragma warning restore 612, 618 } } diff --git a/EgwCoreLib.Lux.Data/Migrations/20250808131854_InitDb.cs b/EgwCoreLib.Lux.Data/Migrations/20250808143628_InitDb.cs similarity index 95% rename from EgwCoreLib.Lux.Data/Migrations/20250808131854_InitDb.cs rename to EgwCoreLib.Lux.Data/Migrations/20250808143628_InitDb.cs index 3af0de3..c5cb753 100644 --- a/EgwCoreLib.Lux.Data/Migrations/20250808131854_InitDb.cs +++ b/EgwCoreLib.Lux.Data/Migrations/20250808143628_InitDb.cs @@ -767,7 +767,7 @@ namespace EgwCoreLib.Lux.Data.Migrations migrationBuilder.InsertData( table: "Offer", columns: new[] { "OfferID", "CustomerID", "DealerID", "Description", "Inserted", "Modified", "OffertState", "RefNum", "RefRev", "RefYear", "ValidUntil" }, - values: new object[] { 1, 2, 2, "Offerta per tre serramenti", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9764), new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9766), 0, 1, 1, 2024, new DateTime(2025, 9, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9761) }); + values: new object[] { 1, 2, 2, "Offerta per tre serramenti", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4215), new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4216), 0, 1, 1, 2024, new DateTime(2025, 9, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4212) }); migrationBuilder.InsertData( table: "RegItem", @@ -813,9 +813,9 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "OfferRowID", "BomOk", "Cost", "Environment", "Inserted", "ItemBOM", "ItemOk", "ItemSPP", "Modified", "Note", "OfferID", "OfferRowUID", "Qty", "RowNum", "SellingItemID", "SerStruct" }, values: new object[,] { - { 1, false, 950.0, "WINDOW", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9790), "", false, "{}", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9791), "Finestra anta singola 2025", 1, "OFF0000000001", 3.0, 1, 1, "{}" }, - { 2, false, 160.0, "WINDOW", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9798), "", false, "{}", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9799), "Persiana per Finestra anta singola 2025", 1, "OFF0000000002", 3.0, 2, 2, "{}" }, - { 3, false, 200.0, "WINDOW", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9805), "", false, "{}", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9806), "Installazione serramento", 1, "OFF0000000003", 3.0, 3, 3, "{}" } + { 1, true, 950.0, "WINDOW", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4243), "", true, "{}", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4245), "Finestra anta singola 2025", 1, "OFF0000000001", 3.0, 1, 1, "{}" }, + { 2, true, 160.0, "WINDOW", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4252), "", true, "{}", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4253), "Persiana per Finestra anta singola 2025", 1, "OFF0000000002", 3.0, 2, 2, "{}" }, + { 3, true, 200.0, "WINDOW", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4259), "", true, "{}", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4261), "Installazione serramento", 1, "OFF0000000003", 3.0, 3, 3, "{}" } }); migrationBuilder.InsertData( @@ -840,16 +840,16 @@ namespace EgwCoreLib.Lux.Data.Migrations columns: new[] { "StockMovID", "CodDoc", "DtCreate", "MovCod", "Note", "QtyRec", "StockStatusId", "UnitVal", "UserId" }, values: new object[,] { - { 1, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9506), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" }, - { 2, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9555), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" }, - { 3, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9559), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" }, - { 4, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9562), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" }, - { 5, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9566), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" }, - { 6, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9569), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" }, - { 7, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9573), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" }, - { 8, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9576), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" }, - { 9, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9580), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" }, - { 10, "", new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9583), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" } + { 1, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3939), "CAR", "DEMO", 5.0, 1, 0.0, "samuele.locatelli@egalware.com" }, + { 2, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3989), "CAR", "DEMO", 8.0, 2, 0.0, "samuele.locatelli@egalware.com" }, + { 3, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3993), "CAR", "DEMO", 5.0, 3, 0.0, "samuele.locatelli@egalware.com" }, + { 4, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3997), "CAR", "DEMO", 1.0, 4, 0.0, "samuele.locatelli@egalware.com" }, + { 5, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4000), "CAR", "DEMO", 10.0, 5, 0.0, "samuele.locatelli@egalware.com" }, + { 6, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4004), "CAR", "DEMO", 1.0, 6, 0.0, "samuele.locatelli@egalware.com" }, + { 7, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4008), "CAR", "DEMO", 50.0, 7, 0.0, "samuele.locatelli@egalware.com" }, + { 8, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4011), "CAR", "DEMO", 1.0, 8, 0.0, "samuele.locatelli@egalware.com" }, + { 9, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4015), "CAR", "DEMO", 1.0, 9, 0.0, "samuele.locatelli@egalware.com" }, + { 10, "", new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4019), "CAR", "DEMO", 1.0, 10, 0.0, "samuele.locatelli@egalware.com" } }); migrationBuilder.CreateIndex( diff --git a/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs b/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs index 21049f2..6228576 100644 --- a/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs +++ b/EgwCoreLib.Lux.Data/Migrations/DataLayerContextModelSnapshot.cs @@ -715,13 +715,13 @@ namespace EgwCoreLib.Lux.Data.Migrations CustomerID = 2, DealerID = 2, Description = "Offerta per tre serramenti", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9764), - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9766), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4215), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4216), OffertState = 0, RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 9, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9761) + ValidUntil = new DateTime(2025, 9, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4212) }); }); @@ -796,14 +796,14 @@ namespace EgwCoreLib.Lux.Data.Migrations new { OfferRowID = 1, - BomOk = false, + BomOk = true, Cost = 950.0, Environment = "WINDOW", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9790), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4243), ItemBOM = "", - ItemOk = false, + ItemOk = true, ItemSPP = "{}", - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9791), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4245), Note = "Finestra anta singola 2025", OfferID = 1, OfferRowUID = "OFF0000000001", @@ -815,14 +815,14 @@ namespace EgwCoreLib.Lux.Data.Migrations new { OfferRowID = 2, - BomOk = false, + BomOk = true, Cost = 160.0, Environment = "WINDOW", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9798), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4252), ItemBOM = "", - ItemOk = false, + ItemOk = true, ItemSPP = "{}", - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9799), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4253), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, OfferRowUID = "OFF0000000002", @@ -834,14 +834,14 @@ namespace EgwCoreLib.Lux.Data.Migrations new { OfferRowID = 3, - BomOk = false, + BomOk = true, Cost = 200.0, Environment = "WINDOW", - Inserted = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9805), + Inserted = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4259), ItemBOM = "", - ItemOk = false, + ItemOk = true, ItemSPP = "{}", - Modified = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9806), + Modified = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4261), Note = "Installazione serramento", OfferID = 1, OfferRowUID = "OFF0000000003", @@ -1382,8 +1382,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 1, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9506), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9552), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3939), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3987), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1395,8 +1395,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 2, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9555), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9556), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3989), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3991), MovCod = "CAR", Note = "DEMO", QtyRec = 8.0, @@ -1408,8 +1408,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 3, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9559), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9560), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3993), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3995), MovCod = "CAR", Note = "DEMO", QtyRec = 5.0, @@ -1421,8 +1421,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 4, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9562), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9564), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3997), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(3998), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1434,8 +1434,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 5, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9566), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9567), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4000), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4002), MovCod = "CAR", Note = "DEMO", QtyRec = 10.0, @@ -1447,8 +1447,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 6, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9569), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9571), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4004), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4006), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1460,8 +1460,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 7, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9573), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9574), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4008), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4009), MovCod = "CAR", Note = "DEMO", QtyRec = 50.0, @@ -1473,8 +1473,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 8, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9576), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9578), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4011), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4013), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1486,8 +1486,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 9, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9580), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9581), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4015), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4017), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1499,8 +1499,8 @@ namespace EgwCoreLib.Lux.Data.Migrations { StockMovID = 10, CodDoc = "", - DtCreate = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9583), - DtMod = new DateTime(2025, 8, 8, 15, 18, 53, 613, DateTimeKind.Local).AddTicks(9585), + DtCreate = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4019), + DtMod = new DateTime(2025, 8, 8, 16, 36, 28, 420, DateTimeKind.Local).AddTicks(4020), MovCod = "CAR", Note = "DEMO", QtyRec = 1.0, @@ -1811,7 +1811,7 @@ namespace EgwCoreLib.Lux.Data.Migrations modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferRowModel", b => { b.HasOne("EgwCoreLib.Lux.Data.DbModel.OfferModel", "OfferNav") - .WithMany() + .WithMany("OfferRowNav") .HasForeignKey("OfferID") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); @@ -1959,6 +1959,11 @@ namespace EgwCoreLib.Lux.Data.Migrations b.Navigation("ItemNav"); }); + + modelBuilder.Entity("EgwCoreLib.Lux.Data.DbModel.OfferModel", b => + { + b.Navigation("OfferRowNav"); + }); #pragma warning restore 612, 618 } } diff --git a/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs b/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs index da1a192..f266ca3 100644 --- a/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs +++ b/EgwCoreLib.Lux.Data/ModelBuilderExtensions.cs @@ -69,24 +69,24 @@ namespace EgwCoreLib.Lux.Data // inizializzazione dei valori di default x Item di magazzino modelBuilder.Entity().HasData( // barre grezzo - new ItemModel { ItemID = 1, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1001, Description = "BARRA-60x80 generica", SupplCode = "BARR.001", Cost = 20, Margin = 0.3, UM = "#" }, - new ItemModel { ItemID = 2, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1002, ExtItemCode = "BARRA-60x80x12000", SupplCode = "ABC.00123.12000", Description = "Barra 60x80, lunghezza 12m", Cost = 16.5, Margin = 0.21, UM = "#" }, - new ItemModel { ItemID = 3, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1003, ExtItemCode = "BARRA-60x80x8000", SupplCode = "ABC.00123.8000", Description = "Barra 60x80, lunghezza 8m", Cost = 17.5, Margin = 0.22, UM = "#" }, - new ItemModel { ItemID = 4, CodGroup = "WindowTrunk", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 1004, ExtItemCode = "BARRA-60x80x16000", SupplCode = "ABC.00123.16000", Description = "Barra 60x80, lunghezza 16m", Cost = 15.5, Margin = 0.2, UM = "#" }, + new ItemModel { ItemID = 1, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1001, Description = "BARRA-60x80 generica", SupplCode = "BARR.001", Cost = 20, Margin = 0.3, UM = "#" }, + new ItemModel { ItemID = 2, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1002, ExtItemCode = "BARRA-60x80x12000", SupplCode = "ABC.00123.12000", Description = "Barra 60x80, lunghezza 12m", Cost = 16.5, Margin = 0.21, UM = "#" }, + new ItemModel { ItemID = 3, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1003, ExtItemCode = "BARRA-60x80x8000", SupplCode = "ABC.00123.8000", Description = "Barra 60x80, lunghezza 8m", Cost = 17.5, Margin = 0.22, UM = "#" }, + new ItemModel { ItemID = 4, CodGroup = "WindowTrunk", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 1004, ExtItemCode = "BARRA-60x80x16000", SupplCode = "ABC.00123.16000", Description = "Barra 60x80, lunghezza 16m", Cost = 15.5, Margin = 0.2, UM = "#" }, // vetri - new ItemModel { ItemID = 5, CodGroup = "WindowGlass", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 2001, ExtItemCode = "VETRO-3L-THERMO-800x1000", SupplCode = "V3T.800.1000", Description = "Vetro triplo, basso indice termico, 800x1000", Cost = 300, Margin = 0.20, UM = "m2" }, - new ItemModel { ItemID = 6, CodGroup = "WindowGlass", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 2002, ExtItemCode = "VETRO-2L-800x1000", SupplCode = "V2.800.1000", Description = "Vetro doppio, 800x1000", Cost = 200, Margin = 0.15, UM = "m2" }, - new ItemModel { ItemID = 7, CodGroup = "WindowGlass", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 2003, ExtItemCode = "VETRO-3L-800x1000", SupplCode = "V3.800.1000", Description = "Vetro triplo, 800x1000", Cost = 250, Margin = 0.18, UM = "m2" }, + new ItemModel { ItemID = 5, CodGroup = "WindowGlass", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 2001, ExtItemCode = "VETRO-3L-THERMO-800x1000", SupplCode = "V3T.800.1000", Description = "Vetro triplo, basso indice termico, 800x1000", Cost = 300, Margin = 0.20, UM = "m2" }, + new ItemModel { ItemID = 6, CodGroup = "WindowGlass", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 2002, ExtItemCode = "VETRO-2L-800x1000", SupplCode = "V2.800.1000", Description = "Vetro doppio, 800x1000", Cost = 200, Margin = 0.15, UM = "m2" }, + new ItemModel { ItemID = 7, CodGroup = "WindowGlass", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 2003, ExtItemCode = "VETRO-3L-800x1000", SupplCode = "V3.800.1000", Description = "Vetro triplo, 800x1000", Cost = 250, Margin = 0.18, UM = "m2" }, // vernici - new ItemModel { ItemID = 8, CodGroup = "WindowVarnish", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 3001, ExtItemCode = "VERN-TRASP", SupplCode = "VT.STD", Description = "Vernice trasparente", Cost = 20, Margin = 0.20, UM = "l" }, + new ItemModel { ItemID = 8, CodGroup = "WindowVarnish", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 3001, ExtItemCode = "VERN-TRASP", SupplCode = "VT.STD", Description = "Vernice trasparente", Cost = 20, Margin = 0.20, UM = "l" }, // ferramenta - new ItemModel { ItemID = 9, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5001, ExtItemCode = "KIT-001", SupplCode = "AGB-KIT-001", Description = "Kit standard completo AGB tipo 001", Cost = 65, Margin = 0.20, UM = "#" }, - new ItemModel { ItemID = 10, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5002, ExtItemCode = "CERN-001", SupplCode = "AGB-CERN-001", Description = "Cerniera AGB tipo 001", Cost = 10, Margin = 0.20, UM = "#" }, - new ItemModel { ItemID = 11, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5003, ExtItemCode = "SERR-001", SupplCode = "AGB-SERR-001", Description = "Serratura AGB tipo 001", Cost = 15, Margin = 0.20, UM = "#" }, - new ItemModel { ItemID = 12, CodGroup = "WindowHardware", ItemType = Core.Enum.ItemClassType.Buy, IsService = false, ItemCode = 5004, ExtItemCode = "MAN-001", SupplCode = "AGB-MAN-001", Description = "Maniglia AGB tipo 001", Cost = 25, Margin = 0.20, UM = "#" } + new ItemModel { ItemID = 9, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5001, ExtItemCode = "KIT-001", SupplCode = "AGB-KIT-001", Description = "Kit standard completo AGB tipo 001", Cost = 65, Margin = 0.20, UM = "#" }, + new ItemModel { ItemID = 10, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5002, ExtItemCode = "CERN-001", SupplCode = "AGB-CERN-001", Description = "Cerniera AGB tipo 001", Cost = 10, Margin = 0.20, UM = "#" }, + new ItemModel { ItemID = 11, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5003, ExtItemCode = "SERR-001", SupplCode = "AGB-SERR-001", Description = "Serratura AGB tipo 001", Cost = 15, Margin = 0.20, UM = "#" }, + new ItemModel { ItemID = 12, CodGroup = "WindowHardware", ItemType = Core.Enums.ItemClassType.Buy, IsService = false, ItemCode = 5004, ExtItemCode = "MAN-001", SupplCode = "AGB-MAN-001", Description = "Maniglia AGB tipo 001", Cost = 25, Margin = 0.20, UM = "#" } ); // inizializzazione dei valori di default x Item di giacenza diff --git a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs index 66c3f1c..a92bc99 100644 --- a/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs +++ b/EgwCoreLib.Lux.Data/Services/DataLayerServices.cs @@ -181,6 +181,77 @@ namespace EgwCoreLib.Lux.Data.Services return result; } + + /// + /// Elenco completo ItemGroup gestiti + /// + /// + public async Task> ItemGroupGetAllAsync() + { + string source = "DB"; + Stopwatch sw = new Stopwatch(); + sw.Start(); + List? result = new List(); + // cerco in redis... + string currKey = $"{redisBaseKey}:ItemGroup:ALL"; + RedisValue rawData = await redisDb.StringGetAsync(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}"); + source = "REDIS"; + } + else + { + result = await dbController.ItemGroupGetAllAsync(); + // serializzo e salvo con config x evitare loop... + rawData = JsonConvert.SerializeObject(result, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, LongCache); + } + if (result == null) + { + result = new List(); + } + sw.Stop(); + Log.Debug($"ItemGroupGetAllAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + return result; + } + + /// + /// Elenco item da ricerca async + /// + /// + /// + public async Task> ItemGetSearchAsync(string term) + { + string source = "DB"; + Stopwatch sw = new Stopwatch(); + sw.Start(); + List? result = new List(); + // cerco in redis... + string token = string.IsNullOrEmpty(term) ? "ALL" : term; + string currKey = $"{redisBaseKey}:Item:{token}"; + RedisValue rawData = await redisDb.StringGetAsync(currKey); + if (rawData.HasValue) + { + result = JsonConvert.DeserializeObject>($"{rawData}"); + source = "REDIS"; + } + else + { + result = await dbController.ItemGetSearchAsync(term); + // serializzo e salvo con config x evitare loop... + rawData = JsonConvert.SerializeObject(result, JSSettings); + await redisDb.StringSetAsync(currKey, rawData, LongCache); + } + if (result == null) + { + result = new List(); + } + sw.Stop(); + Log.Debug($"ItemGetSearchAsync | {source} | {sw.Elapsed.TotalMilliseconds}ms"); + return result; + } + /// /// Elenco righe offerta specificata /// diff --git a/Lux.API/Lux.API.csproj b/Lux.API/Lux.API.csproj index 45e79cc..1f9d80a 100644 --- a/Lux.API/Lux.API.csproj +++ b/Lux.API/Lux.API.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 0.9.2508.0816 + 0.9.2508.0818 diff --git a/Lux.UI/Components/App.razor b/Lux.UI/Components/App.razor index 37a7d8f..437898e 100644 --- a/Lux.UI/Components/App.razor +++ b/Lux.UI/Components/App.razor @@ -13,6 +13,7 @@ + @* *@ diff --git a/Lux.UI/Components/Compo/OfferMan.razor b/Lux.UI/Components/Compo/OfferMan.razor index d861758..8c033a5 100644 --- a/Lux.UI/Components/Compo/OfferMan.razor +++ b/Lux.UI/Components/Compo/OfferMan.razor @@ -34,7 +34,7 @@
+ + @foreach (var item in ListItemGroup) + { + + } + + Tipo + +
+
+
+
+ + + +
+
+ + + +
+ @if (isLoading || ListRecords == null) + { + + } + else if (totalCount == 0) + { +
Nessun record trovato
+ } + else + { + + + + + + + + + + + + + + + + + + + + + @foreach (var item in ListRecords) + { + + + + + + + + + + + + + + + + + + } + + + + + + +
+ + IDGruppoTipoServCodiceItemCodeSuppl.CodeDescrizioneCostoMargineQty minQty MaxUM
@item.ItemID@item.CodGroup@item.ItemType@item.IsService@item.ItemCode@item.ExtItemCode@item.SupplCode@item.Description@item.Cost.ToString("C3")@item.Margin.ToString("P1")@item.QtyMin.ToString("F1")@item.QtyMax.ToString("F1")@item.UM
+ +
+ } +
+ \ No newline at end of file diff --git a/Lux.UI/Components/Pages/Items.razor.cs b/Lux.UI/Components/Pages/Items.razor.cs new file mode 100644 index 0000000..4cfb2ae --- /dev/null +++ b/Lux.UI/Components/Pages/Items.razor.cs @@ -0,0 +1,111 @@ +using EgwCoreLib.Lux.Data.DbModel; +using EgwCoreLib.Lux.Data.Services; +using Microsoft.AspNetCore.Components; + +namespace Lux.UI.Components.Pages +{ + public partial class Items + { + #region Protected Fields + + protected List AllRecords = new List(); + protected List ListItemGroup = new List(); + protected List ListRecords = new List(); + + protected string searchVal = ""; + + protected string? SelCodGroup = null; + protected EgwCoreLib.Lux.Core.Enums.ItemClassType? SelType = null; + + #endregion Protected Fields + + #region Protected Properties + + [Inject] + protected DataLayerServices DLService { get; set; } = null!; + + #endregion Protected Properties + + #region Protected Methods + + protected void DoAdd() + { + EditRecord = new ItemModel() + { + CodGroup = ListItemGroup.FirstOrDefault()?.CodGroup ?? "", + ItemType = EgwCoreLib.Lux.Core.Enums.ItemClassType.ND, + IsService = false, + ItemCode = 0, + ExtItemCode = "NEW-ITEM", + SupplCode = "", + Description = $"Nuova Offerta {DateTime.Today:ddd yyyy.MM.dd}", + Cost = 0, + Margin = 0, + QtyMin = 0, + QtyMax = 0, + UM = "#" + }; + } + + protected override async Task OnInitializedAsync() + { + isLoading = true; + await ReloadBaseData(); + await ReloadData(); + UpdateTable(); + } + + protected void resetSearch() + { + searchVal = ""; + } + + #endregion Protected Methods + + #region Private Fields + + private int currPage = 1; + + private ItemModel? EditRecord = null; + + private bool isLoading = false; + private int numRecord = 10; + private int totalCount = 0; + + protected void DoReset() + { + EditRecord = null; + } + + #endregion Private Fields + + #region Private Methods + + private async Task ReloadBaseData() + { + ListItemGroup = await DLService.ItemGroupGetAllAsync(); + } + + private async Task ReloadData() + { + isLoading = true; + AllRecords = await DLService.ItemGetSearchAsync(searchVal); + totalCount = AllRecords.Count; + } + + /// + /// Filtro e paginazione + /// + private void UpdateTable() + { + // fix paginazione + ListRecords = AllRecords + .Skip(numRecord * (currPage - 1)) + .Take(numRecord) + .ToList(); + isLoading = false; + } + + #endregion Private Methods + } +} \ No newline at end of file diff --git a/Lux.UI/Components/Pages/Offers.razor b/Lux.UI/Components/Pages/Offers.razor index dccfcd1..2bf9bc6 100644 --- a/Lux.UI/Components/Pages/Offers.razor +++ b/Lux.UI/Components/Pages/Offers.razor @@ -67,7 +67,7 @@ } else if (currStep == CompileStep.Rows) { - + } else if (currStep == CompileStep.Delivery) { @@ -176,7 +176,7 @@ else @if (SelRecord != null) {
- +
} diff --git a/Lux.UI/Lux.UI.csproj b/Lux.UI/Lux.UI.csproj index b690475..ae7de3c 100644 --- a/Lux.UI/Lux.UI.csproj +++ b/Lux.UI/Lux.UI.csproj @@ -5,7 +5,7 @@ enable enable aspnet-Lux.UI-a758c101-a2f4-4e38-977d-1c4887dbbd50 - 0.9.2508.0816 + 0.9.2508.0818 @@ -42,6 +42,10 @@ PreserveNewest + + + + diff --git a/Lux.UI/compilerconfig.json b/Lux.UI/compilerconfig.json index f03f035..063ee29 100644 --- a/Lux.UI/compilerconfig.json +++ b/Lux.UI/compilerconfig.json @@ -14,5 +14,9 @@ { "outputFile": "Components/Layout/MainLayout.razor.css", "inputFile": "Components/Layout/MainLayout.razor.less" + }, + { + "outputFile": "wwwroot/css/textures.css", + "inputFile": "wwwroot/css/textures.less" } ] \ No newline at end of file diff --git a/Lux.UI/wwwroot/css/textures.css b/Lux.UI/wwwroot/css/textures.css new file mode 100644 index 0000000..7ccc5e1 --- /dev/null +++ b/Lux.UI/wwwroot/css/textures.css @@ -0,0 +1,18 @@ +.wood-01 { + /*background-color: #FB8004;*/ + background-image: url('../images/textures/wood-01.jpg'); + /* path to your wood texture */ + background-repeat: repeat; + /* repeat both horizontally & vertically */ + background-size: 100px 100px; + /* adjust size as needed */ +} +.wood-02 { + /*background-color: #CC6600;*/ + background-image: url('../images/textures/wood-02.jpg'); + /* path to your wood texture */ + background-repeat: repeat; + /* repeat both horizontally & vertically */ + background-size: 50px 150px; + /* adjust size as needed */ +} \ No newline at end of file diff --git a/Lux.UI/wwwroot/css/textures.less b/Lux.UI/wwwroot/css/textures.less new file mode 100644 index 0000000..8082ae9 --- /dev/null +++ b/Lux.UI/wwwroot/css/textures.less @@ -0,0 +1,12 @@ +.wood-01 { + /*background-color: #FB8004;*/ + background-image: url('../images/textures/wood-01.jpg'); /* path to your wood texture */ + background-repeat: repeat; /* repeat both horizontally & vertically */ + background-size: 100px 100px; /* adjust size as needed */ +} +.wood-02 { + /*background-color: #CC6600;*/ + background-image: url('../images/textures/wood-02.jpg'); /* path to your wood texture */ + background-repeat: repeat; /* repeat both horizontally & vertically */ + background-size: 50px 150px; /* adjust size as needed */ +} \ No newline at end of file diff --git a/Lux.UI/wwwroot/css/textures.min.css b/Lux.UI/wwwroot/css/textures.min.css new file mode 100644 index 0000000..33c13c6 --- /dev/null +++ b/Lux.UI/wwwroot/css/textures.min.css @@ -0,0 +1 @@ +.wood-01{background-image:url('../images/textures/wood-01.jpg');background-repeat:repeat;background-size:100px 100px;}.wood-02{background-image:url('../images/textures/wood-02.jpg');background-repeat:repeat;background-size:50px 150px;} \ No newline at end of file diff --git a/Lux.UI/wwwroot/images/textures/wood-01.jpg b/Lux.UI/wwwroot/images/textures/wood-01.jpg new file mode 100644 index 0000000..502d6c5 Binary files /dev/null and b/Lux.UI/wwwroot/images/textures/wood-01.jpg differ diff --git a/Lux.UI/wwwroot/images/textures/wood-02.jpg b/Lux.UI/wwwroot/images/textures/wood-02.jpg new file mode 100644 index 0000000..619a919 Binary files /dev/null and b/Lux.UI/wwwroot/images/textures/wood-02.jpg differ diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 70680e6..c67c474 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ LUX - Web Windows MES -

Versione: 0.9.2508.0816

+

Versione: 0.9.2508.0818


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 94c01f3..d8182b7 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -0.9.2508.0816 +0.9.2508.0818 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 9e4d213..fd07266 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 0.9.2508.0816 + 0.9.2508.0818 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false