Fix bind oggetti

This commit is contained in:
Samuele Locatelli
2025-07-14 12:03:36 +02:00
parent 62da66f446
commit 4e98d63c89
2 changed files with 20 additions and 8 deletions
+5 -5
View File
@@ -8,25 +8,25 @@
<div>
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">Altezza</span>
<input type="text" class="form-control" placeholder="1800" aria-label="Height" aria-describedby="basic-addon1">
<input type="number" class="form-control" placeholder="1800" aria-label="Height" @bind="@CurrWindow.Altezza">
<span class="input-group-text">mm</span>
</div>
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">Larghezza</span>
<input type="text" class="form-control" placeholder="1200" aria-label="Width" aria-describedby="basic-addon1">
<input type="number" class="form-control" placeholder="1200" aria-label="Width" @bind="@CurrWindow.Larghezza">
<span class="input-group-text">mm</span>
</div>
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">Forma</span>
<input type="text" class="form-control" placeholder="Rettangolo" aria-label="Shape" aria-describedby="basic-addon1">
<input type="text" class="form-control" placeholder="Rettangolo" aria-label="Shape" @bind="@CurrWindow.Forma">
</div>
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">Numero ante</span>
<input type="text" class="form-control" placeholder="2" aria-label="NumDoor" aria-describedby="basic-addon1">
<input type="text" class="form-control" placeholder="2" aria-label="NumDoor">
</div>
<div class="input-group mb-3 w-25">
<span class="input-group-text" id="basic-addon1">Altezza maniglia</span>
<input type="text" class="form-control" placeholder="1000" aria-label="HeightHandle" aria-describedby="basic-addon1">
<input type="text" class="form-control" placeholder="1000" aria-label="HeightHandle">
<span class="input-group-text">mm</span>
</div>
</div>
+15 -3
View File
@@ -1,5 +1,6 @@
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using System.Runtime.Intrinsics.X86;
using System.Text.Json.Serialization;
using WebWindowConfigurator.Json;
@@ -30,9 +31,9 @@ namespace WebWindowConfigurator
protected async Task DoSave()
{
var CurrentWindow = new JsonWindow("Profilo68");
var Frame = new JsonFrame(WindowConst.Shapes.RECTANGLE, false, 0);
Frame.DimensionList.Add(new JsonFrameDimension(1, "Larghezza", 800));
Frame.DimensionList.Add(new JsonFrameDimension(1, "Altezza", 1200));
var Frame = new JsonFrame(CurrWindow.Forma, false, 0);
Frame.DimensionList.Add(new JsonFrameDimension(1, "Larghezza", CurrWindow.Larghezza));
Frame.DimensionList.Add(new JsonFrameDimension(1, "Altezza", CurrWindow.Altezza));
Frame.AreaList.Add(new JsonSash(true, WindowConst.SashTypes.ACTIVE, ""));
CurrentWindow.AreaList.Add(Frame);
@@ -41,6 +42,17 @@ namespace WebWindowConfigurator
await EC_Update.InvokeAsync(CurrJwd);
}
public class WindowDto
{
public double Altezza { get; set; } = 1200;
public double Larghezza { get; set; } = 800;
public WindowConst.Shapes Forma { get; set; } = WindowConst.Shapes.RECTANGLE;
}
protected WindowDto CurrWindow { get; set; } = new WindowDto();
#endregion Protected Methods
}
}