Files
2023-03-03 09:18:45 +01:00

79 lines
2.1 KiB
C#

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<VLocationValModel>? LocationVals { get; set; } = null;
[Parameter]
public EventCallback<string> LocId_DX { get; set; }
[Parameter]
public EventCallback<string> 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)
{
currLocId_DX = locId;
await LocId_DX.InvokeAsync(locId);
}
protected async Task setLocationSX(string locId)
{
currLocId_SX = locId;
await LocId_SX.InvokeAsync(locId);
}
public LocSXSelectFilter currFilterSX { get; set; } = new LocSXSelectFilter();
public LocDXSelectFilter currFilterDX { get; set; } = new LocDXSelectFilter();
private string currLocId_SX
{
get => currFilterSX.idSx;
set => currFilterSX.idSx = value;
}
private string currLocId_DX
{
get => currFilterDX.idDx;
set => currFilterDX.idDx = value;
}
#endregion Protected Methods
}
}