From b3ffbf1635bc4f4f3ae2da1a4a6476ccfad8a445 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 12 Feb 2024 19:09:46 +0100 Subject: [PATCH] Inizio gestione spostamento categorie --- SHERPA.AD/SHERPA.AD.csproj | 2 +- SHERPA.BBM.CORE/Enums.cs | 14 --- SHERPA.BBM.UI/Pages/ItemMover.razor | 97 ++++----------- SHERPA.BBM.UI/Pages/ItemMover.razor.cs | 157 ++++--------------------- SHERPA.BBM.UI/SHERPA.BBM.UI.csproj | 2 +- 5 files changed, 47 insertions(+), 225 deletions(-) diff --git a/SHERPA.AD/SHERPA.AD.csproj b/SHERPA.AD/SHERPA.AD.csproj index 148ed1e..c5b339e 100644 --- a/SHERPA.AD/SHERPA.AD.csproj +++ b/SHERPA.AD/SHERPA.AD.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 2.0.2402.1218 + 2.0.2402.1219 Egalware 2021+ diff --git a/SHERPA.BBM.CORE/Enums.cs b/SHERPA.BBM.CORE/Enums.cs index d57644d..4106f26 100644 --- a/SHERPA.BBM.CORE/Enums.cs +++ b/SHERPA.BBM.CORE/Enums.cs @@ -20,20 +20,6 @@ namespace SHERPA.BBM Licenza = 10000 } -#if false - /// - /// Tipo Risorsa BBM - /// - public enum BbmResType - { - ND = 0, - HR = 1, - License = 2, - HW = 3, - Service = 4 - } -#endif - /// /// Tipo Tag /// diff --git a/SHERPA.BBM.UI/Pages/ItemMover.razor b/SHERPA.BBM.UI/Pages/ItemMover.razor index f29fe8b..17491ed 100644 --- a/SHERPA.BBM.UI/Pages/ItemMover.razor +++ b/SHERPA.BBM.UI/Pages/ItemMover.razor @@ -8,28 +8,9 @@
-
+

Spostamento Item (in Categorie)

