From 07c58c5738647c8e4073a894feb0859659be1bb0 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Thu, 15 Sep 2022 15:46:39 +0200 Subject: [PATCH] Pulizia metodi inutilizzati --- MP.SPEC/Components/ListPARAMS.razor.cs | 21 ++++++--------- MP.SPEC/Pages/PARAMS.razor.cs | 36 ++++++++++++++++---------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/MP.SPEC/Components/ListPARAMS.razor.cs b/MP.SPEC/Components/ListPARAMS.razor.cs index 49c9dd07..4b8eda6b 100644 --- a/MP.SPEC/Components/ListPARAMS.razor.cs +++ b/MP.SPEC/Components/ListPARAMS.razor.cs @@ -14,7 +14,8 @@ namespace MP.SPEC.Components public EventCallback PagerResetReq { get; set; } [Parameter] - public SelectFluxParams SelFilter + public SelectFluxParams SelFilter { get; set; } = null!; +#if false { get => _selFilter; set @@ -22,13 +23,10 @@ namespace MP.SPEC.Components if (!_selFilter.Equals(value)) { _selFilter = value; -#if false - var pUpd = Task.Run(async () => await reloadData(true)); - pUpd.Wait(); -#endif } } - } + } +#endif [Parameter] public EventCallback TotRecordChanged { get; set; } @@ -153,9 +151,7 @@ namespace MP.SPEC.Components #region Private Fields private static System.Timers.Timer aTimer = null!; - private int _maxRecord = 100; - private string _selFlux = "*"; - private string _selMacchina = "*"; + private int _totalCount = 0; private FluxLog? currRecord = null; private List? ListRecords; @@ -165,7 +161,6 @@ namespace MP.SPEC.Components #region Private Properties - private SelectFluxParams _selFilter { get; set; } = new SelectFluxParams(); private int currPage { @@ -182,7 +177,7 @@ namespace MP.SPEC.Components private int MaxRecord { - get => _selFilter.MaxRecord; + get => SelFilter.MaxRecord; } #if false @@ -225,12 +220,12 @@ namespace MP.SPEC.Components private string SelFlux { - get => _selFilter.CodFlux; + get => SelFilter.CodFlux; } private string SelMacchina { - get => _selFilter.IdxMacchina; + get => SelFilter.IdxMacchina; } #if false diff --git a/MP.SPEC/Pages/PARAMS.razor.cs b/MP.SPEC/Pages/PARAMS.razor.cs index eb76caad..501b3d2a 100644 --- a/MP.SPEC/Pages/PARAMS.razor.cs +++ b/MP.SPEC/Pages/PARAMS.razor.cs @@ -9,29 +9,35 @@ namespace MP.SPEC.Pages { #region Protected Fields +#if false protected string _selFlux = "*"; protected string _selMacchina = "*"; - protected string lastUpdate = "-"; - protected DataPager pagerODL; + protected string lastUpdate = "-"; protected bool reqNew = false; + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + [Inject] + protected MpDataService MDService { get; set; } +#endif + protected DataPager pagerODL; #endregion Protected Fields #region Protected Properties - [Inject] - protected IJSRuntime JSRuntime { get; set; } - protected bool liveUpdate { get; set; } = true; - - [Inject] - protected MpDataService MDService { get; set; } +#if false + protected bool liveUpdate { get; set; } = true; +#endif [Inject] protected MessageService MsgService { get; set; } +#if false [Inject] protected NavigationManager NavManager { get; set; } +#endif #endregion Protected Properties @@ -44,8 +50,8 @@ namespace MP.SPEC.Pages protected void ForceReloadPage(int newNum) { - //liveUpdate = newNum == 1; currPage = newNum; + currFilter.LiveUpdate = (currPage == 1); } protected override async Task OnInitializedAsync() @@ -56,12 +62,12 @@ namespace MP.SPEC.Pages // resetto search MsgService.SearchVal = ""; +#if false // carico dati lastUpdate = $"Updated: {DateTime.Now:yyyy/MM/dd HH:mm:ss}"; -#if false await reloadFilters(); -#endif await reloadData(); +#endif isLoading = false; } @@ -119,6 +125,7 @@ namespace MP.SPEC.Pages #region Private Methods +#if false private async Task reloadData() { isLoading = true; @@ -129,14 +136,17 @@ namespace MP.SPEC.Pages } isLoading = false; await Task.Delay(1); - } + } +#endif private async Task updateFilter(SelectFluxParams newParams) { isLoading = true; currFilter = newParams; - liveUpdate = newParams.LiveUpdate; +#if false + liveUpdate = newParams.LiveUpdate; +#endif await Task.Delay(1); await InvokeAsync(() => StateHasChanged()); //await Task.Delay(1);