From 975ba07d7e4e63ed51f365303b77ea2008df9dcb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 20 Jun 2025 11:10:26 +0200 Subject: [PATCH] Split tra articoli commerciali di vendita e di produzione --- Lux.Data/Controllers/LuxController.cs | 1 - Lux.Data/DataLayerContext.cs | 1 + Lux.Data/DbModel/ItemModel.cs | 5 - Lux.Data/DbModel/OfferRowModel.cs | 8 +- Lux.Data/DbModel/SellItemModel.cs | 70 ++++++ ...r.cs => 20250620090604_InitDb.Designer.cs} | 228 +++++++++++------- ...825_InitDb.cs => 20250620090604_InitDb.cs} | 124 +++++++--- .../DataLayerContextModelSnapshot.cs | 226 ++++++++++------- Lux.Data/ModelBuilderExtensions.cs | 44 ++-- 9 files changed, 472 insertions(+), 235 deletions(-) create mode 100644 Lux.Data/DbModel/SellItemModel.cs rename Lux.Data/Migrations/{20250620083825_InitDb.Designer.cs => 20250620090604_InitDb.Designer.cs} (90%) rename Lux.Data/Migrations/{20250620083825_InitDb.cs => 20250620090604_InitDb.cs} (82%) diff --git a/Lux.Data/Controllers/LuxController.cs b/Lux.Data/Controllers/LuxController.cs index 58e1973e..0ff5d023 100644 --- a/Lux.Data/Controllers/LuxController.cs +++ b/Lux.Data/Controllers/LuxController.cs @@ -77,7 +77,6 @@ namespace Lux.Data.Controllers currRec.ItemCode = newRec.ItemCode; currRec.Cost = newRec.Cost; currRec.Description = newRec.Description; - currRec.IsMake = newRec.IsMake; currRec.IsService = newRec.IsService; currRec.Margin = newRec.Margin; dbCtx.Entry(currRec).State = Microsoft.EntityFrameworkCore.EntityState.Modified; diff --git a/Lux.Data/DataLayerContext.cs b/Lux.Data/DataLayerContext.cs index 7d244518..ab9a66f7 100644 --- a/Lux.Data/DataLayerContext.cs +++ b/Lux.Data/DataLayerContext.cs @@ -41,6 +41,7 @@ namespace Lux.Data public virtual DbSet DbSetItem { get; set; } + public virtual DbSet DbSetSellItem { get; set; } public virtual DbSet DbSetRole { get; set; } public virtual DbSet DbSetCustomer { get; set; } public virtual DbSet DbSetDealer { get; set; } diff --git a/Lux.Data/DbModel/ItemModel.cs b/Lux.Data/DbModel/ItemModel.cs index 37409241..34ed99d7 100644 --- a/Lux.Data/DbModel/ItemModel.cs +++ b/Lux.Data/DbModel/ItemModel.cs @@ -21,11 +21,6 @@ namespace Lux.Data.DbModel /// public bool IsService { get; set; } = false; - /// - /// Articolo di produzione (vs da acquisto) - /// - public bool IsMake { get; set; } = true; - /// /// CodArticolo (opzionale) numerico /// diff --git a/Lux.Data/DbModel/OfferRowModel.cs b/Lux.Data/DbModel/OfferRowModel.cs index 502379fd..253e2dd9 100644 --- a/Lux.Data/DbModel/OfferRowModel.cs +++ b/Lux.Data/DbModel/OfferRowModel.cs @@ -42,9 +42,9 @@ namespace Lux.Data.DbModel } /// - /// ID dell'articolo offerto + /// ID dell'articolo di vendita offerto /// - public int ItemID { get; set; } + public int SellItemID { get; set; } /// /// Costo (standard / senza listini) @@ -105,7 +105,7 @@ namespace Lux.Data.DbModel /// /// Navigazione Item /// - [ForeignKey("ItemID")] - public virtual ItemModel ItemNav { get; set; } = null!; + [ForeignKey("SellItemID")] + public virtual SellItemModel SellItemNav { get; set; } = null!; } } diff --git a/Lux.Data/DbModel/SellItemModel.cs b/Lux.Data/DbModel/SellItemModel.cs new file mode 100644 index 00000000..ff580692 --- /dev/null +++ b/Lux.Data/DbModel/SellItemModel.cs @@ -0,0 +1,70 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Lux.Data.DbModel +{ + // + // This is here so CodeMaid doesn't reorganize this document + // + + [Table("SellItem")] + public class SellItemModel + { + /// + /// ID dell'articolo di vendita/finito + /// + [Key] + public int SellItemID { get; set; } + + /// + /// Definisce l'articolo come servizio vs concreto=materiale + /// + public bool IsService { get; set; } = false; + + /// + /// Se 1 = rivendita, >1 è il ciclo di produzione associato + /// + public int JobID { get; set; } = 1; + + /// + /// CodArticolo (opzionale) numerico + /// + public int ItemCode { get; set; } = 0; + + /// + /// CodArticolo (opzionale) string + /// + public string ExtItemCode { get; set; } = ""; + + /// + /// Cod Fornitore (opzionale) + /// + public string SupplCode { get; set; } = ""; + + /// + /// Descrizione + /// + public string Description { get; set; } = ""; + + /// + /// Costo (standard / senza listini) + /// + public double Cost { get; set; } = 0; + + /// + /// Margine percentuale standard + /// + public double Margin { get; set; } = 0.1; + + /// + /// Unità di Misura + /// + public string UM { get; set; } = "#"; + + /// + /// Navigazione Job/Cicli + /// + [ForeignKey("JobID")] + public virtual JobModel JobNav { get; set; } = null!; + } +} diff --git a/Lux.Data/Migrations/20250620083825_InitDb.Designer.cs b/Lux.Data/Migrations/20250620090604_InitDb.Designer.cs similarity index 90% rename from Lux.Data/Migrations/20250620083825_InitDb.Designer.cs rename to Lux.Data/Migrations/20250620090604_InitDb.Designer.cs index 54416919..dfb8c0c9 100644 --- a/Lux.Data/Migrations/20250620083825_InitDb.Designer.cs +++ b/Lux.Data/Migrations/20250620090604_InitDb.Designer.cs @@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace Lux.Data.Migrations { [DbContext(typeof(DataLayerContext))] - [Migration("20250620083825_InitDb")] + [Migration("20250620090604_InitDb")] partial class InitDb { /// @@ -154,9 +154,6 @@ namespace Lux.Data.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("IsMake") - .HasColumnType("tinyint(1)"); - b.Property("IsService") .HasColumnType("tinyint(1)"); @@ -182,75 +179,33 @@ namespace Lux.Data.Migrations new { ItemID = 1, - Cost = 820.0, - Description = "Finestra anta Singola", + Cost = 50.0, + Description = "Barra di legno 80x120", ExtItemCode = "", - IsMake = true, IsService = false, ItemCode = 0, - Margin = 0.20000000000000001, + Margin = 0.29999999999999999, SupplCode = "", UM = "#" }, new { ItemID = 2, - Cost = 150.0, - Description = "Persiana anta singola", + Cost = 35.0, + Description = "Vernice trasparente", ExtItemCode = "", - IsMake = false, IsService = false, ItemCode = 0, - Margin = 0.10000000000000001, + Margin = 0.29999999999999999, SupplCode = "", UM = "#" }, new { ItemID = 3, - Cost = 200.0, - Description = "Installazione", - ExtItemCode = "", - IsMake = true, - IsService = true, - ItemCode = 0, - Margin = 0.29999999999999999, - SupplCode = "", - UM = "#" - }, - new - { - ItemID = 4, - Cost = 50.0, - Description = "Barra di legno 80x120", - ExtItemCode = "", - IsMake = false, - IsService = false, - ItemCode = 0, - Margin = 0.29999999999999999, - SupplCode = "", - UM = "#" - }, - new - { - ItemID = 5, - Cost = 35.0, - Description = "Vernice trasparente", - ExtItemCode = "", - IsMake = false, - IsService = false, - ItemCode = 0, - Margin = 0.29999999999999999, - SupplCode = "", - UM = "#" - }, - new - { - ItemID = 6, Cost = 1.0, Description = "Ferramenta", ExtItemCode = "", - IsMake = false, IsService = false, ItemCode = 0, Margin = 0.29999999999999999, @@ -279,6 +234,11 @@ namespace Lux.Data.Migrations new { JobID = 1, + Description = "Rivendita / servizi" + }, + new + { + JobID = 2, Description = "Serramento Completo Legno su linea Saomad e installatore interno" }); }); @@ -321,7 +281,7 @@ namespace Lux.Data.Migrations JobRowItemID = 1, Description = "Grezzo legno abete", Index = 1, - ItemID = 4, + ItemID = 1, JobRowID = 1, Qty = 4.5 }, @@ -330,7 +290,7 @@ namespace Lux.Data.Migrations JobRowItemID = 2, Description = "Vernice trasparente standard 1L", Index = 2, - ItemID = 5, + ItemID = 2, JobRowID = 4, Qty = 1.0 }, @@ -339,7 +299,7 @@ namespace Lux.Data.Migrations JobRowItemID = 3, Description = "Ferramenta AGB - rif. AGFD.00000.00000", Index = 3, - ItemID = 6, + ItemID = 3, JobRowID = 5, Qty = 1.0 }); @@ -388,7 +348,7 @@ namespace Lux.Data.Migrations JobRowID = 1, Description = "", Index = 1, - JobID = 1, + JobID = 2, PhaseID = 1, Qty = 1.0, ResourceID = 1 @@ -398,7 +358,7 @@ namespace Lux.Data.Migrations JobRowID = 2, Description = "", Index = 2, - JobID = 1, + JobID = 2, PhaseID = 2, Qty = 1.0, ResourceID = 2 @@ -408,7 +368,7 @@ namespace Lux.Data.Migrations JobRowID = 3, Description = "", Index = 3, - JobID = 1, + JobID = 2, PhaseID = 4, Qty = 1.0, ResourceID = 6 @@ -418,7 +378,7 @@ namespace Lux.Data.Migrations JobRowID = 4, Description = "", Index = 4, - JobID = 1, + JobID = 2, PhaseID = 3, Qty = 1.0, ResourceID = 4 @@ -428,7 +388,7 @@ namespace Lux.Data.Migrations JobRowID = 5, Description = "", Index = 5, - JobID = 1, + JobID = 2, PhaseID = 5, Qty = 1.0, ResourceID = 6 @@ -438,7 +398,7 @@ namespace Lux.Data.Migrations JobRowID = 6, Description = "", Index = 6, - JobID = 1, + JobID = 2, PhaseID = 6, Qty = 1.0, ResourceID = 7 @@ -496,12 +456,12 @@ namespace Lux.Data.Migrations CustomerID = 2, DealerID = 2, Description = "Offerta per tre serramenti", - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8791), - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8792), + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3672), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3673), RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 7, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8788) + ValidUntil = new DateTime(2025, 7, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3668) }); }); @@ -519,9 +479,6 @@ namespace Lux.Data.Migrations b.Property("Inserted") .HasColumnType("datetime(6)"); - b.Property("ItemID") - .HasColumnType("int"); - b.Property("ItemSPP") .IsRequired() .HasColumnType("longtext"); @@ -542,16 +499,19 @@ namespace Lux.Data.Migrations b.Property("RowNum") .HasColumnType("int"); + b.Property("SellItemID") + .HasColumnType("int"); + b.Property("SerStruct") .IsRequired() .HasColumnType("longtext"); b.HasKey("OfferRowID"); - b.HasIndex("ItemID"); - b.HasIndex("OfferID"); + b.HasIndex("SellItemID"); + b.ToTable("OfferRowList"); b.HasData( @@ -559,42 +519,42 @@ namespace Lux.Data.Migrations { OfferRowID = 1, Cost = 950.0, - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8814), - ItemID = 1, + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3701), ItemSPP = "{}", - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8816), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3703), Note = "Finestra anta singola 2025", OfferID = 1, Qty = 3.0, RowNum = 1, + SellItemID = 1, SerStruct = "{}" }, new { OfferRowID = 2, Cost = 160.0, - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8822), - ItemID = 2, + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3709), ItemSPP = "{}", - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8824), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3711), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, Qty = 3.0, RowNum = 1, + SellItemID = 2, SerStruct = "{}" }, new { OfferRowID = 3, Cost = 200.0, - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8829), - ItemID = 3, + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3716), ItemSPP = "{}", - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8831), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3717), Note = "Installazione serramento", OfferID = 1, Qty = 3.0, RowNum = 1, + SellItemID = 3, SerStruct = "{}" }); }); @@ -743,6 +703,93 @@ namespace Lux.Data.Migrations }); }); + modelBuilder.Entity("Lux.Data.DbModel.SellItemModel", b => + { + b.Property("SellItemID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SellItemID")); + + b.Property("Cost") + .HasColumnType("double"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ExtItemCode") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsService") + .HasColumnType("tinyint(1)"); + + b.Property("ItemCode") + .HasColumnType("int"); + + b.Property("JobID") + .HasColumnType("int"); + + b.Property("Margin") + .HasColumnType("double"); + + b.Property("SupplCode") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UM") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("SellItemID"); + + b.HasIndex("JobID"); + + b.ToTable("SellItem"); + + b.HasData( + new + { + SellItemID = 1, + Cost = 820.0, + Description = "Finestra anta Singola", + ExtItemCode = "", + IsService = false, + ItemCode = 0, + JobID = 2, + Margin = 0.20000000000000001, + SupplCode = "", + UM = "#" + }, + new + { + SellItemID = 2, + Cost = 150.0, + Description = "Persiana anta singola", + ExtItemCode = "", + IsService = false, + ItemCode = 0, + JobID = 1, + Margin = 0.10000000000000001, + SupplCode = "", + UM = "#" + }, + new + { + SellItemID = 3, + Cost = 200.0, + Description = "Installazione", + ExtItemCode = "", + IsService = true, + ItemCode = 0, + JobID = 1, + Margin = 0.29999999999999999, + SupplCode = "", + UM = "#" + }); + }); + modelBuilder.Entity("Lux.Data.DbModel.SupplierModel", b => { b.Property("SupplierID") @@ -909,21 +956,32 @@ namespace Lux.Data.Migrations modelBuilder.Entity("Lux.Data.DbModel.OfferRowModel", b => { - b.HasOne("Lux.Data.DbModel.ItemModel", "ItemNav") - .WithMany() - .HasForeignKey("ItemID") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - b.HasOne("Lux.Data.DbModel.OfferModel", "OfferNav") .WithMany() .HasForeignKey("OfferID") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.Navigation("ItemNav"); + b.HasOne("Lux.Data.DbModel.SellItemModel", "SellItemNav") + .WithMany() + .HasForeignKey("SellItemID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.Navigation("OfferNav"); + + b.Navigation("SellItemNav"); + }); + + modelBuilder.Entity("Lux.Data.DbModel.SellItemModel", b => + { + b.HasOne("Lux.Data.DbModel.JobModel", "JobNav") + .WithMany() + .HasForeignKey("JobID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("JobNav"); }); #pragma warning restore 612, 618 } diff --git a/Lux.Data/Migrations/20250620083825_InitDb.cs b/Lux.Data/Migrations/20250620090604_InitDb.cs similarity index 82% rename from Lux.Data/Migrations/20250620083825_InitDb.cs rename to Lux.Data/Migrations/20250620090604_InitDb.cs index b0bb8589..850d874a 100644 --- a/Lux.Data/Migrations/20250620083825_InitDb.cs +++ b/Lux.Data/Migrations/20250620090604_InitDb.cs @@ -81,7 +81,6 @@ namespace Lux.Data.Migrations ItemID = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), IsService = table.Column(type: "tinyint(1)", nullable: false), - IsMake = table.Column(type: "tinyint(1)", nullable: false), ItemCode = table.Column(type: "int", nullable: false), ExtItemCode = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), @@ -171,6 +170,38 @@ namespace Lux.Data.Migrations }) .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( + name: "SellItem", + columns: table => new + { + SellItemID = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + IsService = table.Column(type: "tinyint(1)", nullable: false), + JobID = table.Column(type: "int", nullable: false), + ItemCode = table.Column(type: "int", nullable: false), + ExtItemCode = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + SupplCode = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Description = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Cost = table.Column(type: "double", nullable: false), + Margin = table.Column(type: "double", nullable: false), + UM = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4") + }, + constraints: table => + { + table.PrimaryKey("PK_SellItem", x => x.SellItemID); + table.ForeignKey( + name: "FK_SellItem_JobList_JobID", + column: x => x.JobID, + principalTable: "JobList", + principalColumn: "JobID", + onDelete: ReferentialAction.Restrict); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + migrationBuilder.CreateTable( name: "Offer", columns: table => new @@ -252,7 +283,7 @@ namespace Lux.Data.Migrations .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), OfferID = table.Column(type: "int", nullable: false), RowNum = table.Column(type: "int", nullable: false), - ItemID = table.Column(type: "int", nullable: false), + SellItemID = table.Column(type: "int", nullable: false), Cost = table.Column(type: "double", nullable: false), Qty = table.Column(type: "double", nullable: false), ItemSPP = table.Column(type: "longtext", nullable: false) @@ -274,10 +305,10 @@ namespace Lux.Data.Migrations principalColumn: "OfferID", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_OfferRowList_RegItem_ItemID", - column: x => x.ItemID, - principalTable: "RegItem", - principalColumn: "ItemID", + name: "FK_OfferRowList_SellItem_SellItemID", + column: x => x.SellItemID, + principalTable: "SellItem", + principalColumn: "SellItemID", onDelete: ReferentialAction.Restrict); }) .Annotation("MySql:CharSet", "utf8mb4"); @@ -316,7 +347,11 @@ namespace Lux.Data.Migrations migrationBuilder.InsertData( table: "JobList", columns: new[] { "JobID", "Description" }, - values: new object[] { 1, "Serramento Completo Legno su linea Saomad e installatore interno" }); + values: new object[,] + { + { 1, "Rivendita / servizi" }, + { 2, "Serramento Completo Legno su linea Saomad e installatore interno" } + }); migrationBuilder.InsertData( table: "RegCustomer", @@ -340,15 +375,12 @@ namespace Lux.Data.Migrations migrationBuilder.InsertData( table: "RegItem", - columns: new[] { "ItemID", "Cost", "Description", "ExtItemCode", "IsMake", "IsService", "ItemCode", "Margin", "SupplCode", "UM" }, + columns: new[] { "ItemID", "Cost", "Description", "ExtItemCode", "IsService", "ItemCode", "Margin", "SupplCode", "UM" }, values: new object[,] { - { 1, 820.0, "Finestra anta Singola", "", true, false, 0, 0.20000000000000001, "", "#" }, - { 2, 150.0, "Persiana anta singola", "", false, false, 0, 0.10000000000000001, "", "#" }, - { 3, 200.0, "Installazione", "", true, true, 0, 0.29999999999999999, "", "#" }, - { 4, 50.0, "Barra di legno 80x120", "", false, false, 0, 0.29999999999999999, "", "#" }, - { 5, 35.0, "Vernice trasparente", "", false, false, 0, 0.29999999999999999, "", "#" }, - { 6, 1.0, "Ferramenta", "", false, false, 0, 0.29999999999999999, "", "#" } + { 1, 50.0, "Barra di legno 80x120", "", false, 0, 0.29999999999999999, "", "#" }, + { 2, 35.0, "Vernice trasparente", "", false, 0, 0.29999999999999999, "", "#" }, + { 3, 1.0, "Ferramenta", "", false, 0, 0.29999999999999999, "", "#" } }); migrationBuilder.InsertData( @@ -405,37 +437,47 @@ namespace Lux.Data.Migrations columns: new[] { "JobRowID", "Description", "Index", "JobID", "PhaseID", "Qty", "ResourceID" }, values: new object[,] { - { 1, "", 1, 1, 1, 1.0, 1 }, - { 2, "", 2, 1, 2, 1.0, 2 }, - { 3, "", 3, 1, 4, 1.0, 6 }, - { 4, "", 4, 1, 3, 1.0, 4 }, - { 5, "", 5, 1, 5, 1.0, 6 }, - { 6, "", 6, 1, 6, 1.0, 7 } + { 1, "", 1, 2, 1, 1.0, 1 }, + { 2, "", 2, 2, 2, 1.0, 2 }, + { 3, "", 3, 2, 4, 1.0, 6 }, + { 4, "", 4, 2, 3, 1.0, 4 }, + { 5, "", 5, 2, 5, 1.0, 6 }, + { 6, "", 6, 2, 6, 1.0, 7 } }); migrationBuilder.InsertData( table: "Offer", columns: new[] { "OfferID", "CustomerID", "DealerID", "Description", "Inserted", "Modified", "RefNum", "RefRev", "RefYear", "ValidUntil" }, - values: new object[] { 1, 2, 2, "Offerta per tre serramenti", new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8791), new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8792), 1, 1, 2024, new DateTime(2025, 7, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8788) }); + values: new object[] { 1, 2, 2, "Offerta per tre serramenti", new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3672), new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3673), 1, 1, 2024, new DateTime(2025, 7, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3668) }); + + migrationBuilder.InsertData( + table: "SellItem", + columns: new[] { "SellItemID", "Cost", "Description", "ExtItemCode", "IsService", "ItemCode", "JobID", "Margin", "SupplCode", "UM" }, + values: new object[,] + { + { 1, 820.0, "Finestra anta Singola", "", false, 0, 2, 0.20000000000000001, "", "#" }, + { 2, 150.0, "Persiana anta singola", "", false, 0, 1, 0.10000000000000001, "", "#" }, + { 3, 200.0, "Installazione", "", true, 0, 1, 0.29999999999999999, "", "#" } + }); migrationBuilder.InsertData( table: "JobRowItemList", columns: new[] { "JobRowItemID", "Description", "Index", "ItemID", "JobRowID", "Qty" }, values: new object[,] { - { 1, "Grezzo legno abete", 1, 4, 1, 4.5 }, - { 2, "Vernice trasparente standard 1L", 2, 5, 4, 1.0 }, - { 3, "Ferramenta AGB - rif. AGFD.00000.00000", 3, 6, 5, 1.0 } + { 1, "Grezzo legno abete", 1, 1, 1, 4.5 }, + { 2, "Vernice trasparente standard 1L", 2, 2, 4, 1.0 }, + { 3, "Ferramenta AGB - rif. AGFD.00000.00000", 3, 3, 5, 1.0 } }); migrationBuilder.InsertData( table: "OfferRowList", - columns: new[] { "OfferRowID", "Cost", "Inserted", "ItemID", "ItemSPP", "Modified", "Note", "OfferID", "Qty", "RowNum", "SerStruct" }, + columns: new[] { "OfferRowID", "Cost", "Inserted", "ItemSPP", "Modified", "Note", "OfferID", "Qty", "RowNum", "SellItemID", "SerStruct" }, values: new object[,] { - { 1, 950.0, new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8814), 1, "{}", new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8816), "Finestra anta singola 2025", 1, 3.0, 1, "{}" }, - { 2, 160.0, new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8822), 2, "{}", new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8824), "Persiana per Finestra anta singola 2025", 1, 3.0, 1, "{}" }, - { 3, 200.0, new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8829), 3, "{}", new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8831), "Installazione serramento", 1, 3.0, 1, "{}" } + { 1, 950.0, new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3701), "{}", new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3703), "Finestra anta singola 2025", 1, 3.0, 1, 1, "{}" }, + { 2, 160.0, new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3709), "{}", new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3711), "Persiana per Finestra anta singola 2025", 1, 3.0, 1, 2, "{}" }, + { 3, 200.0, new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3716), "{}", new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3717), "Installazione serramento", 1, 3.0, 1, 3, "{}" } }); migrationBuilder.CreateIndex( @@ -473,15 +515,20 @@ namespace Lux.Data.Migrations table: "Offer", column: "DealerID"); - migrationBuilder.CreateIndex( - name: "IX_OfferRowList_ItemID", - table: "OfferRowList", - column: "ItemID"); - migrationBuilder.CreateIndex( name: "IX_OfferRowList_OfferID", table: "OfferRowList", column: "OfferID"); + + migrationBuilder.CreateIndex( + name: "IX_OfferRowList_SellItemID", + table: "OfferRowList", + column: "SellItemID"); + + migrationBuilder.CreateIndex( + name: "IX_SellItem_JobID", + table: "SellItem", + column: "JobID"); } /// @@ -502,14 +549,14 @@ namespace Lux.Data.Migrations migrationBuilder.DropTable( name: "JobRowList"); - migrationBuilder.DropTable( - name: "Offer"); - migrationBuilder.DropTable( name: "RegItem"); migrationBuilder.DropTable( - name: "JobList"); + name: "Offer"); + + migrationBuilder.DropTable( + name: "SellItem"); migrationBuilder.DropTable( name: "RegPhase"); @@ -522,6 +569,9 @@ namespace Lux.Data.Migrations migrationBuilder.DropTable( name: "RegDealer"); + + migrationBuilder.DropTable( + name: "JobList"); } } } diff --git a/Lux.Data/Migrations/DataLayerContextModelSnapshot.cs b/Lux.Data/Migrations/DataLayerContextModelSnapshot.cs index c9a3381c..d3663deb 100644 --- a/Lux.Data/Migrations/DataLayerContextModelSnapshot.cs +++ b/Lux.Data/Migrations/DataLayerContextModelSnapshot.cs @@ -151,9 +151,6 @@ namespace Lux.Data.Migrations .IsRequired() .HasColumnType("longtext"); - b.Property("IsMake") - .HasColumnType("tinyint(1)"); - b.Property("IsService") .HasColumnType("tinyint(1)"); @@ -179,75 +176,33 @@ namespace Lux.Data.Migrations new { ItemID = 1, - Cost = 820.0, - Description = "Finestra anta Singola", + Cost = 50.0, + Description = "Barra di legno 80x120", ExtItemCode = "", - IsMake = true, IsService = false, ItemCode = 0, - Margin = 0.20000000000000001, + Margin = 0.29999999999999999, SupplCode = "", UM = "#" }, new { ItemID = 2, - Cost = 150.0, - Description = "Persiana anta singola", + Cost = 35.0, + Description = "Vernice trasparente", ExtItemCode = "", - IsMake = false, IsService = false, ItemCode = 0, - Margin = 0.10000000000000001, + Margin = 0.29999999999999999, SupplCode = "", UM = "#" }, new { ItemID = 3, - Cost = 200.0, - Description = "Installazione", - ExtItemCode = "", - IsMake = true, - IsService = true, - ItemCode = 0, - Margin = 0.29999999999999999, - SupplCode = "", - UM = "#" - }, - new - { - ItemID = 4, - Cost = 50.0, - Description = "Barra di legno 80x120", - ExtItemCode = "", - IsMake = false, - IsService = false, - ItemCode = 0, - Margin = 0.29999999999999999, - SupplCode = "", - UM = "#" - }, - new - { - ItemID = 5, - Cost = 35.0, - Description = "Vernice trasparente", - ExtItemCode = "", - IsMake = false, - IsService = false, - ItemCode = 0, - Margin = 0.29999999999999999, - SupplCode = "", - UM = "#" - }, - new - { - ItemID = 6, Cost = 1.0, Description = "Ferramenta", ExtItemCode = "", - IsMake = false, IsService = false, ItemCode = 0, Margin = 0.29999999999999999, @@ -276,6 +231,11 @@ namespace Lux.Data.Migrations new { JobID = 1, + Description = "Rivendita / servizi" + }, + new + { + JobID = 2, Description = "Serramento Completo Legno su linea Saomad e installatore interno" }); }); @@ -318,7 +278,7 @@ namespace Lux.Data.Migrations JobRowItemID = 1, Description = "Grezzo legno abete", Index = 1, - ItemID = 4, + ItemID = 1, JobRowID = 1, Qty = 4.5 }, @@ -327,7 +287,7 @@ namespace Lux.Data.Migrations JobRowItemID = 2, Description = "Vernice trasparente standard 1L", Index = 2, - ItemID = 5, + ItemID = 2, JobRowID = 4, Qty = 1.0 }, @@ -336,7 +296,7 @@ namespace Lux.Data.Migrations JobRowItemID = 3, Description = "Ferramenta AGB - rif. AGFD.00000.00000", Index = 3, - ItemID = 6, + ItemID = 3, JobRowID = 5, Qty = 1.0 }); @@ -385,7 +345,7 @@ namespace Lux.Data.Migrations JobRowID = 1, Description = "", Index = 1, - JobID = 1, + JobID = 2, PhaseID = 1, Qty = 1.0, ResourceID = 1 @@ -395,7 +355,7 @@ namespace Lux.Data.Migrations JobRowID = 2, Description = "", Index = 2, - JobID = 1, + JobID = 2, PhaseID = 2, Qty = 1.0, ResourceID = 2 @@ -405,7 +365,7 @@ namespace Lux.Data.Migrations JobRowID = 3, Description = "", Index = 3, - JobID = 1, + JobID = 2, PhaseID = 4, Qty = 1.0, ResourceID = 6 @@ -415,7 +375,7 @@ namespace Lux.Data.Migrations JobRowID = 4, Description = "", Index = 4, - JobID = 1, + JobID = 2, PhaseID = 3, Qty = 1.0, ResourceID = 4 @@ -425,7 +385,7 @@ namespace Lux.Data.Migrations JobRowID = 5, Description = "", Index = 5, - JobID = 1, + JobID = 2, PhaseID = 5, Qty = 1.0, ResourceID = 6 @@ -435,7 +395,7 @@ namespace Lux.Data.Migrations JobRowID = 6, Description = "", Index = 6, - JobID = 1, + JobID = 2, PhaseID = 6, Qty = 1.0, ResourceID = 7 @@ -493,12 +453,12 @@ namespace Lux.Data.Migrations CustomerID = 2, DealerID = 2, Description = "Offerta per tre serramenti", - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8791), - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8792), + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3672), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3673), RefNum = 1, RefRev = 1, RefYear = 2024, - ValidUntil = new DateTime(2025, 7, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8788) + ValidUntil = new DateTime(2025, 7, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3668) }); }); @@ -516,9 +476,6 @@ namespace Lux.Data.Migrations b.Property("Inserted") .HasColumnType("datetime(6)"); - b.Property("ItemID") - .HasColumnType("int"); - b.Property("ItemSPP") .IsRequired() .HasColumnType("longtext"); @@ -539,16 +496,19 @@ namespace Lux.Data.Migrations b.Property("RowNum") .HasColumnType("int"); + b.Property("SellItemID") + .HasColumnType("int"); + b.Property("SerStruct") .IsRequired() .HasColumnType("longtext"); b.HasKey("OfferRowID"); - b.HasIndex("ItemID"); - b.HasIndex("OfferID"); + b.HasIndex("SellItemID"); + b.ToTable("OfferRowList"); b.HasData( @@ -556,42 +516,42 @@ namespace Lux.Data.Migrations { OfferRowID = 1, Cost = 950.0, - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8814), - ItemID = 1, + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3701), ItemSPP = "{}", - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8816), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3703), Note = "Finestra anta singola 2025", OfferID = 1, Qty = 3.0, RowNum = 1, + SellItemID = 1, SerStruct = "{}" }, new { OfferRowID = 2, Cost = 160.0, - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8822), - ItemID = 2, + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3709), ItemSPP = "{}", - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8824), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3711), Note = "Persiana per Finestra anta singola 2025", OfferID = 1, Qty = 3.0, RowNum = 1, + SellItemID = 2, SerStruct = "{}" }, new { OfferRowID = 3, Cost = 200.0, - Inserted = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8829), - ItemID = 3, + Inserted = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3716), ItemSPP = "{}", - Modified = new DateTime(2025, 6, 20, 10, 38, 24, 772, DateTimeKind.Local).AddTicks(8831), + Modified = new DateTime(2025, 6, 20, 11, 6, 4, 160, DateTimeKind.Local).AddTicks(3717), Note = "Installazione serramento", OfferID = 1, Qty = 3.0, RowNum = 1, + SellItemID = 3, SerStruct = "{}" }); }); @@ -740,6 +700,93 @@ namespace Lux.Data.Migrations }); }); + modelBuilder.Entity("Lux.Data.DbModel.SellItemModel", b => + { + b.Property("SellItemID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property("SellItemID")); + + b.Property("Cost") + .HasColumnType("double"); + + b.Property("Description") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("ExtItemCode") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("IsService") + .HasColumnType("tinyint(1)"); + + b.Property("ItemCode") + .HasColumnType("int"); + + b.Property("JobID") + .HasColumnType("int"); + + b.Property("Margin") + .HasColumnType("double"); + + b.Property("SupplCode") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("UM") + .IsRequired() + .HasColumnType("longtext"); + + b.HasKey("SellItemID"); + + b.HasIndex("JobID"); + + b.ToTable("SellItem"); + + b.HasData( + new + { + SellItemID = 1, + Cost = 820.0, + Description = "Finestra anta Singola", + ExtItemCode = "", + IsService = false, + ItemCode = 0, + JobID = 2, + Margin = 0.20000000000000001, + SupplCode = "", + UM = "#" + }, + new + { + SellItemID = 2, + Cost = 150.0, + Description = "Persiana anta singola", + ExtItemCode = "", + IsService = false, + ItemCode = 0, + JobID = 1, + Margin = 0.10000000000000001, + SupplCode = "", + UM = "#" + }, + new + { + SellItemID = 3, + Cost = 200.0, + Description = "Installazione", + ExtItemCode = "", + IsService = true, + ItemCode = 0, + JobID = 1, + Margin = 0.29999999999999999, + SupplCode = "", + UM = "#" + }); + }); + modelBuilder.Entity("Lux.Data.DbModel.SupplierModel", b => { b.Property("SupplierID") @@ -906,21 +953,32 @@ namespace Lux.Data.Migrations modelBuilder.Entity("Lux.Data.DbModel.OfferRowModel", b => { - b.HasOne("Lux.Data.DbModel.ItemModel", "ItemNav") - .WithMany() - .HasForeignKey("ItemID") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - b.HasOne("Lux.Data.DbModel.OfferModel", "OfferNav") .WithMany() .HasForeignKey("OfferID") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); - b.Navigation("ItemNav"); + b.HasOne("Lux.Data.DbModel.SellItemModel", "SellItemNav") + .WithMany() + .HasForeignKey("SellItemID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.Navigation("OfferNav"); + + b.Navigation("SellItemNav"); + }); + + modelBuilder.Entity("Lux.Data.DbModel.SellItemModel", b => + { + b.HasOne("Lux.Data.DbModel.JobModel", "JobNav") + .WithMany() + .HasForeignKey("JobID") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("JobNav"); }); #pragma warning restore 612, 618 } diff --git a/Lux.Data/ModelBuilderExtensions.cs b/Lux.Data/ModelBuilderExtensions.cs index c0dcad00..d739482a 100644 --- a/Lux.Data/ModelBuilderExtensions.cs +++ b/Lux.Data/ModelBuilderExtensions.cs @@ -48,14 +48,12 @@ namespace Lux.Data // inizializzazione dei valori di default x Item modelBuilder.Entity().HasData( - new ItemModel { ItemID = 1, IsService = false, IsMake = true, Description = "Finestra anta Singola", Cost = 820, Margin = 0.2 }, - new ItemModel { ItemID = 2, IsService = false, IsMake = false, Description = "Persiana anta singola", Cost = 150, Margin = 0.1 }, - new ItemModel { ItemID = 3, IsService = true, IsMake = true, Description = "Installazione", Cost = 200, Margin = 0.3 }, - new ItemModel { ItemID = 4, IsService = false, IsMake = false, Description = "Barra di legno 80x120", Cost = 50, Margin = 0.3 }, - new ItemModel { ItemID = 5, IsService = false, IsMake = false, Description = "Vernice trasparente", Cost = 35, Margin = 0.3 }, - new ItemModel { ItemID = 6, IsService = false, IsMake = false, Description = "Ferramenta", Cost = 1, Margin = 0.3 } + new ItemModel { ItemID = 1, IsService = false, Description = "Barra di legno 80x120", Cost = 50, Margin = 0.3 }, + new ItemModel { ItemID = 2, IsService = false, Description = "Vernice trasparente", Cost = 35, Margin = 0.3 }, + new ItemModel { ItemID = 3, IsService = false, Description = "Ferramenta", Cost = 1, Margin = 0.3 } ); + // inizializzazione risorse modelBuilder.Entity().HasData( new ResourceModel { ResourceID = 1, Description = "Sezionatrice", IsAsset = true, IsHuman = false, UnitCost = 15, UM = "€/h" }, @@ -80,7 +78,8 @@ namespace Lux.Data // inizializzazione cicli modelBuilder.Entity().HasData( - new JobModel { JobID = 1, Description = "Serramento Completo Legno su linea Saomad e installatore interno" }//, + new JobModel { JobID = 1, Description = "Rivendita / servizi" }, + new JobModel { JobID = 2, Description = "Serramento Completo Legno su linea Saomad e installatore interno" }//, //new JobModel { JobID = 2, Description = "Serramento Completo Legno/Alluminio" }, //new JobModel { JobID = 3, Description = "Persiana Legno" }, //new JobModel { JobID = 4, Description = "restauro Persiana Esistente" } @@ -88,22 +87,29 @@ namespace Lux.Data // init righe ciclo (fasi di ciclo) modelBuilder.Entity().HasData( - new JobRowModel { JobRowID = 1, JobID = 1, Index = 1, PhaseID = 1, Qty = 1, ResourceID = 1 }, - new JobRowModel { JobRowID = 2, JobID = 1, Index = 2, PhaseID = 2, Qty = 1, ResourceID = 2 }, - new JobRowModel { JobRowID = 3, JobID = 1, Index = 3, PhaseID = 4, Qty = 1, ResourceID = 6 }, - new JobRowModel { JobRowID = 4, JobID = 1, Index = 4, PhaseID = 3, Qty = 1, ResourceID = 4 }, - new JobRowModel { JobRowID = 5, JobID = 1, Index = 5, PhaseID = 5, Qty = 1, ResourceID = 6 }, - new JobRowModel { JobRowID = 6, JobID = 1, Index = 6, PhaseID = 6, Qty = 1, ResourceID = 7 } + new JobRowModel { JobRowID = 1, JobID = 2, Index = 1, PhaseID = 1, Qty = 1, ResourceID = 1 }, + new JobRowModel { JobRowID = 2, JobID = 2, Index = 2, PhaseID = 2, Qty = 1, ResourceID = 2 }, + new JobRowModel { JobRowID = 3, JobID = 2, Index = 3, PhaseID = 4, Qty = 1, ResourceID = 6 }, + new JobRowModel { JobRowID = 4, JobID = 2, Index = 4, PhaseID = 3, Qty = 1, ResourceID = 4 }, + new JobRowModel { JobRowID = 5, JobID = 2, Index = 5, PhaseID = 5, Qty = 1, ResourceID = 6 }, + new JobRowModel { JobRowID = 6, JobID = 2, Index = 6, PhaseID = 6, Qty = 1, ResourceID = 7 } ); // init item righe ciclo (articoli delle fasi del ciclo) modelBuilder.Entity().HasData( - new JobRowItemModel { JobRowItemID = 1, JobRowID = 1, Index = 1, ItemID = 4, Qty = 4.5, Description = "Grezzo legno abete" }, - new JobRowItemModel { JobRowItemID = 2, JobRowID = 4, Index = 2, ItemID = 5, Qty = 1, Description = "Vernice trasparente standard 1L" }, - new JobRowItemModel { JobRowItemID = 3, JobRowID = 5, Index = 3, ItemID = 6, Qty = 1, Description = "Ferramenta AGB - rif. AGFD.00000.00000" } + new JobRowItemModel { JobRowItemID = 1, JobRowID = 1, Index = 1, ItemID = 1, Qty = 4.5, Description = "Grezzo legno abete" }, + new JobRowItemModel { JobRowItemID = 2, JobRowID = 4, Index = 2, ItemID = 2, Qty = 1, Description = "Vernice trasparente standard 1L" }, + new JobRowItemModel { JobRowItemID = 3, JobRowID = 5, Index = 3, ItemID = 3, Qty = 1, Description = "Ferramenta AGB - rif. AGFD.00000.00000" } ); + // inizializzazione dei valori di default x Item + modelBuilder.Entity().HasData( + new SellItemModel { SellItemID = 1, IsService = false, Description = "Finestra anta Singola", Cost = 820, Margin = 0.2, JobID = 2 }, + new SellItemModel { SellItemID = 2, IsService = false, Description = "Persiana anta singola", Cost = 150, Margin = 0.1, JobID = 1 }, + new SellItemModel { SellItemID = 3, IsService = true, Description = "Installazione", Cost = 200, Margin = 0.3, JobID = 1 } + ); + // inizializzazione dei valori di default x Offer modelBuilder.Entity().HasData( new OfferModel { OfferID = 1, RefYear = 2024, RefNum = 1, RefRev = 1, Description = "Offerta per tre serramenti", CustomerID = 2, DealerID = 2 } @@ -114,9 +120,9 @@ namespace Lux.Data // inizializzazione dei valori di default x OfferRow modelBuilder.Entity().HasData( - new OfferRowModel { OfferRowID = 1, OfferID = 1, Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 950, ItemID = 1, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Finestra anta singola 2025", ItemSPP = "{}" }, - new OfferRowModel { OfferRowID = 2, OfferID = 1, Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 160, ItemID = 2, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Persiana per Finestra anta singola 2025", ItemSPP = "{}" }, - new OfferRowModel { OfferRowID = 3, OfferID = 1, Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 200, ItemID = 3, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Installazione serramento", ItemSPP = "{}" } + new OfferRowModel { OfferRowID = 1, OfferID = 1, Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 950, SellItemID = 1, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Finestra anta singola 2025", ItemSPP = "{}" }, + new OfferRowModel { OfferRowID = 2, OfferID = 1, Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 160, SellItemID = 2, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Persiana per Finestra anta singola 2025", ItemSPP = "{}" }, + new OfferRowModel { OfferRowID = 3, OfferID = 1, Inserted = DateTime.Now, Modified = DateTime.Now, Cost = 200, SellItemID = 3, Qty = 3, RowNum = 1, SerStruct = "{}", Note = "Installazione serramento", ItemSPP = "{}" } );