- @if (!string.IsNullOrEmpty(SelCodGroup))
+ @if (!string.IsNullOrEmpty(SelCodGroup) && SelType != Enums.ItemClassType.ND)
{
}
@@ -25,7 +25,6 @@
Tipo
@@ -107,7 +106,7 @@
}
-
+
}
diff --git a/Lux.UI/Components/Pages/Items.razor.cs b/Lux.UI/Components/Pages/Items.razor.cs
index d062f799..2dda1d36 100644
--- a/Lux.UI/Components/Pages/Items.razor.cs
+++ b/Lux.UI/Components/Pages/Items.razor.cs
@@ -13,11 +13,6 @@ namespace Lux.UI.Components.Pages
protected List
ListItemGroup = new List();
protected List ListRecords = new List();
- protected string searchVal = "";
-
- protected string? SelCodGroup = null;
- protected EgwCoreLib.Lux.Core.Enums.ItemClassType? SelType = null;
-
#endregion Protected Fields
#region Protected Properties
@@ -28,6 +23,63 @@ namespace Lux.UI.Components.Pages
[Inject]
protected IJSRuntime JSRuntime { get; set; } = null!;
+ protected string SearchVal
+ {
+ get => searchVal;
+ set
+ {
+ if (searchVal != value)
+ {
+ searchVal = value;
+ currPage = 1;
+ var pUpd = Task.Run(async () =>
+ {
+ await ReloadData();
+ UpdateTable();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ protected string SelCodGroup
+ {
+ get => selCodGroup;
+ set
+ {
+ if (selCodGroup != value)
+ {
+ selCodGroup = value;
+ currPage = 1;
+ var pUpd = Task.Run(async () =>
+ {
+ await ReloadData();
+ UpdateTable();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
+ protected EgwCoreLib.Lux.Core.Enums.ItemClassType SelType
+ {
+ get => selType;
+ set
+ {
+ if (selType != value)
+ {
+ selType = value;
+ currPage = 1;
+ var pUpd = Task.Run(async () =>
+ {
+ await ReloadData();
+ UpdateTable();
+ });
+ pUpd.Wait();
+ }
+ }
+ }
+
#endregion Protected Properties
#region Protected Methods
@@ -59,8 +111,8 @@ namespace Lux.UI.Components.Pages
{
if (!await JSRuntime.InvokeAsync("confirm", $"Sicuro di voler eliminare il record? Dettagli: {selRec.ItemID} | {selRec.CodGroup} | {selRec.ItemType} | {selRec.ExtItemCode}"))
return;
- // esegue eliminazione del record...
- await DLService.ItemDeleteAsync(selRec);
+ //// esegue eliminazione del record...
+ //await DLService.ItemDeleteAsync(selRec);
EditRecord = null;
SelRecord = null;
@@ -91,9 +143,9 @@ namespace Lux.UI.Components.Pages
UpdateTable();
}
- protected void resetSearch()
+ protected void ResetSearch()
{
- searchVal = "";
+ SearchVal = "";
}
protected void SaveNumRec(int newNum)
@@ -113,11 +165,13 @@ namespace Lux.UI.Components.Pages
#region Private Fields
private int currPage = 1;
-
private ItemModel? EditRecord = null;
private bool isLoading = false;
private int numRecord = 10;
+ private string searchVal = "";
+ private string selCodGroup = "";
private ItemModel? SelRecord = null;
+ private EgwCoreLib.Lux.Core.Enums.ItemClassType selType = EgwCoreLib.Lux.Core.Enums.ItemClassType.ND;
private int totalCount = 0;
#endregion Private Fields
@@ -132,7 +186,17 @@ namespace Lux.UI.Components.Pages
private async Task ReloadData()
{
isLoading = true;
- AllRecords = await DLService.ItemGetSearchAsync(searchVal);
+ AllRecords = await DLService.ItemGetFiltAsync(SelCodGroup, SelType);
+ // se ho ricerca testuale faccio filtro ulteriore...
+ if (!string.IsNullOrEmpty(SearchVal))
+ {
+ AllRecords = AllRecords
+ .Where(x =>
+ x.Description.Contains(searchVal, StringComparison.InvariantCultureIgnoreCase) ||
+ x.ExtItemCode.Contains(searchVal, StringComparison.InvariantCultureIgnoreCase) ||
+ x.SupplCode.Contains(searchVal, StringComparison.InvariantCultureIgnoreCase))
+ .ToList();
+ }
totalCount = AllRecords.Count;
}