Files
lux/Lux.UI/Components/Pages/GenList.razor.cs
T
2025-09-19 18:54:25 +02:00

95 lines
2.2 KiB
C#

using EgwCoreLib.Lux.Data.DbModel.Items;
using EgwCoreLib.Lux.Data.DbModel.Utils;
using EgwCoreLib.Lux.Data.Services;
using Lux.UI.Components.Compo;
using Microsoft.AspNetCore.Components;
using System.Threading.Tasks;
namespace Lux.UI.Components.Pages
{
public partial class GenList
{
#region Protected Fields
protected List<GenClassModel> ListGenClass = new List<GenClassModel>();
#endregion Protected Fields
#region Protected Properties
protected GenValMan.FiltSelect CurrFilt { get; set; } = new GenValMan.FiltSelect();
[Inject]
protected DataLayerServices DLService { get; set; } = null!;
protected string SearchVal
{
get => CurrFilt.SearchVal;
set
{
isLoading = true;
CurrFilt.SearchVal = value;
isLoading = false;
}
}
protected string SelCodGroup
{
get => CurrFilt.SelCodGroup;
set
{
if (CurrFilt.SelCodGroup != value)
{
isLoading = true;
CurrFilt.SelCodGroup = value;
isLoading = false;
}
}
}
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
isLoading = true;
await ReloadBaseData();
}
protected void ResetSearch()
{
SearchVal = "";
}
#endregion Protected Methods
#region Private Fields
private ItemModel? editRecord = null;
private bool isLoading = false;
#endregion Private Fields
#region Private Methods
private async Task ForceReloadAsync()
{
await ReloadBaseData();
}
private async Task ReloadBaseData()
{
isLoading = true;
ListGenClass = await DLService.GenClassGetAllAsync();
isLoading = false;
}
private void SaveSel(string codGroup)
{
SelCodGroup = codGroup;
}
#endregion Private Methods
}
}