From 6fbe53b8b99541c07981b2dfdbfe75a6058d117a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Apr 2026 11:53:51 +0200 Subject: [PATCH] Fix metodo impostanuoe nuova weight --- MP.IOC/Components/Pages/RouteConf.razor.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/MP.IOC/Components/Pages/RouteConf.razor.cs b/MP.IOC/Components/Pages/RouteConf.razor.cs index 18edc714..c18c066b 100644 --- a/MP.IOC/Components/Pages/RouteConf.razor.cs +++ b/MP.IOC/Components/Pages/RouteConf.razor.cs @@ -88,6 +88,25 @@ namespace MP.IOC.Components.Pages SelRecord = curRec; } + /// + /// Imposta il peso del metodo "New" come richiesto, con eventuale check sui limiti 0-100 + /// + /// + /// + private async Task SetNewWeight(WeightDTO curRec, int newWeight) + { + newWeight = Math.Clamp(newWeight, 0, 100); + curRec.NewWeight = newWeight; + curRec.OldWeight = 100 - newWeight; + // salvo! + WService.UpsertWeight(curRec); + // rileggo! + await ReloadData(); + UpdateTable(); + } + + + private void DoReset() { SelRecord = null;