From fbfc74106c3e0b3e1422820d885b2f2e522ddada Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 14 Dec 2023 11:58:39 +0100 Subject: [PATCH 1/2] Aggiunto chiamata stored quando si chiede show KIT --- MP-TAB-SERV/Components/ScrapMan.razor.cs | 25 +++++++++++++------ .../DatabaseModels/RegistroScartiKitModel.cs | 2 -- MP.Data/MoonProContext.cs | 4 +++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/MP-TAB-SERV/Components/ScrapMan.razor.cs b/MP-TAB-SERV/Components/ScrapMan.razor.cs index 284b7eb5..6d23dc6d 100644 --- a/MP-TAB-SERV/Components/ScrapMan.razor.cs +++ b/MP-TAB-SERV/Components/ScrapMan.razor.cs @@ -114,16 +114,25 @@ namespace MP_TAB_SERV.Components await doUpdate(); } - protected void ShowKitDetail(RegistroScartiModel currItem) + protected async Task ShowKitDetail(RegistroScartiModel currItem) { - // faccio toggle show item (se era già selezionato --> null!) - if (!currItem.Equals(selItem)) + // deve essere != null in primis... + if (currItem != null) { - selItem = currItem; - } - else - { - selItem = null; + // verifico se serve creare split dell'oggetto (hard coded!!!) + if (currItem.Tipo == "KIT" && !currItem.KitSplit) + { + await TabDServ.RegScartiKitSplit(currItem); + } + // faccio toggle show item (se era già selezionato --> null!) + if (!currItem.Equals(selItem)) + { + selItem = currItem; + } + else + { + selItem = null; + } } } diff --git a/MP.Data/DatabaseModels/RegistroScartiKitModel.cs b/MP.Data/DatabaseModels/RegistroScartiKitModel.cs index 5701d4c0..ed84ff8b 100644 --- a/MP.Data/DatabaseModels/RegistroScartiKitModel.cs +++ b/MP.Data/DatabaseModels/RegistroScartiKitModel.cs @@ -14,8 +14,6 @@ namespace MP.Data.DatabaseModels { #region Public Properties - [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public int IdxRSK { get; set; } public string IdxMacchina { get; set; } = ""; public DateTime DataOra { get; set; } = DateTime.Now; public string Causale { get; set; } = ""; diff --git a/MP.Data/MoonProContext.cs b/MP.Data/MoonProContext.cs index a0c0cdd7..bcda74b5 100644 --- a/MP.Data/MoonProContext.cs +++ b/MP.Data/MoonProContext.cs @@ -552,6 +552,10 @@ namespace MP.Data { entity.HasKey(e => new { e.IdxMacchina, e.DataOra, e.Causale }); }); + modelBuilder.Entity(entity => + { + entity.HasKey(e => new { e.IdxMacchina, e.DataOra, e.Causale, e.CodArticolo }); + }); modelBuilder.Entity(entity => { From 5c7c34e0112d2a68424f0090f498923cf74f4c17 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 14 Dec 2023 11:59:27 +0100 Subject: [PATCH 2/2] FIX: mostra solo x i veri kit --- MP-TAB-SERV/Components/ScrapMan.razor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MP-TAB-SERV/Components/ScrapMan.razor b/MP-TAB-SERV/Components/ScrapMan.razor index 0c5916e7..4dbd766f 100644 --- a/MP-TAB-SERV/Components/ScrapMan.razor +++ b/MP-TAB-SERV/Components/ScrapMan.razor @@ -78,7 +78,7 @@
× - @if (item.Tipo == "ART") + @if (item.Tipo == "KIT") {