diff --git a/StockMan.CORE/Pages/Posizioni.razor b/StockMan.CORE/Pages/Posizioni.razor index 3c9df7a..cf027f5 100644 --- a/StockMan.CORE/Pages/Posizioni.razor +++ b/StockMan.CORE/Pages/Posizioni.razor @@ -1,4 +1,4 @@ -@page "/Operatori" +@page "/Posizioni" @if (isLoading) @@ -25,16 +25,12 @@ else - Id esterno + Desc - Cognome + Tipo - Nome - - - @@ -46,7 +42,7 @@ else @item.Descr - @item.LocTypeNav.Descr + @(item.LocTypeNav?.Descr??"") diff --git a/StockMan.CORE/Pages/Posizioni.razor.cs b/StockMan.CORE/Pages/Posizioni.razor.cs index dc29e0c..917383e 100644 --- a/StockMan.CORE/Pages/Posizioni.razor.cs +++ b/StockMan.CORE/Pages/Posizioni.razor.cs @@ -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? 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 } } \ No newline at end of file