Fix pagina posizioni

This commit is contained in:
Samuele Locatelli
2023-03-02 08:41:27 +01:00
parent 23a814a5c8
commit bd0ccb3d10
2 changed files with 70 additions and 76 deletions
+4 -8
View File
@@ -1,4 +1,4 @@
@page "/Operatori"
@page "/Posizioni"
@if (isLoading)
@@ -25,16 +25,12 @@ else
<thead>
<tr>
<th>
Id esterno
Desc
</th>
<th>
Cognome
Tipo
</th>
<th>
Nome
</th>
<th>
</th>
</tr>
</thead>
@@ -46,7 +42,7 @@ else
@item.Descr
</td>
<td>
@item.LocTypeNav.Descr
@(item.LocTypeNav?.Descr??"")
</td>
<td>
<button class="btn btn-sm btn-primary" data-bs-toggle="modal" data-bs-target="#modalNewFam" @onclick="()=>setCurrLoc(item)"><i class="fa-solid fa-pen-to-square"></i></button>
+66 -68
View File
@@ -1,55 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
using System.Net.Http;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.Forms;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.Web.Virtualization;
using Microsoft.JSInterop;
using EgwCoreLib.Razor;
using EgwCoreLib.Razor.Data;
using StockMan.CORE;
using StockMan.CORE.Data;
using StockMan.CORE.Shared;
using StockMan.Data.DbModels;
using StockMan.Data;
namespace StockMan.CORE.Pages
{
public partial class Posizioni
{
#region Public Properties
public LocationModel? currLoc { get; set; } = null;
public bool isLoading { get; set; } = false;
#endregion Public Properties
#region Protected Fields
protected string _descr = "";
protected string _ID = "";
protected string _loctype = "";
protected List<LocationModel>? listLocAll = null;
#endregion Protected Fields
#region Protected Properties
protected string descr
{
get => _descr;
set { _descr = value; }
}
protected string ID
{
get => _ID;
set { _ID = value; }
}
protected string loctype
{
get => _loctype;
set { _loctype = value; }
}
[Inject]
protected NavigationManager NavManager { get; set; } = null!;
[Inject]
protected StockDataService SDService { get; set; } = null!;
[Inject]
protected NavigationManager NavManager{ get; set; } = null!;
public bool isLoading { get; set; } = false;
public LocationModel? currLoc { get; set; } = null;
protected override async Task OnInitializedAsync()
{
isLoading = true;
listLocAll = await SDService.LocationGetAll();
isLoading = false;
}
protected async Task ModOpr()
{
LocationModel currRecToMod = new LocationModel()
{
Descr = descr,
LocTypeId = loctype
};
var done = await SDService.LocationMod(currRecToMod);
if (done)
{
NavManager.NavigateTo(NavManager.Uri, true);
}
}
#endregion Protected Properties
#region Protected Methods
protected async Task addNewItem()
{
LocationModel currRecToMod = new LocationModel()
@@ -63,6 +65,28 @@ namespace StockMan.CORE.Pages
NavManager.NavigateTo(NavManager.Uri, true);
}
}
protected async Task ModOpr()
{
LocationModel currRecToMod = new LocationModel()
{
Descr = descr,
LocTypeId = loctype
};
var done = await SDService.LocationMod(currRecToMod);
if (done)
{
NavManager.NavigateTo(NavManager.Uri, true);
}
}
protected override async Task OnInitializedAsync()
{
isLoading = true;
listLocAll = await SDService.LocationGetAll();
isLoading = false;
}
protected async Task setCurrLoc(LocationModel currRecToMod)
{
await Task.Delay(1);
@@ -72,32 +96,6 @@ namespace StockMan.CORE.Pages
loctype = currRecToMod.LocTypeId;
}
protected string _ID = "";
protected string ID
{
get => _ID;
set
{
_ID = value;
}
}
protected string _descr = "";
protected string descr
{
get => _descr;
set
{
_descr = value;
}
}
protected string _loctype= "";
protected string loctype
{
get => _loctype;
set
{
_loctype = value;
}
}
#endregion Protected Methods
}
}