using Lux.UI.Components.Compo.Generic; namespace Lux.UI.Components.Pages { public partial class GenList { #region Protected Methods protected override Task OnInitializedAsync() { isLoading = true; return ReloadBaseData(); } #endregion Protected Methods #region Private Fields #if false private ItemModel? editRecord = null; #endif private bool isLoading = false; private List ListGenClass = new List(); #endregion Private Fields #region Private Properties private GenValMan.FiltSelect CurrFilt { get; set; } = new GenValMan.FiltSelect(); [Inject] private IGenClassService DLService { get; set; } = null!; private string SearchVal { get => CurrFilt.SearchVal; set { isLoading = true; CurrFilt.SearchVal = value; isLoading = false; } } private string btnResetCss { get => string.IsNullOrEmpty(CurrFilt.SearchVal) ? "btn-outline-secondary" : "btn-primary"; } private string SelCodGroup { get => CurrFilt.SelCodGroup; set { if (CurrFilt.SelCodGroup != value) { isLoading = true; CurrFilt.SelCodGroup = value; isLoading = false; } } } #endregion Private Properties #region Private Methods private Task ForceReloadAsync() { return ReloadBaseData(); } private async Task ReloadBaseData() { isLoading = true; ListGenClass = await DLService.GetAllAsync(); isLoading = false; } private void ResetSearch() { SearchVal = ""; } private void SaveSel(string codGroup) { SelCodGroup = codGroup; } #endregion Private Methods } }