From cbcb6e3dbafeaba849b7e4bba71599c3d790e886 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 6 May 2026 11:16:48 +0200 Subject: [PATCH] Modifica spostamento ore con ricerca --- .../Components/Compo/SpostaOreMan.razor.cs | 59 ++++++++++++++++++- GPW.CORE.ADM/GPW.CORE.ADM.csproj | 2 +- GPW.CORE.Smart8/GPW.CORE.Smart8.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 4 +- 6 files changed, 63 insertions(+), 8 deletions(-) diff --git a/GPW.CORE.ADM/Components/Compo/SpostaOreMan.razor.cs b/GPW.CORE.ADM/Components/Compo/SpostaOreMan.razor.cs index d9b771c..2108329 100644 --- a/GPW.CORE.ADM/Components/Compo/SpostaOreMan.razor.cs +++ b/GPW.CORE.ADM/Components/Compo/SpostaOreMan.razor.cs @@ -6,12 +6,20 @@ using GPW.CORE.Data.Services; using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; using NLog; -using System.Diagnostics; namespace GPW.CORE.ADM.Components.Compo { - public partial class SpostaOreMan + public partial class SpostaOreMan : IDisposable { + #region Public Methods + + public void Dispose() + { + AppMServ.EA_SearchUpdated -= AppMServ_EA_SearchUpdated; + } + + #endregion Public Methods + #region Protected Properties [Inject] @@ -236,6 +244,7 @@ namespace GPW.CORE.ADM.Components.Compo protected override async Task OnInitializedAsync() { + AppMServ.EA_SearchUpdated += AppMServ_EA_SearchUpdated; await ReloadBaseData(); } @@ -317,28 +326,49 @@ namespace GPW.CORE.ADM.Components.Compo #region Private Fields private static Logger Log = LogManager.GetCurrentClassLogger(); + private bool allSel = false; + private int currPage = 1; + private string gridKey = "TimbMan"; + private int idxCliFrom = 0; + private int idxCliTo = 0; + private int idxDipendente = 0; + private int idxFaseFrom = 0; + private int idxFaseTo = 0; + private int idxProjFrom = 0; + private int idxProjTo = 0; + private bool isAncest = false; private bool isLoading = false; + private int numRecord = 10; + private bool ShowCliInattFrom = false; + private bool ShowCliInattTo = false; + private bool ShowDipInatt = false; + private bool ShowFaseInattFrom = false; + private bool ShowFaseInattTo = false; + private bool ShowProjInattFrom = false; + private bool ShowProjInattTo = false; + private bool sortAsc = true; + private string sortField = ""; private int totalCount = 0; @@ -348,10 +378,15 @@ namespace GPW.CORE.ADM.Components.Compo #region Private Properties private DtUtils.Periodo CurrPeriodo { get; set; } = new DtUtils.Periodo(DtUtils.PeriodSet.ThisMonth); + private List ListClienti { get; set; } = new List(); + private List ListDipendenti { get; set; } = new List(); + private List ListFasi { get; set; } = new List(); + private List ListProgetti { get; set; } = new List(); + private List? ListRecords { get; set; } = null; private string mainDivCss @@ -360,12 +395,18 @@ namespace GPW.CORE.ADM.Components.Compo } private List? SearchRecords { get; set; } = null; + private RegAttDayExpDTO? SelRecord { get; set; } = null; #endregion Private Properties #region Private Methods + private async void AppMServ_EA_SearchUpdated() + { + await ReloadData(); + } + /// /// Caricamento dati "statici" dei selettori /// @@ -380,11 +421,22 @@ namespace GPW.CORE.ADM.Components.Compo private async Task ReloadData() { + isLoading = true; + await InvokeAsync(StateHasChanged); // tolgo selezione toggle allSel = false; // carico i dati della tabella List rawData = await GDataServ.RegAttDayExplList(idxDipendente, CurrPeriodo.Inizio, CurrPeriodo.Fine, idxCliFrom, idxProjFrom, idxFaseFrom, isAncest); + + // se ho ricerca filtro (descrizione) + if (!string.IsNullOrWhiteSpace(AppMServ.SearchVal)) + { + rawData = rawData + .Where(x => x.Descrizione.Contains(AppMServ.SearchVal, StringComparison.InvariantCultureIgnoreCase)) + .ToList(); + } + // converto da model a DTO... SearchRecords = rawData .Select(x => new RegAttDayExpDTO(x)) @@ -393,6 +445,9 @@ namespace GPW.CORE.ADM.Components.Compo // paginazione e sorting SortTable(); + + isLoading = false; + await InvokeAsync(StateHasChanged); } private async Task SavePeriodo(DtUtils.Periodo newPeiodo) diff --git a/GPW.CORE.ADM/GPW.CORE.ADM.csproj b/GPW.CORE.ADM/GPW.CORE.ADM.csproj index 1c90864..494f69d 100644 --- a/GPW.CORE.ADM/GPW.CORE.ADM.csproj +++ b/GPW.CORE.ADM/GPW.CORE.ADM.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.2603.2810 + 4.1.2605.0611 diff --git a/GPW.CORE.Smart8/GPW.CORE.Smart8.csproj b/GPW.CORE.Smart8/GPW.CORE.Smart8.csproj index e2aab24..cbefbb6 100644 --- a/GPW.CORE.Smart8/GPW.CORE.Smart8.csproj +++ b/GPW.CORE.Smart8/GPW.CORE.Smart8.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.2603.3010 + 4.1.2604.0309 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 0f79bf4..f2f939b 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

Versione: 4.1.2603.3010

+

Versione: 4.1.2605.0611


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 414be60..3be5556 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -4.1.2603.3010 +4.1.2605.0611 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index dfb8a96..029b865 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,7 +1,7 @@ - 4.1.2603.3010 - http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.Smart.zip + 4.1.2605.0611 + http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false