diff --git a/MP-TAB-SERV/Components/ScrapKitMan.razor b/MP-TAB-SERV/Components/ScrapKitMan.razor index f52bad9a..638ca44f 100644 --- a/MP-TAB-SERV/Components/ScrapKitMan.razor +++ b/MP-TAB-SERV/Components/ScrapKitMan.razor @@ -6,8 +6,13 @@ - diff --git a/MP-TAB-SERV/Components/ScrapKitMan.razor.cs b/MP-TAB-SERV/Components/ScrapKitMan.razor.cs index 3d1f352c..a5dceec4 100644 --- a/MP-TAB-SERV/Components/ScrapKitMan.razor.cs +++ b/MP-TAB-SERV/Components/ScrapKitMan.razor.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.Data.Services; using NLog; @@ -9,6 +10,9 @@ namespace MP_TAB_SERV.Components { #region Public Properties + [Parameter] + public EventCallback E_Updated { get; set; } + [Parameter] public RegistroScartiModel ParentKit { get; set; } = null!; @@ -16,6 +20,9 @@ namespace MP_TAB_SERV.Components #region Protected Properties + [Inject] + protected IJSRuntime JSRuntime { get; set; } = null!; + protected List ListComplete { get; set; } = new List(); protected List ListPaged { get; set; } = new List(); @@ -27,6 +34,19 @@ namespace MP_TAB_SERV.Components #region Protected Methods + protected async Task DeleteKitSplit() + { + if (!await JSRuntime.InvokeAsync("confirm", "Sicuro di voler eliminare il dettaglio del KIT scartato?")) + return; + + if (ParentKit != null) + { + await TabDServ.RegScartiKitDelete(ParentKit); + await ReloadData(); + await E_Updated.InvokeAsync(true); + } + } + protected override async Task OnParametersSetAsync() { await ReloadData(); diff --git a/MP-TAB-SERV/Components/ScrapMan.razor b/MP-TAB-SERV/Components/ScrapMan.razor index c9045a34..15404ad7 100644 --- a/MP-TAB-SERV/Components/ScrapMan.razor +++ b/MP-TAB-SERV/Components/ScrapMan.razor @@ -8,7 +8,7 @@ @if (enableScarti) {
- +
} else @@ -127,7 +127,7 @@ {
} diff --git a/MP-TAB-SERV/Components/ScrapMan.razor.cs b/MP-TAB-SERV/Components/ScrapMan.razor.cs index e2df7839..9040d15d 100644 --- a/MP-TAB-SERV/Components/ScrapMan.razor.cs +++ b/MP-TAB-SERV/Components/ScrapMan.razor.cs @@ -21,7 +21,7 @@ namespace MP_TAB_SERV.Components /// Aggiorno valori produzione alla data richiesta... /// /// - public async Task doUpdate() + protected async Task ReloadData() { isProcessing = true; await Task.Delay(1); @@ -36,6 +36,15 @@ namespace MP_TAB_SERV.Components await Task.Delay(1); } + protected async Task ForceReload(bool DoClose) + { + if (DoClose) + { + selItem = null; + } + await ReloadData(); + } + #endregion Public Methods #region Protected Properties @@ -67,7 +76,7 @@ namespace MP_TAB_SERV.Components DateTime fine = DateTime.Today.AddDays(1); DateTime inizio = fine.AddDays(-8); CurrPeriodo = new Periodo(inizio, fine); - await doUpdate(); + await ReloadData(); } } @@ -93,7 +102,7 @@ namespace MP_TAB_SERV.Components isProcessing = true; await Task.Delay(1); IdxMaccSel = selIdxMacc; - await doUpdate(); + await ReloadData(); isProcessing = false; await Task.Delay(1); } @@ -103,7 +112,7 @@ namespace MP_TAB_SERV.Components isProcessing = true; await Task.Delay(1); IdxOdl = selIdxOdl; - await doUpdate(); + await ReloadData(); isProcessing = false; await Task.Delay(1); } @@ -111,7 +120,7 @@ namespace MP_TAB_SERV.Components protected async Task SetPeriodo(Periodo newPeriodo) { CurrPeriodo = newPeriodo; - await doUpdate(); + await ReloadData(); } protected async Task ShowKitDetail(RegistroScartiModel currItem)
- Esplosione scarti KIT + +
+ Esplosione scarti KIT +
+
+ +
- +