Ancora update x salvataggio dati DoorOp

This commit is contained in:
Samuele Locatelli
2023-04-07 17:17:07 +02:00
parent c11b13a420
commit 5deb3e0054
2 changed files with 19 additions and 6 deletions
@@ -85,11 +85,12 @@ else
}
}*@
<div class="row">
<div class="btn btn-danger col-6 px-1">
<div class="btn btn-danger col-6 px-1" @onclick="() => doCancel()">
Cancel
</div>
<button class="btn btn-success col-6 px-1" @onclick="() => doSave()">
Save
</button>
</div>
</div>
@@ -24,7 +24,7 @@ namespace WebDoorCreator.UI.Components.Hardware
public void setupCurrValues()
{
currVal = new Dictionary<string, string>();
//currVal = new Dictionary<string, string>();
if (!string.IsNullOrEmpty(DoorOpInst.JsoncActVal))
{
var deserialized = JsonConvert.DeserializeObject<Dictionary<string, string>>(DoorOpInst.JsoncActVal!);
@@ -63,6 +63,9 @@ namespace WebDoorCreator.UI.Components.Hardware
set => currVal["folder"] = value;
}
/// <summary>
/// Array dati
/// </summary>
protected Dictionary<string, string> currVal { get; set; } = null!;
protected string folderName
@@ -129,11 +132,14 @@ namespace WebDoorCreator.UI.Components.Hardware
await WDCService.DoorOpUpdate(DoorOpInst);
}
protected async Task doCancel()
{
await FullReloadData(true);
}
protected override async Task OnParametersSetAsync()
{
setupCurrValues();
setupGraphicParams();
await ReloadData(true);
await FullReloadData(true);
}
protected string translate(string lemma)
@@ -151,6 +157,12 @@ namespace WebDoorCreator.UI.Components.Hardware
#region Private Methods
private async Task FullReloadData(bool isFirst)
{
setupCurrValues();
setupGraphicParams();
await ReloadData(isFirst);
}
private async Task ReloadData(bool isFirst)
{
var tempListVal = await WDCService.ListValuesGetAll(HwCode, "Folder");