-
-
-
- - - -
- -
- -
-
-
@@ -47,100 +28,62 @@
-
- +
+
- +
- + @* *@ + @foreach (var item in ResTypeList) { - + }
- -
-
-
-
- -
-
- - - -
- -
- +
- + @* *@
-
- +
+
- +
- + @* *@ + @if (ResTypeList != null) { - - } - -
- -
-
-
-
- -
-
- - - -
-
- +
- + @* *@
} diff --git a/SHERPA.BBM.UI/Pages/ItemMover.razor.cs b/SHERPA.BBM.UI/Pages/ItemMover.razor.cs index ad006a0..d806a8c 100644 --- a/SHERPA.BBM.UI/Pages/ItemMover.razor.cs +++ b/SHERPA.BBM.UI/Pages/ItemMover.razor.cs @@ -17,12 +17,10 @@ namespace SHERPA.BBM.UI.Pages #region Protected Fields - protected int _dxBaskId = 1; - protected int _dxCustId = 1; protected int _dxNegoId = 1; - protected int _sxBaskId = 1; - protected int _sxCustId = 1; + protected int _dxResTypeId = 0; protected int _sxNegoId = 1; + protected int _sxResTypeId = 0; #endregion Protected Fields @@ -31,40 +29,25 @@ namespace SHERPA.BBM.UI.Pages [Inject] protected MessageService MService { get; set; } = null!; - protected int YearSel - { - get => yearSel; - set - { - if (yearSel != value) - { - yearSel = value; - // condiziono visualizzazione... - var pUpd = Task.Run(async () => await ReloadAllData()); - pUpd.Wait(); - } - } - } - #endregion Protected Properties #region Protected Methods protected async Task moveLeft(int currIdx) { - if (SelBasketIdSx > 0) + if (SelResTypeIdSx > 0) { // eseguo spostamento... - await BBMService.NegotiationMoveBasket(currIdx, SelBasketIdSx); + await BBMService.NegotiationMoveBasket(currIdx, SelResTypeIdSx); } } protected async Task moveRight(int currIdx) { - if (SelBasketIdDx > 0) + if (SelResTypeIdDx > 0) { // eseguo spostamento... - await BBMService.NegotiationMoveBasket(currIdx, SelBasketIdDx); + await BBMService.NegotiationMoveBasket(currIdx, SelResTypeIdDx); } } @@ -78,30 +61,15 @@ namespace SHERPA.BBM.UI.Pages isLoading = false; } - protected async Task ReloadDataDx() - { - CustomersList = await BBMService.CustomersGetAll(""); - BasketListDx = await BBMService.BasketsGetAsync(1, YearSel); - } - protected async Task ReloadDataSx() - { - CustomersList = await BBMService.CustomersGetAll(""); - BasketListSx = await BBMService.BasketsGetAsync(1, YearSel); - } #endregion Protected Methods #region Private Fields - private List BasketListDx = new List(); + private List ResTypeList = new List(); - private List BasketListSx = new List(); - - private List CustomersList = new List(); - private int yearSel = 0; - - private List yearsList = new List(); + private List CatListSx = new List(); #endregion Private Fields @@ -109,90 +77,44 @@ namespace SHERPA.BBM.UI.Pages private string cssBtnResBaskDx { - get => SelBasketIdDx == 1 ? "btn btn-secondary" : "btn btn-primary"; + get => SelResTypeIdDx == 0 ? "btn btn-secondary" : "btn btn-primary"; } private string cssBtnResBaskSx { - get => SelBasketIdSx == 1 ? "btn btn-secondary" : "btn btn-primary"; - } - - private string cssBtnResCustDx - { - get => SelCustomerIdDx == 1 ? "btn btn-secondary" : "btn btn-primary"; - } - - private string cssBtnResCustSx - { - get => SelCustomerIdSx == 1 ? "btn btn-secondary" : "btn btn-primary"; - } - - private string cssBtnResYear - { - get => YearSel == 0 ? "btn btn-secondary" : "btn btn-primary"; + get => SelResTypeIdSx == 0 ? "btn btn-secondary" : "btn btn-primary"; } private bool isLoading { get; set; } = false; - private int SelBasketIdDx + private int SelResTypeIdDx { get { - return _dxBaskId; + return _dxResTypeId; } set { - _dxBaskId = value; + _dxResTypeId = value; // condiziono visualizzazione... - var pUpd = Task.Run(async () => await ReloadDataDx()); + var pUpd = Task.Run(async () => await ReloadAllData()); pUpd.Wait(); } } - private int SelBasketIdSx + private int SelResTypeIdSx { get { - return _sxBaskId; + return _sxResTypeId; } set { - _sxBaskId = value; + _sxResTypeId = value; // condiziono visualizzazione... - var pUpd = Task.Run(async () => await ReloadDataSx()); - pUpd.Wait(); - } - } - - private int SelCustomerIdDx - { - get - { - return _dxCustId; - } - set - { - _dxCustId = value; - // condiziono visualizzazione... - var pUpd = Task.Run(async () => await ReloadDataDx()); - pUpd.Wait(); - } - } - - private int SelCustomerIdSx - { - get - { - return _sxCustId; - } - - set - { - _sxCustId = value; - // condiziono visualizzazione... - var pUpd = Task.Run(async () => await ReloadDataSx()); + var pUpd = Task.Run(async () => await ReloadAllData()); pUpd.Wait(); } } @@ -213,52 +135,23 @@ namespace SHERPA.BBM.UI.Pages private async Task ReloadAllData() { - yearsList = await BBMService.DocsYears(); - await ReloadDataSx(); - await ReloadDataDx(); + ResTypeList = await BBMService.ItemResTypeGetAll(); } - private async Task ResetBasketDx() + private async Task ResetResTypeDx() { - if (SelBasketIdDx != 1) + if (SelResTypeIdDx != 1) { - SelBasketIdDx = 1; + SelResTypeIdDx = 0; await Task.Delay(1); } } - private async Task ResetBasketSx() + private async Task ResetResTypeSx() { - if (SelBasketIdSx != 1) + if (SelResTypeIdSx != 1) { - SelBasketIdSx = 1; - await Task.Delay(1); - } - } - - private async Task ResetCustDx() - { - if (SelCustomerIdDx != 1) - { - SelCustomerIdDx = 1; - await Task.Delay(1); - } - } - - private async Task ResetCustSx() - { - if (SelCustomerIdSx != 1) - { - SelCustomerIdSx = 1; - await Task.Delay(1); - } - } - - private async Task ResetYear() - { - if (YearSel != 0) - { - YearSel = 0; + SelResTypeIdSx = 0; await Task.Delay(1); } } diff --git a/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj b/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj index c36f96a..72ac882 100644 --- a/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj +++ b/SHERPA.BBM.UI/SHERPA.BBM.UI.csproj @@ -4,7 +4,7 @@ net6.0 60fcdaab-6c1e-4bec-9d88-f7727ef1c12c wwwroot\favicon.ico - 2.0.2402.1218 + 2.0.2402.1219 enable enable Egalware 2021+