From c11104fe58c2caa2f51d54dcd50fa76446af2c88 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 9 Mar 2026 14:42:36 +0100 Subject: [PATCH] Ancora update filtering SellingItems --- Lux.UI/Components/Compo/Item/DataFilter.razor | 7 + .../Components/Compo/Item/DataFilter.razor.cs | 5 + Lux.UI/Components/Compo/Item/ItemMan.razor.cs | 44 ------- Lux.UI/Components/Pages/Items.razor | 7 - Lux.UI/Components/Pages/Items.razor.cs | 123 +++++------------- 5 files changed, 42 insertions(+), 144 deletions(-) diff --git a/Lux.UI/Components/Compo/Item/DataFilter.razor b/Lux.UI/Components/Compo/Item/DataFilter.razor index e86e6e39..09260a29 100644 --- a/Lux.UI/Components/Compo/Item/DataFilter.razor +++ b/Lux.UI/Components/Compo/Item/DataFilter.razor @@ -40,4 +40,11 @@ } +
+
+ + + +
+
diff --git a/Lux.UI/Components/Compo/Item/DataFilter.razor.cs b/Lux.UI/Components/Compo/Item/DataFilter.razor.cs index 011a02c5..0c91d8be 100644 --- a/Lux.UI/Components/Compo/Item/DataFilter.razor.cs +++ b/Lux.UI/Components/Compo/Item/DataFilter.razor.cs @@ -109,6 +109,11 @@ namespace Lux.UI.Components.Compo.Item ListItemGroup = await DLService.ItemGroupGetAllAsync(); } + private void ResetSearch() + { + SearchVal = ""; + } + #endregion Private Methods } } \ No newline at end of file diff --git a/Lux.UI/Components/Compo/Item/ItemMan.razor.cs b/Lux.UI/Components/Compo/Item/ItemMan.razor.cs index 78e430d4..3e14b86b 100644 --- a/Lux.UI/Components/Compo/Item/ItemMan.razor.cs +++ b/Lux.UI/Components/Compo/Item/ItemMan.razor.cs @@ -20,50 +20,6 @@ namespace Lux.UI.Components.Compo.Item #region Public Classes -#if false - /// - /// Filtro selezione items - /// - public class FiltSelect - { - #region Public Properties - - public string SearchVal { get; set; } = ""; - public string SelCodGroup { get; set; } = ""; - public Enums.ItemClassType SelType { get; set; } = Enums.ItemClassType.ND; - - #endregion Public Properties - - #region Public Methods - - public override bool Equals(object? obj) - { - if (obj == null) - return false; - if (!(obj is FiltSelect item)) - return false; - - if (SelCodGroup != item.SelCodGroup) - return false; - - if (SelType != item.SelType) - return false; - - if (SearchVal != item.SearchVal) - return false; - - return true; - } - - public override int GetHashCode() - { - return base.GetHashCode(); - } - - #endregion Public Methods - } -#endif - #endregion Public Classes #region Protected Fields diff --git a/Lux.UI/Components/Pages/Items.razor b/Lux.UI/Components/Pages/Items.razor index c62a5912..1ebd7491 100644 --- a/Lux.UI/Components/Pages/Items.razor +++ b/Lux.UI/Components/Pages/Items.razor @@ -18,13 +18,6 @@
-
-
- - - -
-
diff --git a/Lux.UI/Components/Pages/Items.razor.cs b/Lux.UI/Components/Pages/Items.razor.cs index 1a2f5f6b..9d0973d0 100644 --- a/Lux.UI/Components/Pages/Items.razor.cs +++ b/Lux.UI/Components/Pages/Items.razor.cs @@ -7,87 +7,6 @@ namespace Lux.UI.Components.Pages { public partial class Items { - #region Protected Fields - - protected List ListItemGroup = new List(); - - #endregion Protected Fields - - #region Protected Properties - - protected FiltSelect CurrFilt { get; set; } = new FiltSelect(); - - [Inject] - protected DataLayerServices DLService { get; set; } = null!; - - protected string SearchVal - { - get => CurrFilt.SearchVal; - set - { - isLoading = true; - CurrFilt.SearchVal = value; - isLoading = false; - } - } - - protected string SelCodGroup - { - get => CurrFilt.SelCodGroup; - set - { - if (CurrFilt.SelCodGroup != value) - { - isLoading = true; - CurrFilt.SelCodGroup = value; - isLoading = false; - } - } - } - - protected EgwMultiEngineManager.Data.Constants.EXECENVIRONMENTS SelEnvir - { - get => CurrFilt.Envir; - set - { - if (CurrFilt.Envir != value) - { - isLoading = true; - CurrFilt.Envir = value; - isLoading = false; - } - } - } - - /// - /// Modalità articoli vendita vs articoli acquisto - /// - private bool showItemsBuy = true; - - /// - /// Etichetta tipo items gestiti/mostrati - /// - private string txtCurrType - { - get => showItemsBuy ? "Acquisto" : "Vendita"; - } - - protected EgwCoreLib.Lux.Core.Enums.ItemClassType SelType - { - get => CurrFilt.SelType; - set - { - if (CurrFilt.SelType != value) - { - isLoading = true; - CurrFilt.SelType = value; - isLoading = false; - } - } - } - - #endregion Protected Properties - #region Protected Methods protected void DoAdd() @@ -100,7 +19,7 @@ namespace Lux.UI.Components.Pages ItemCode = 0, ExtItemCode = "NEW-ITEM", SupplCode = "", - Description = $"Nuova Offerta {DateTime.Today:ddd yyyy.MM.dd}", + Description = $"Nuovo ITEM {DateTime.Today:ddd yyyy.MM.dd}", Cost = 0, Margin = 0, QtyMin = 0, @@ -109,6 +28,12 @@ namespace Lux.UI.Components.Pages }; } + protected override Task OnInitializedAsync() + { + isLoading = true; + return ReloadBaseData(); + } + protected void UpdateFilt(FiltSelect newFilt) { isLoading = true; @@ -116,26 +41,38 @@ namespace Lux.UI.Components.Pages isLoading = false; } - protected override Task OnInitializedAsync() - { - isLoading = true; - return ReloadBaseData(); - } - - protected void ResetSearch() - { - SearchVal = ""; - } - #endregion Protected Methods #region Private Fields private ItemModel? editRecord = null; private bool isLoading = false; + private List ListItemGroup = new List(); + + /// + /// Modalità articoli vendita vs articoli acquisto + /// + private bool showItemsBuy = true; #endregion Private Fields + #region Private Properties + + private FiltSelect CurrFilt { get; set; } = new FiltSelect(); + + [Inject] + private DataLayerServices DLService { get; set; } = null!; + + /// + /// Etichetta tipo items gestiti/mostrati + /// + private string txtCurrType + { + get => showItemsBuy ? "Acquisto" : "Vendita"; + } + + #endregion Private Properties + #region Private Methods private async Task ReloadBaseData()