From a067f706f188bf0291e740d2e259950a3848b04d Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 9 Jun 2025 18:54:19 +0200 Subject: [PATCH 1/3] Cleanup aree commentate --- .../Compo/CalendarioAziendale.razor.cs | 162 +----------------- GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 5 files changed, 8 insertions(+), 162 deletions(-) diff --git a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs index e5752a0..ab5c34c 100644 --- a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs +++ b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs @@ -47,35 +47,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo [Parameter] public ParamSet CData { get; set; } = null!; -#if false - [Parameter] - public List EvDtoList { get; set; } = null!; - - [Parameter] - public DateTime firstDate { get; set; } = new DateTime(DateTime.Today.Year, 1, 1); - - [Parameter] - public int IdxDip { get; set; } = 0; - - [Parameter] - public DateTime maxDate { get; set; } = new DateTime(DateTime.Today.Year + 1, 1, 1); - - [Parameter] - public DateTime minDate { get; set; } = new DateTime(DateTime.Today.Year, 1, 1); - - [Parameter] - public DisplayedView ModoDisplay { get; set; } = DisplayedView.Annual; - - [Parameter] - public int MonthDispl - { - get => cMonth; - set => cMonth = value; - } -#endif - - - [Parameter] public EventCallback MonthReq { get; set; } @@ -108,9 +79,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo protected string CalModeText { get => CData.ModoDisplay == DisplayedView.Annual ? "Mensile" : "Multi Mese"; -#if false - get => ModoDisplay == DisplayedView.Annual ? "Mensile" : "Multi Mese"; -#endif } protected int currMonth @@ -121,44 +89,18 @@ namespace GPW.CORE.WRKLOG.Components.Compo if (CData.MonthDispl != value) { CData.MonthDispl = value; -#if false - MonthReq.InvokeAsync(value); -#endif } } -#if false - get => cMonth; - set - { - if (cMonth != value) - { - cMonth = value; - MonthReq.InvokeAsync(value); - } - } -#endif } protected string CurrMonth { get => CData.ModoDisplay == DisplayedView.Monthly ? $"{CData.firstDate:MMMM}" : "Multi"; -#if false - get => ModoDisplay == DisplayedView.Monthly ? $"{firstDate:MMMM}" : "Multi"; -#endif } [Inject] protected DialogService DialogService { get; set; } = null!; -#if false - protected bool UseRadz - { - get => CData.CalType == 3; - } -#endif -#if false - protected bool UseRadz { get; set; } = true; -#endif #endregion Protected Properties @@ -176,18 +118,8 @@ namespace GPW.CORE.WRKLOG.Components.Compo { CData.firstDate = CData.firstDate < CData.minDate ? CData.minDate : CData.firstDate; } -#if false - firstDate = firstDate.AddMonths(numMesi); - // verifico limiti... - if (numMesi > 0) - { - firstDate = firstDate > maxDate ? maxDate : firstDate; - } - else - { - firstDate = firstDate < minDate ? minDate : firstDate; - } -#endif + SelDate = CData.firstDate; + ReloadWeekData(); await Task.Delay(1); } @@ -218,9 +150,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo protected override void OnParametersSet() { -#if false - FilterData(); -#endif if (CData.CalType == 3) { FilterData(); @@ -250,20 +179,12 @@ namespace GPW.CORE.WRKLOG.Components.Compo { CData.firstDate = taskVal.Day; CData.ModoDisplay = DisplayedView.Weekly; -#if false - firstDate = taskVal.Day; - ModoDisplay = DisplayedView.Weekly; -#endif } protected void SetWeek(ClickEmptyDayParameter taskVal) { CData.firstDate = taskVal.Day; CData.ModoDisplay = DisplayedView.Weekly; -#if false - firstDate = taskVal.Day; - ModoDisplay = DisplayedView.Weekly; -#endif } protected async Task StartMonthChange() @@ -280,15 +201,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo { CData.firstDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); } -#if false - ModoDisplay = ModoDisplay == DisplayedView.Annual ? DisplayedView.Monthly : DisplayedView.Annual; - await Task.Delay(1); - // se annuale --> riporto firstDate - if (ModoDisplay == DisplayedView.Annual) - { - firstDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); - } -#endif } #endregion Protected Methods @@ -301,9 +213,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo #region Private Properties -#if false - private int cMonth { get; set; } = 3; -#endif private string currView { get; set; } = ""; private List EvDtoFilt { get; set; } = new List(); private string schedHeight { get; set; } = "height: 50rem;"; @@ -351,18 +260,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo .Where(x => x.IdxDipendente == CData.IdxDip || x.IdxDipendente == 0) .ToList(); } -#if false - if (ToggleData.isActive) - { - EvDtoFilt = EvDtoList; - } - else - { - EvDtoFilt = EvDtoList - .Where(x => x.IdxDipendente == IdxDip || x.IdxDipendente == 0) - .ToList(); - } -#endif } private void FixCalendar() @@ -373,14 +270,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo { CData.firstDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); } -#if false - ModoDisplay = ToggleData.isActive ? DisplayedView.Annual : DisplayedView.Monthly; - // se annuale --> riporto firstDate - if (ModoDisplay == DisplayedView.Annual) - { - firstDate = new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1); - } -#endif } private void OnAppointmentRender(SchedulerAppointmentRenderEventArgs args) @@ -486,45 +375,15 @@ namespace GPW.CORE.WRKLOG.Components.Compo private async Task ReloadMonth(DateTime dtSel) { SelDate = dtSel; - CData.firstDate = dtSel; -#if false - dtCurr = dtSel; - MService.targetDate = dtSel; - showDetail = false; + CData.firstDate = dtSel; + ReloadWeekData(); await Task.Delay(1); - MService.ReportDateChange(); -#endif - await Task.Delay(1); - - //CData.firstDate = CData.firstDate.AddMonths(numMesi); - //// verifico limiti... - //if (numMesi > 0) - //{ - // CData.firstDate = CData.firstDate > CData.maxDate ? CData.maxDate : CData.firstDate; - //} - //else - //{ - // CData.firstDate = CData.firstDate < CData.minDate ? CData.minDate : CData.firstDate; - //} } private void DisplayDate(DateTime dtSel) { SelDate = dtSel; ReloadWeekData(); -#if false - dtCurr = dtSel; - MService.targetDate = dtSel; - MService.targetDateMancTimb = dtCurr; - showDetail = true; - // se sono in calendario --> mostro dettagli... - if (currMode == CalendarModeEnum.modoControllo.showCalendar) - { - setModeDetail(); - } - updateDetail(); - MService.ReportDateChange(); -#endif } private DateTime oggi = DateTime.Today; @@ -742,19 +601,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo }); } } - - -#if false - CalEventList = CData.EvDtoList.Select(x => new CalendarEvent() - { - id = iCnt++, - Inizio = x.DtStart.Hour > 0 ? x.DtStart : x.DtStart.AddHours(9), - Fine = x.DtEnd.Hour > 0 ? x.DtEnd : x.DtStart.AddHours(19), - Type = x.CodTipo, - Description = x.CognomeNome, - CssClass = CssBlockByGiust(x.CodTipo) - }).ToList(); -#endif } } } diff --git a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj index 6cab4d8..35eee42 100644 --- a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj +++ b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.2506.0915 + 4.1.2506.0918 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index f35ab52..ae5c287 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

