using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using StockMan.CORE.Data; using StockMan.Data.DbModels; namespace StockMan.CORE.Components { public partial class ValStockGiac { #region Public Properties [Parameter] public bool isCompact { get; set; } = false; public bool isLoading { get; set; } = false; public List? LocationVals { get; set; } = null; [Parameter] public EventCallback LocId_DX { get; set; } [Parameter] public EventCallback LocId_SX { get; set; } #endregion Public Properties #region Protected Properties [Inject] protected IJSRuntime JSRuntime { get; set; } = null!; [Inject] protected NavigationManager NavManager { get; set; } = null!; [Inject] protected StockDataService SDService { get; set; } = null!; protected decimal totStockValue { get; set; } = 0.00M; #endregion Protected Properties #region Protected Methods protected override async Task OnInitializedAsync() { isLoading = true; await Task.Delay(1); LocationVals = await SDService.StockStatus(); totStockValue = LocationVals.Sum(x => x.TotVal); isLoading = false; } protected async Task setLocationDX(string locId) { await LocId_DX.InvokeAsync(locId); } protected async Task setLocationSX(string locId) { await LocId_SX.InvokeAsync(locId); } #endregion Protected Methods } }