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;