Versione: 4.1.2506.0915

+

Versione: 4.1.2506.0918


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index ee93115..7e86f85 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -4.1.2506.0915 +4.1.2506.0918 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 6b01c74..ff0ced9 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 4.1.2506.0915 + 4.1.2506.0918 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false From 00073c019982fdc00ad9c678dea48170e89ae6d5 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 9 Jun 2025 18:54:42 +0200 Subject: [PATCH 2/3] Code reord (codemaid) --- .../Compo/CalendarioAziendale.razor.cs | 264 ++++++++++-------- 1 file changed, 141 insertions(+), 123 deletions(-) diff --git a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs index ab5c34c..3ff52cc 100644 --- a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs +++ b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs @@ -20,43 +20,59 @@ namespace GPW.CORE.WRKLOG.Components.Compo { public partial class CalendarioAziendale { - public class ParamSet - { - public List EvDtoList { get; set; } = new List(); - public int IdxDip { get; set; } = 0; - public DateTime firstDate { get; set; } = new DateTime(DateTime.Today.Year, 1, 1); - public DateTime maxDate { get; set; } = new DateTime(DateTime.Today.Year + 1, 1, 1); - public DateTime minDate { get; set; } = new DateTime(DateTime.Today.Year, 1, 1); - public DisplayedView ModoDisplay { get; set; } = DisplayedView.Annual; - public int MonthDispl { get; set; } = 3; - /// - /// Tipo calendario: - /// 1 - Egw - /// 2 - base - /// 3 - Radzen - /// - public int CalType { get; set; } = 1; - public List? ListRecordsRichieste { get; set; } - public List? ListFermateAzienda { get; set; } - } + #region Public Fields + public int MoveBlock = 7; + + public int NumDays = 7; + + #endregion Public Fields #region Public Properties - [Parameter] public ParamSet CData { get; set; } = null!; [Parameter] - public EventCallback MonthReq { get; set; } + public EventCallback DtReq { get; set; } [Parameter] - public EventCallback DtReq { get; set; } + public EventCallback MonthReq { get; set; } #endregion Public Properties + #region Public Classes + + public class ParamSet + { + #region Public Properties + + /// + /// Tipo calendario: + /// 1 - Egw + /// 2 - base + /// 3 - Radzen + /// + public int CalType { get; set; } = 1; + + public List EvDtoList { get; set; } = new List(); + public DateTime firstDate { get; set; } = new DateTime(DateTime.Today.Year, 1, 1); + public int IdxDip { get; set; } = 0; + public List? ListFermateAzienda { get; set; } + public List? ListRecordsRichieste { get; set; } + public DateTime maxDate { get; set; } = new DateTime(DateTime.Today.Year + 1, 1, 1); + public DateTime minDate { get; set; } = new DateTime(DateTime.Today.Year, 1, 1); + public DisplayedView ModoDisplay { get; set; } = DisplayedView.Annual; + public int MonthDispl { get; set; } = 3; + + #endregion Public Properties + } + + #endregion Public Classes + #region Protected Fields + protected List ListDate = new List(); protected RadzenScheduler scheduler = null!; #endregion Protected Fields @@ -101,6 +117,7 @@ namespace GPW.CORE.WRKLOG.Components.Compo [Inject] protected DialogService DialogService { get; set; } = null!; + protected List EventListWeek { get; set; } = new List(); #endregion Protected Properties @@ -123,6 +140,20 @@ namespace GPW.CORE.WRKLOG.Components.Compo await Task.Delay(1); } + protected async Task backToCal(bool isMode) + { + await Task.Delay(1); + } + + protected async Task ChangePeriod(int numStep) + { + ListDate = new List(); + await Task.Delay(1); + SelDate = SelDate.AddDays(MoveBlock * numStep); + ReloadWeekData(); + await Task.Delay(1); + } + protected override async Task OnInitializedAsync() { await Task.Delay(1); @@ -175,6 +206,15 @@ namespace GPW.CORE.WRKLOG.Components.Compo FixCalendar(); } + protected void SetDayDetail(DateTime selDate) + { + var tmpDays = ListDate.Where(x => x.Equals(selDate)).ToList(); + var tmpEv = EventListWeek.Where(x => x.Inizio.Date.Equals(selDate)).ToList(); + // salvo valori simulati + ListDate = tmpDays; + EventListWeek = tmpEv; + } + protected void SetWeek(ClickTaskParameter taskVal) { CData.firstDate = taskVal.Day; @@ -207,6 +247,10 @@ namespace GPW.CORE.WRKLOG.Components.Compo #region Private Fields + private List CalEventList = new List(); + private Dictionary DateCFF = new Dictionary(); + private Dictionary DateCheck = new Dictionary(); + private DateTime oggi = DateTime.Today; private int selectedIndex = 2; #endregion Private Fields @@ -216,6 +260,7 @@ namespace GPW.CORE.WRKLOG.Components.Compo private string currView { get; set; } = ""; private List EvDtoFilt { get; set; } = new List(); private string schedHeight { get; set; } = "height: 50rem;"; + private DateTime SelDate { get; set; } = DateTime.Today; private Month startMonth { get; set; } = Month.January;// = DateTime.Today.Month <= 6 ? Month.January : Month.July; private List TaskList { get; set; } = new List(); private SelectGlobalToggle ToggleData { get; set; } = new SelectGlobalToggle(); @@ -224,6 +269,77 @@ namespace GPW.CORE.WRKLOG.Components.Compo #region Private Methods + private string CssBlockByGiust(string codGiust, int idxDip) + { + string cssSpec = ""; + switch (codGiust) + { + case "PERM": + cssSpec = "blockPerm"; + break; + + case "104": + cssSpec = "block104"; + break; + + case "MAL": + cssSpec = "blockMal"; + break; + + case "FEST": + cssSpec = "blockFest"; + break; + + case "FER": + default: + cssSpec = idxDip == 0 ? "blockChius" : "blockFerie"; + break; + } + + return cssSpec; + } + + private string CssDayByGiust(string codGiust, bool isConf) + { + string cssSpec = ""; + string cssMal = "bg-dark text-light rounded-pill py-1 px-3"; + string cssFerie = "bg-success text-light rounded-pill py-1 px-3"; + string cssPerm = "bg-info text-light rounded-pill py-1 px-3"; + string css104 = "bg-warning text-light rounded-pill py-1 px-3"; + string cssReq = " opacity-50"; + switch (codGiust) + { + case "PERM": + cssSpec = cssPerm; + break; + + case "104": + cssSpec = css104; + break; + + case "MAL": + cssSpec = cssMal; + break; + + case "FER": + default: + cssSpec = cssFerie; + break; + } + + // fix display confermato/non confermato + if (!isConf) + cssSpec += cssReq; + + return cssSpec; + } + + private void DisplayDate(DateTime dtSel) + { + SelDate = dtSel; + ReloadWeekData(); + } + private async Task evToggled(SelectGlobalToggle newTogData) { ToggleData = newTogData; @@ -243,10 +359,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo await Task.Delay(1); } - private Dictionary DateCFF = new Dictionary(); - private Dictionary DateCheck = new Dictionary(); - private List CalEventList = new List(); - private void FilterData() { // filtro risultati richiesti... @@ -366,39 +478,14 @@ namespace GPW.CORE.WRKLOG.Components.Compo await DtReq.InvokeAsync(SelDate); } - private DateTime SelDate { get; set; } = DateTime.Today; - - - #endregion Private Methods - - private async Task ReloadMonth(DateTime dtSel) { SelDate = dtSel; - CData.firstDate = dtSel; + CData.firstDate = dtSel; ReloadWeekData(); await Task.Delay(1); } - private void DisplayDate(DateTime dtSel) - { - SelDate = dtSel; - ReloadWeekData(); - } - - private DateTime oggi = DateTime.Today; - protected List ListDate = new List(); - protected List EventListWeek { get; set; } = new List(); - public int MoveBlock = 7; - public int NumDays = 7; - protected async Task ChangePeriod(int numStep) - { - ListDate = new List(); - await Task.Delay(1); - SelDate = SelDate.AddDays(MoveBlock * numStep); - ReloadWeekData(); - await Task.Delay(1); - } private void ReloadWeekData() { ListDate = new List(); @@ -416,77 +503,6 @@ namespace GPW.CORE.WRKLOG.Components.Compo EventListWeek = CalEventList.Where(x => ListDate.Contains(x.Inizio.Date)).ToList(); } - protected async Task backToCal(bool isMode) - { - await Task.Delay(1); - } - protected void SetDayDetail(DateTime selDate) - { - var tmpDays = ListDate.Where(x => x.Equals(selDate)).ToList(); - var tmpEv = EventListWeek.Where(x => x.Inizio.Date.Equals(selDate)).ToList(); - // salvo valori simulati - ListDate = tmpDays; - EventListWeek = tmpEv; - } - - private string CssDayByGiust(string codGiust, bool isConf) - { - string cssSpec = ""; - string cssMal = "bg-dark text-light rounded-pill py-1 px-3"; - string cssFerie = "bg-success text-light rounded-pill py-1 px-3"; - string cssPerm = "bg-info text-light rounded-pill py-1 px-3"; - string css104 = "bg-warning text-light rounded-pill py-1 px-3"; - string cssReq = " opacity-50"; - switch (codGiust) - { - case "PERM": - cssSpec = cssPerm; - break; - case "104": - cssSpec = css104; - break; - case "MAL": - cssSpec = cssMal; - break; - case "FER": - default: - cssSpec = cssFerie; - break; - } - - // fix display confermato/non confermato - if (!isConf) - cssSpec += cssReq; - - return cssSpec; - } - - private string CssBlockByGiust(string codGiust, int idxDip) - { - string cssSpec = ""; - switch (codGiust) - { - case "PERM": - cssSpec = "blockPerm"; - break; - case "104": - cssSpec = "block104"; - break; - case "MAL": - cssSpec = "blockMal"; - break; - case "FEST": - cssSpec = "blockFest"; - break; - case "FER": - default: - cssSpec = idxDip == 0 ? "blockChius" : "blockFerie"; - break; - } - - return cssSpec; - } - private void SetEgwCal() { DateCheck = new Dictionary(); @@ -603,5 +619,7 @@ namespace GPW.CORE.WRKLOG.Components.Compo } } } + + #endregion Private Methods } } \ No newline at end of file From 429c4c0086ddda2a8b9f2013c6a5017d08b7e61c Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 10 Jun 2025 06:59:25 +0200 Subject: [PATCH 3/3] Fix calendario ADM x radzen (eliminato sel mese che da loop) --- .../Components/Compo/ApprovTimbMan.razor.cs | 2 +- .../Components/Compo/CalAzMan.razor.cs | 2 +- .../Compo/CalendarioAziendale.razor | 11 +- .../Compo/CalendarioAziendale.razor.cs | 203 +++++++++++------- .../Components/Compo/RegMalattia.razor.cs | 2 +- .../Components/Compo/RegRichieste.razor.cs | 2 +- .../Components/Compo/ReviewTimbMan.razor.cs | 2 +- .../Components/Pages/GestCalendario.razor.cs | 3 +- .../Components/Pages/Malattia.razor.cs | 3 +- .../Components/Pages/RichiesteDip.razor | 9 +- .../Components/Pages/RichiesteDip.razor.cs | 38 ++-- GPW.CORE.ADM/GPW.CORE.ADM.csproj | 10 +- GPW.CORE.ADM/appsettings.Development.json | 3 +- GPW.CORE.ADM/appsettings.json | 1 + GPW.CORE.Data/Services/GpwDataService.cs | 14 +- .../Compo/CalendarioAziendale.razor | 2 +- .../Compo/CalendarioAziendale.razor.cs | 31 ++- GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj | 2 +- Resources/ChangeLog.html | 2 +- Resources/VersNum.txt | 2 +- Resources/manifest.xml | 2 +- 21 files changed, 210 insertions(+), 136 deletions(-) diff --git a/GPW.CORE.ADM/Components/Compo/ApprovTimbMan.razor.cs b/GPW.CORE.ADM/Components/Compo/ApprovTimbMan.razor.cs index 56cd6ca..65bf221 100644 --- a/GPW.CORE.ADM/Components/Compo/ApprovTimbMan.razor.cs +++ b/GPW.CORE.ADM/Components/Compo/ApprovTimbMan.razor.cs @@ -52,7 +52,7 @@ namespace GPW.CORE.ADM.Components.Compo // arrotondo ingresso/uscita ai 5 minuti secondo sia entrata o uscita... var dtTimb = Utils.DateRounded(selItem.DataOra, 5, !(selItem.Entrata ?? false)); selItem.DataOra = dtTimb; - } + } // indico approvato selItem.Approv = true; // salvo! diff --git a/GPW.CORE.ADM/Components/Compo/CalAzMan.razor.cs b/GPW.CORE.ADM/Components/Compo/CalAzMan.razor.cs index 01fb385..3fbae74 100644 --- a/GPW.CORE.ADM/Components/Compo/CalAzMan.razor.cs +++ b/GPW.CORE.ADM/Components/Compo/CalAzMan.razor.cs @@ -178,7 +178,7 @@ namespace GPW.CORE.ADM.Components.Compo { SearchRecords = null; await Task.Delay(1); - SearchRecords = await GDataServ.CalFestFeriePeriodo(DtStart, DtEnd); + SearchRecords = GDataServ.CalFestFeriePeriodo(DtStart, DtEnd); // conteggio! totalCount = SearchRecords.Count; // paginazione diff --git a/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor b/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor index 8d61167..9c9c599 100644 --- a/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor +++ b/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor @@ -17,15 +17,15 @@
    - @if (currView == "year" || currView == "planner") + @* @if (currView == "year" || currView == "planner") {
    - +
    - } + } *@
    @@ -53,9 +53,8 @@ - - @* *@ - + + diff --git a/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor.cs b/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor.cs index ba1ec82..b039064 100644 --- a/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor.cs +++ b/GPW.CORE.ADM/Components/Compo/CalendarioAziendale.razor.cs @@ -1,13 +1,14 @@ +using GPW.CORE.Data.DTO; using Microsoft.AspNetCore.Components; using Microsoft.Identity.Client; -using Radzen.Blazor.Rendering; -using Radzen.Blazor; -using static EgwCoreLib.Razor.Toggler; +using NLog; using Radzen; +using Radzen.Blazor; +using Radzen.Blazor.Rendering; using System; -using static System.Runtime.InteropServices.JavaScript.JSType; -using GPW.CORE.Data.DTO; using System.Diagnostics; +using static EgwCoreLib.Razor.Toggler; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace GPW.CORE.ADM.Components.Compo { @@ -24,9 +25,6 @@ namespace GPW.CORE.ADM.Components.Compo [Parameter] public DateTime firstDate { get; set; } = new DateTime(DateTime.Today.Year, 1, 1); - [Parameter] - public bool ShowNeedConf { get; set; } = false; - [Parameter] public DateTime maxDate { get; set; } = new DateTime(DateTime.Today.Year + 1, 1, 1); @@ -43,6 +41,9 @@ namespace GPW.CORE.ADM.Components.Compo [Parameter] public EventCallback MonthReq { get; set; } + [Parameter] + public bool ShowNeedConf { get; set; } = false; + #endregion Public Properties #region Protected Fields @@ -82,6 +83,19 @@ namespace GPW.CORE.ADM.Components.Compo [Inject] protected DialogService DialogService { get; set; } = null!; + protected Month StartMonth + { + get => _startMonth; + set + { + if (_startMonth != value) + { + _startMonth = value; + } + } + } + private Month _startMonth { get; set; } = Month.January; + #endregion Protected Properties #region Protected Methods @@ -101,17 +115,60 @@ namespace GPW.CORE.ADM.Components.Compo await Task.Delay(1); } + protected string btnSel(string bName) + { + bool answ = false; + switch (bName) + { + case "CHIU": + answ = showChiu; + break; + + case "FER": + answ = showFer; + break; + + case "FEST": + answ = showFest; + break; + + case "MAL": + answ = showMal; + break; + + case "PER": + answ = showPer; + break; + + default: + break; + } + return answ ? "btn-primary" : "btn-secondary"; + } + protected override async Task OnInitializedAsync() { await Task.Delay(1); - // il mese viene preimpostato sul trimestre corrente... - startMonth = (Month)((DateTime.Today.Month / 6) * 6); +#if false + // il mese viene preimpostato sul semestre corrente... + StartMonth = (Month)((DateTime.Today.Month / 6) * 6); +#endif } - protected override void OnParametersSet() + protected override async Task OnParametersSetAsync() { - FilterData(); - scheduler.Reload(); + if (EvDtoList != null && EvDtoList.Count > 0 && firstDate != new DateTime(DateTime.Today.Year, 1, 1)) + { + FilterData(); + try + { + await scheduler.Reload(); + } + catch (Exception exc) + { + Log.Error($"eccezione durante OnParametersSet{Environment.NewLine}{exc}"); + } + } } protected async Task StartMonthChange() @@ -119,10 +176,41 @@ namespace GPW.CORE.ADM.Components.Compo await scheduler.Reload(); } + protected void ToggChiu() + { + showChiu = !showChiu; + FilterData(); + } + + protected void ToggFer() + { + showFer = !showFer; + FilterData(); + } + + protected void ToggFest() + { + showFest = !showFest; + FilterData(); + } + + protected void ToggMal() + { + showMal = !showMal; + FilterData(); + } + + protected void ToggPer() + { + showPer = !showPer; + FilterData(); + } + #endregion Protected Methods #region Private Fields + private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); private int selectedIndex = 2; #endregion Private Fields @@ -134,13 +222,20 @@ namespace GPW.CORE.ADM.Components.Compo private List EvDtoFilt { get; set; } = new List(); private string schedHeight { get; set; } = "height: 50rem;"; private DateTime SelDate { get; set; } = DateTime.Today; - private Month startMonth { get; set; } = Month.January; + private bool showChiu { get; set; } = true; + + private bool showFer { get; set; } = true; + + private bool showFest { get; set; } = true; + + private bool showMal { get; set; } = true; + + private bool showPer { get; set; } = true; #endregion Private Properties #region Private Methods - private void FilterData() { // in primis copio tutto @@ -180,69 +275,6 @@ namespace GPW.CORE.ADM.Components.Compo .Where(x => !x.CodTipo.Equals("PERM", StringComparison.InvariantCultureIgnoreCase) && !x.CodTipo.Equals("104", StringComparison.InvariantCultureIgnoreCase)) .ToList(); } - - } - private bool showChiu { get; set; } = true; - private bool showFer { get; set; } = true; - private bool showFest { get; set; } = true; - private bool showMal { get; set; } = true; - private bool showPer { get; set; } = true; - - protected string btnSel(string bName) - { - bool answ = false; - switch (bName) - { - case "CHIU": - answ = showChiu; - break; - - case "FER": - answ = showFer; - break; - - case "FEST": - answ = showFest; - break; - - case "MAL": - answ = showMal; - break; - - case "PER": - answ = showPer; - break; - - default: - break; - } - return answ ? "btn-primary" : "btn-secondary"; - } - protected void ToggMal() - { - showMal = !showMal; - FilterData(); - } - - protected void ToggPer() - { - showPer = !showPer; - FilterData(); - } - protected void ToggFer() - { - showFer = !showFer; - FilterData(); - } - protected void ToggFest() - { - showFest = !showFest; - FilterData(); - } - protected void ToggChiu() - { - showChiu = !showChiu; - FilterData(); } private void OnAppointmentRender(SchedulerAppointmentRenderEventArgs args) @@ -262,12 +294,17 @@ namespace GPW.CORE.ADM.Components.Compo { await Task.Delay(1); currView = scheduler.SelectedView.Text.ToLowerInvariant(); - - // controllo se sia cambiata data... di almeno 1 anno in questo caso... - if (SelDate != scheduler.Date || Math.Abs(scheduler.Date.Subtract(args.Start).TotalDays) > 365) + DateTime dtMid = args.Start.AddDays(args.End.Subtract(args.Start).TotalDays / 2); + // controllo se sia cambiata data anno precedente... + if (dtMid.Year != SelDate.Year) { - SelDate = args.Start.AddMonths(1); - // riporto data al controller parent... + SelDate = dtMid; + await DtReq.InvokeAsync(SelDate); + } + // di almeno 1 anno in questo caso... + else if (SelDate != scheduler.Date || Math.Abs(scheduler.Date.Subtract(args.Start).TotalDays) > 365) + { + SelDate = args.Start.AddDays(4); await DtReq.InvokeAsync(SelDate); } diff --git a/GPW.CORE.ADM/Components/Compo/RegMalattia.razor.cs b/GPW.CORE.ADM/Components/Compo/RegMalattia.razor.cs index 4a48fbe..fbcbb48 100644 --- a/GPW.CORE.ADM/Components/Compo/RegMalattia.razor.cs +++ b/GPW.CORE.ADM/Components/Compo/RegMalattia.razor.cs @@ -201,7 +201,7 @@ namespace GPW.CORE.ADM.Components.Compo { SearchRecords = null; await Task.Delay(1); - SearchRecords = await GDataServ.RegMalattieGetByPeriod(DtStart, DtEnd); + SearchRecords = GDataServ.RegMalattieGetByPeriod(DtStart, DtEnd); // conteggio! totalCount = SearchRecords.Count; // paginazione diff --git a/GPW.CORE.ADM/Components/Compo/RegRichieste.razor.cs b/GPW.CORE.ADM/Components/Compo/RegRichieste.razor.cs index 3c241fb..b73b4e3 100644 --- a/GPW.CORE.ADM/Components/Compo/RegRichieste.razor.cs +++ b/GPW.CORE.ADM/Components/Compo/RegRichieste.razor.cs @@ -364,7 +364,7 @@ namespace GPW.CORE.ADM.Components.Compo await initConf(); await Task.Delay(1); // carico richieste di TUTTI - SearchRecords = await GDataServ.RegRichiesteGetByDip(0, dtInizio, dtFine); + SearchRecords = GDataServ.RegRichiesteGetByDip(0, dtInizio, dtFine); // filtro x tipo richieste... if (ShowNeedConf) { diff --git a/GPW.CORE.ADM/Components/Compo/ReviewTimbMan.razor.cs b/GPW.CORE.ADM/Components/Compo/ReviewTimbMan.razor.cs index 7dceefa..dc76f2d 100644 --- a/GPW.CORE.ADM/Components/Compo/ReviewTimbMan.razor.cs +++ b/GPW.CORE.ADM/Components/Compo/ReviewTimbMan.razor.cs @@ -322,7 +322,7 @@ namespace GPW.CORE.ADM.Components.Compo { foreach (var item in list2fix) { - // escludo date da oggi in poi... + // escludo date da DateRif in poi... if (item.DataLav < DateTime.Today) { GiustificativiModel rec2del = new GiustificativiModel() diff --git a/GPW.CORE.ADM/Components/Pages/GestCalendario.razor.cs b/GPW.CORE.ADM/Components/Pages/GestCalendario.razor.cs index e0928a6..eff83eb 100644 --- a/GPW.CORE.ADM/Components/Pages/GestCalendario.razor.cs +++ b/GPW.CORE.ADM/Components/Pages/GestCalendario.razor.cs @@ -162,7 +162,8 @@ namespace GPW.CORE.ADM.Components.Pages { isLoading = true; // recupero direttamente da oggetto DB - SchedEvList = await DataService.EventListPeriodo(idxDipendente, dtMin, dtMax); + SchedEvList = DataService.EventListPeriodo(idxDipendente, dtMin, dtMax); + await Task.Delay(1); isLoading = false; } diff --git a/GPW.CORE.ADM/Components/Pages/Malattia.razor.cs b/GPW.CORE.ADM/Components/Pages/Malattia.razor.cs index 5359562..dedb06e 100644 --- a/GPW.CORE.ADM/Components/Pages/Malattia.razor.cs +++ b/GPW.CORE.ADM/Components/Pages/Malattia.razor.cs @@ -88,7 +88,8 @@ namespace GPW.CORE.ADM.Components.Pages { isLoading = true; // recupero direttamente da oggetto DB - SchedEvList = await DataService.EventListPeriodo(idxDipendente, dtMin, dtMax); + SchedEvList = DataService.EventListPeriodo(idxDipendente, dtMin, dtMax); + await Task.Delay(1); isLoading = false; } diff --git a/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor b/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor index b628b14..989b9d4 100644 --- a/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor +++ b/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor @@ -22,7 +22,14 @@ }
    - + @if (isLoading) + { + + } + else + { + + }
    diff --git a/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor.cs b/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor.cs index a647b50..e9f00d0 100644 --- a/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor.cs +++ b/GPW.CORE.ADM/Components/Pages/RichiesteDip.razor.cs @@ -48,13 +48,19 @@ namespace GPW.CORE.ADM.Components.Pages int.TryParse(monthConf.valore, out intVal); numMesi = intVal > 0 ? intVal : numMesi; } + DateRif = DateTime.Today; + dtMin = new DateTime(DateRif.Year, 1, 1); + dtMax = dtMin.AddYears(1); +#if false // fix iniziale date... setup periodo (da rivedere in funzione eventi cambio mese dei controlli?!?) - DateTime oggi = DateTime.Today; - dtMin = new DateTime(oggi.Year - 1, 1, 1); - dtMax = dtMin.AddYears(3); - await ReloadData(); + dtMin = new DateTime(DateRif.Year - 1, 1, 1); + dtMax = dtMin.AddYears(3); +#endif + ReloadData(); } + private DateTime DateRif = DateTime.Today; + #endregion Protected Methods #region Private Fields @@ -91,9 +97,9 @@ namespace GPW.CORE.ADM.Components.Pages await Task.Delay(1); } - private async Task ForceReloadCal() + private void ForceReloadCal() { - await ReloadData(); + ReloadData(); } private void initToggler() @@ -106,19 +112,24 @@ namespace GPW.CORE.ADM.Components.Pages }; } - private async Task ReloadData() + private void ReloadData() { isLoading = true; // recupero direttamente da oggetto DB - SchedEvList = await DataService.EventListPeriodo(idxDipendente, dtMin, dtMax); + SchedEvList = DataService.EventListPeriodo(idxDipendente, dtMin, dtMax); isLoading = false; } - private async Task SetDate(DateTime newDate) + private void SetDate(DateTime newDate) { // se la data fosse esterna all'intervallo considerato...) if (newDate < dtMin || newDate > dtMax) { + DateRif = newDate; + // ricalcolo periodo + dtMin = new DateTime(DateRif.Year, 1, 1); + dtMax = dtMin.AddYears(1); +#if false // verifico se "allargare" alla minima o alla massima if (newDate < dtMin) { @@ -127,18 +138,19 @@ namespace GPW.CORE.ADM.Components.Pages else { dtMax = new DateTime(newDate.Year + 1, 1, 1); - } - await ReloadData(); + } +#endif + ReloadData(); } } - private async Task SetMonth(int newNum) + private void SetMonth(int newNum) { if (numMesi != newNum) { numMesi = newNum; } - await ReloadData(); + ReloadData(); } #endregion Private Methods diff --git a/GPW.CORE.ADM/GPW.CORE.ADM.csproj b/GPW.CORE.ADM/GPW.CORE.ADM.csproj index 8bc1367..092ffff 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.2502.0418 + 4.1.2506.1006 @@ -33,14 +33,14 @@ - - + + - - + + diff --git a/GPW.CORE.ADM/appsettings.Development.json b/GPW.CORE.ADM/appsettings.Development.json index 0c208ae..f8063ef 100644 --- a/GPW.CORE.ADM/appsettings.Development.json +++ b/GPW.CORE.ADM/appsettings.Development.json @@ -4,5 +4,6 @@ "Default": "Information", "Microsoft.AspNetCore": "Warning" } - } + }, + "DetailedErrors": true } diff --git a/GPW.CORE.ADM/appsettings.json b/GPW.CORE.ADM/appsettings.json index 481df0f..4d05884 100644 --- a/GPW.CORE.ADM/appsettings.json +++ b/GPW.CORE.ADM/appsettings.json @@ -5,6 +5,7 @@ "Microsoft.AspNetCore": "Warning" } }, + "DetailedErrors": true, "NLog": { "variables": { "baseFileDir": "${basedir}/logs/", diff --git a/GPW.CORE.Data/Services/GpwDataService.cs b/GPW.CORE.Data/Services/GpwDataService.cs index ecceb49..ce785e3 100644 --- a/GPW.CORE.Data/Services/GpwDataService.cs +++ b/GPW.CORE.Data/Services/GpwDataService.cs @@ -1842,7 +1842,6 @@ namespace GPW.CORE.Data.Services } else { -#if true // recupero le fermate aziendali var ListFermateAzienda = CalFestFeriePeriodo(dtStart, dtEnd); if (ListFermateAzienda.Count > 0) @@ -1864,10 +1863,8 @@ namespace GPW.CORE.Data.Services Tooltip = $"{x.codGiust} | {x.descrizione}", }).ToList(); SchedEvList.AddRange(evAzienda); - } -#endif + } -#if true // recupero e converto le richieste dipendente... var ListRichiesteDip = RegRichiesteGetByDip(0, dtStart, dtEnd); if (ListRichiesteDip.Count > 0) @@ -1876,7 +1873,7 @@ namespace GPW.CORE.Data.Services var evDip = ListRichiesteDip.Select(x => new EventDTO { DtStart = x.DtStart, - DtEnd = x.NumDays > 1 ? x.DtEnd.AddHours(20) : x.DtEnd, + DtEnd = x.NumDays >= 1 ? x.DtEnd.AddHours(20) : x.DtEnd, CodTipo = x.CodGiust, Titolo = x.DipNav.Abbrev, IdxDipendente = x.IdxDipendente, @@ -1891,9 +1888,7 @@ namespace GPW.CORE.Data.Services }).ToList(); SchedEvList.AddRange(evDip); } -#endif -#if true // recupero e converto le malattie... var ListMalattie = RegMalattieGetByPeriod(dtStart, dtEnd); if (ListMalattie.Count > 0) @@ -1916,8 +1911,8 @@ namespace GPW.CORE.Data.Services Tooltip = $"MAL | {x.DipNav.Abbrev} {x.DtInizio:yyyy/MM/dd} -> {x.DtInizio.AddDays(x.NumGG - 1):yyyy/MM/dd}" }).ToList(); SchedEvList.AddRange(evDip); - } -#endif + } + rawData = JsonConvert.SerializeObject(SchedEvList, JSSettings); redisDb.StringSet(currKey, rawData, LongCache); } @@ -2804,6 +2799,7 @@ namespace GPW.CORE.Data.Services await ExecFlushRedisPattern($"{rKeyLastRegAtt}:*"); await ExecFlushRedisPattern($"{rKeyParetoRegAtt}:*"); await ExecFlushRedisPattern($"{rKeyWeekStats}:*"); + await ExecFlushRedisPattern($"{rKeyEventListDip}:*"); } catch { } diff --git a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor index 91614a1..c6ea5a1 100644 --- a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor +++ b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor @@ -8,7 +8,7 @@
    - Calendario Aziendale + Calendario Aziendale
    diff --git a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs index 3ff52cc..35fd43a 100644 --- a/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs +++ b/GPW.CORE.WRKLOG/Components/Compo/CalendarioAziendale.razor.cs @@ -140,6 +140,13 @@ namespace GPW.CORE.WRKLOG.Components.Compo await Task.Delay(1); } + protected void SelToday() + { + SelDate = DateTime.Today; + CData.firstDate = SelDate; + ReloadWeekData(); + } + protected async Task backToCal(bool isMode) { await Task.Delay(1); @@ -524,10 +531,13 @@ namespace GPW.CORE.WRKLOG.Components.Compo cssSpec = item.codGiust == "FEST" ? cssFest : cssChius; if (!DateCFF.ContainsKey(item.data)) { +#if false if (item.data.DayOfWeek != DayOfWeek.Saturday && item.data.DayOfWeek != DayOfWeek.Sunday) { DateCFF.Add(item.data, cssSpec); - } + } +#endif + DateCFF.Add(item.data, cssSpec); } } } @@ -546,10 +556,13 @@ namespace GPW.CORE.WRKLOG.Components.Compo DateTime currDay = item.DtStart.AddDays(i); if (!DateCheck.ContainsKey(currDay)) { +#if false if (currDay.DayOfWeek != DayOfWeek.Saturday && currDay.DayOfWeek != DayOfWeek.Sunday) { DateCheck.Add(currDay.Date, cssSpec); - } + } +#endif + DateCheck.Add(currDay.Date, cssSpec); } } } @@ -570,8 +583,14 @@ namespace GPW.CORE.WRKLOG.Components.Compo { for (int i = 0; i < NumDays; i++) { - var dtEvInizio = item.DtStart.AddDays(i).AddHours(startEv); - var dtEvFine = item.DtStart.AddDays(i).AddHours(endEv); + DateTime currDate = item.DtStart.AddDays(i).Date; + // se c'è già un evento aziendale aggiungo una trasparenza 50%... + if(CData.ListFermateAzienda!=null && CData.ListFermateAzienda.Where(x => x.data== currDate).FirstOrDefault() !=null) + { + css += " opacity-50"; + } + var dtEvInizio = currDate.AddHours(startEv); + var dtEvFine = currDate.AddHours(endEv); var evDescr = item.CognomeNome; // var evDescr = $"{item.DipNav.Nome.Substring(0, 1)}. {item.DipNav.Cognome}"; // 2024.08.27 cerco se esistesse già... @@ -584,8 +603,8 @@ namespace GPW.CORE.WRKLOG.Components.Compo CalEventList.Add(new CalendarEvent() { id = iCnt++, - Inizio = item.DtStart.AddDays(i).AddHours(startEv), - Fine = item.DtStart.AddDays(i).AddHours(endEv), + Inizio = currDate.AddHours(startEv), + Fine = currDate.AddHours(endEv), Description = evDescr, Type = item.CodTipo, CssClass = css diff --git a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj index 35eee42..135233d 100644 --- a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj +++ b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 4.1.2506.0918 + 4.1.2506.0919 diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index ae5c287..6efe033 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

    Versione: 4.1.2506.0918

    +

    Versione: 4.1.2506.1006


    Note di rilascio:
    • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index 7e86f85..cac050c 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -4.1.2506.0918 +4.1.2506.1006 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index ff0ced9..5c82540 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 4.1.2506.0918 + 4.1.2506.1006 http://nexus.steamware.net/repository/SWS/GPW/stable/GPW.UI.zip http://nexus.steamware.net/repository/SWS/GPW/stable/ChangeLog.html false