using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using MP.Data.DatabaseModels; using MP.SPEC.Components; using MP.SPEC.Data; namespace MP.SPEC.Pages { public partial class DOSS { #region Protected Fields protected DataPager pagerODL = null!; #endregion Protected Fields #region Protected Properties [Inject] protected MessageService MsgService { get; set; } = null!; #endregion Protected Properties #region Protected Methods protected void ForceReload(int newNum) { numRecord = newNum; } protected void ForceReloadPage(int newNum) { currPage = newNum; StateHasChanged(); } private FluxLog? _currRecord = null; private FluxLog? currRecord { get => _currRecord; set { _currRecord = value; } } protected async Task cancel() { currRecord = null; await Task.Delay(1); } protected async Task update(FluxLog selRec) { //if (!await JSRuntime.InvokeAsync("confirm", "Confermi di voler salvare le modifiche?")) // return; await Task.Delay(1); //METODO PER UPDATE FLUX #if false var done = await await callSyncDb(selRec); currRecord = null; # endif await Task.Delay(1); } protected override async Task OnInitializedAsync() { isLoading = true; isFiltering = true; // disabilito ricerca... MsgService.SearchVal = ""; MsgService.ShowSearch = false; // fix pagina await Task.Delay(1); var modFilter = currFilter; modFilter.CurrPage = 1; currFilter = modFilter; await Task.Delay(1); isFiltering = false; } protected async Task selRecordFlux(FluxLog selRec) { currRecord = selRec; await Task.Delay(1); } protected void updateTotal(int newTotCount) { totalCount = newTotCount; } #endregion Protected Methods #region Private Properties private SelectDossierParams currFilter { get; set; } = new SelectDossierParams(); private int currPage { get => MsgService.currPage; set => MsgService.currPage = value; } private bool isFiltering { get; set; } = false; private bool isLoading { get; set; } = true; private int numRecord { get => MsgService.numRecord; set => MsgService.numRecord = value; } private int totalCount { get; set; } = 0; #endregion Private Properties #region Private Methods private async Task updateFilter(SelectDossierParams newParams) { isFiltering = false; isLoading = true; await Task.Delay(1); currPage = 1; await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); currFilter = newParams; isLoading = false; } #endregion Private Methods } }