Fix metodo impostanuoe nuova weight
This commit is contained in:
@@ -88,6 +88,25 @@ namespace MP.IOC.Components.Pages
|
||||
SelRecord = curRec;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imposta il peso del metodo "New" come richiesto, con eventuale check sui limiti 0-100
|
||||
/// </summary>
|
||||
/// <param name="curRec"></param>
|
||||
/// <param name="newWeight"></param>
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user