From ff36428fcf93b035f1c27adf480061d77af73d44 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 19 Dec 2022 15:18:24 +0100 Subject: [PATCH] Aggiunto filtro x magazzino o descrizione x invetari --- MP.INVE/Components/InveSessionList.razor.cs | 11 +++++++++ MP.INVE/Data/SelectInveSessionParams.cs | 4 +++ MP.INVE/Pages/InveSession.razor | 27 +++++++++++++++------ MP.INVE/Pages/InveSession.razor.cs | 17 +++++++------ 4 files changed, 44 insertions(+), 15 deletions(-) diff --git a/MP.INVE/Components/InveSessionList.razor.cs b/MP.INVE/Components/InveSessionList.razor.cs index 14b129a9..1434fecc 100644 --- a/MP.INVE/Components/InveSessionList.razor.cs +++ b/MP.INVE/Components/InveSessionList.razor.cs @@ -104,6 +104,11 @@ namespace MP.INVE.Components get => currParams.authKey; set => currParams.authKey = value; } + private string searchVal + { + get => currParams.searchVal; + set => currParams.searchVal = value; + } [Inject] private IConfiguration Configuration { get; set; } = null!; @@ -221,6 +226,12 @@ namespace MP.INVE.Components { SearchRecords = MIDataservice.InventSessHistList(); } + //verifico filtro ricerca mag + if (!string.IsNullOrEmpty(searchVal)) + { + StringComparison strComp = StringComparison.CurrentCultureIgnoreCase; + SearchRecords = SearchRecords.Where(x => x.AnagMagNav.DescMag.Contains(searchVal, strComp) || x.Description.Contains(searchVal, strComp)).ToList(); + } totalCount = SearchRecords.Count; elencoSessioni = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); await Task.Delay(1); diff --git a/MP.INVE/Data/SelectInveSessionParams.cs b/MP.INVE/Data/SelectInveSessionParams.cs index 641536c3..9fbd04aa 100644 --- a/MP.INVE/Data/SelectInveSessionParams.cs +++ b/MP.INVE/Data/SelectInveSessionParams.cs @@ -23,6 +23,7 @@ namespace MP.INVE.Data public int currIdSession { get; set; } = 0; public int currIdMag { get; set; } = 0; public bool reqNew { get; set; } = false; + public string searchVal { get; set; } = ""; #endregion Public Properties @@ -33,6 +34,9 @@ namespace MP.INVE.Data if (!(obj is SelectInveSessionParams item)) return false; + if (searchVal != item.searchVal) + return false; + if (MaxRecord != item.MaxRecord) return false; diff --git a/MP.INVE/Pages/InveSession.razor b/MP.INVE/Pages/InveSession.razor index 26103cd0..3e90668e 100644 --- a/MP.INVE/Pages/InveSession.razor +++ b/MP.INVE/Pages/InveSession.razor @@ -4,10 +4,19 @@
-
-

Sessione

+
+
+
+ Sessione +
+
+ +
+
-
+
In corso @@ -18,10 +27,12 @@
-
- +
+
+ + + +
@@ -32,7 +43,7 @@ } else { - + }
diff --git a/MP.INVE/Pages/InveSession.razor.cs b/MP.INVE/Pages/InveSession.razor.cs index 85edd283..0ac93b5d 100644 --- a/MP.INVE/Pages/InveSession.razor.cs +++ b/MP.INVE/Pages/InveSession.razor.cs @@ -28,13 +28,11 @@ namespace MP.INVE.Pages private SelectInveSessionParams currParams = new SelectInveSessionParams(); - private List? elencoSessioni; - private List? SearchRecords; - private List? elencoOperatori; - private List? ElencoMagazzini; - - private DataPager pagerSession = null!; - + protected string searchVal + { + get => currParams.searchVal; + set => currParams.searchVal = value; + } protected override async Task OnInitializedAsync() { await getId(); @@ -50,6 +48,11 @@ namespace MP.INVE.Pages await Task.Delay(1); } + protected async Task reset() + { + searchVal = ""; + await Task.Delay(1); + } private bool isLoading { get; set; } = false;