diff --git a/GPW.CORE.Data/Controllers/GPWController.cs b/GPW.CORE.Data/Controllers/GPWController.cs index ea9bdb1..8c89960 100644 --- a/GPW.CORE.Data/Controllers/GPWController.cs +++ b/GPW.CORE.Data/Controllers/GPWController.cs @@ -887,16 +887,19 @@ namespace GPW.CORE.Data.Controllers public List RegMalattieGetByDip(int idxDipendente, int maxRecord) { List dbResult = new List(); - using (GPWContext localDbCtx = new GPWContext(_configuration)) + if (idxDipendente > 0) { - DateTime oggi = DateTime.Today; - dbResult = localDbCtx - .DbSetRegMalattie - .Where(x => (idxDipendente == 0 || x.IdxDipendente == idxDipendente)) - .Include(d => d.DipNav) - .OrderByDescending(x => x.DtInizio) - .Take(maxRecord) - .ToList(); + using (GPWContext localDbCtx = new GPWContext(_configuration)) + { + DateTime oggi = DateTime.Today; + dbResult = localDbCtx + .DbSetRegMalattie + .Where(x => x.IdxDipendente == idxDipendente) + .Include(d => d.DipNav) + .OrderByDescending(x => x.DtInizio) + .Take(maxRecord) + .ToList(); + } } return dbResult; } diff --git a/GPW.CORE.WRKLOG/Components/RegMalattia.razor.cs b/GPW.CORE.WRKLOG/Components/RegMalattia.razor.cs index a29c6d6..8fd24df 100644 --- a/GPW.CORE.WRKLOG/Components/RegMalattia.razor.cs +++ b/GPW.CORE.WRKLOG/Components/RegMalattia.razor.cs @@ -31,9 +31,6 @@ namespace GPW.CORE.WRKLOG.Components #region Protected Properties - [Inject] - protected MessageService AppMServ { get; set; } = null!; - [Inject] protected GpwDataService DataService { get; set; } = null!; @@ -46,7 +43,7 @@ namespace GPW.CORE.WRKLOG.Components #region Protected Methods - protected override async Task OnInitializedAsync() + protected override async Task OnParametersSetAsync() { await ReloadData(); } @@ -76,6 +73,8 @@ namespace GPW.CORE.WRKLOG.Components ListRecords = null; await Task.Delay(1); ListRecords = await DataService.RegMalattieGetByDip(IdxDipendente, 10); + await Task.Delay(1); + await InvokeAsync(StateHasChanged); } #endregion Private Methods diff --git a/GPW.CORE.WRKLOG/Components/Toggler.razor.cs b/GPW.CORE.WRKLOG/Components/Toggler.razor.cs index 4c3e832..20b373b 100644 --- a/GPW.CORE.WRKLOG/Components/Toggler.razor.cs +++ b/GPW.CORE.WRKLOG/Components/Toggler.razor.cs @@ -126,79 +126,37 @@ namespace GPW.CORE.WRKLOG.Components protected string leftString { get => SelFilter.leftString; - set - { - if (SelFilter.leftString != value) - { - SelFilter.leftString = value; - reportChange(); - } - } + set => SelFilter.leftString = value; } protected string leftStringCSS { get => SelFilter.leftStringCSS; - set - { - if (SelFilter.leftStringCSS != value) - { - SelFilter.leftStringCSS = value; - reportChange(); - } - } + set => SelFilter.leftStringCSS = value; } protected string rightString { get => SelFilter.rightString; - set - { - if (SelFilter.rightString != value) - { - SelFilter.rightString = value; - reportChange(); - } - } + set => SelFilter.rightString = value; } protected string rightStringCSS { get => SelFilter.rightStringCSS; - set - { - if (SelFilter.rightStringCSS != value) - { - SelFilter.rightStringCSS = value; - reportChange(); - } - } + set => SelFilter.rightStringCSS = value; } protected string toolTip { get => SelFilter.toolTip; - set=> SelFilter.toolTip = value; - //{ - // if (SelFilter.toolTip != value) - // { - // SelFilter.toolTip = value; - // reportChange(); - // } - //} + set => SelFilter.toolTip = value; } protected string placardCss { get => SelFilter.placardCss; - set=> SelFilter.placardCss = value; - //{ - // if (SelFilter.placardCss != value) - // { - // SelFilter.placardCss = value; - // reportChange(); - // } - //} + set => SelFilter.placardCss = value; } #endregion Protected Properties diff --git a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj index f5efa53..32a4c4d 100644 --- a/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj +++ b/GPW.CORE.WRKLOG/GPW.CORE.WRKLOG.csproj @@ -2,7 +2,7 @@ net6.0 - 3.0.2301.0510 + 3.0.2301.0514 enable enable diff --git a/GPW.CORE.WRKLOG/Pages/Illness.razor.cs b/GPW.CORE.WRKLOG/Pages/Illness.razor.cs index ad13183..1f4243c 100644 --- a/GPW.CORE.WRKLOG/Pages/Illness.razor.cs +++ b/GPW.CORE.WRKLOG/Pages/Illness.razor.cs @@ -38,12 +38,12 @@ namespace GPW.CORE.WRKLOG.Pages await Task.Delay(1); // aggiorno display... await Task.Delay(1); - ReloadData(); + await ReloadData(); } - protected override void OnInitialized() + protected override async Task OnParametersSetAsync() { - ReloadData(); + await ReloadData(); } #endregion Protected Methods @@ -62,8 +62,9 @@ namespace GPW.CORE.WRKLOG.Pages #region Private Methods - private void ReloadData() + private async Task ReloadData() { + await Task.Delay(1); isLoading = true; currRecord = new RegMalattieModel() { diff --git a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor index 79ba6f4..42f70a1 100644 --- a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor +++ b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor @@ -22,149 +22,3 @@ -@code { - - [Inject] - private NavigationManager NavManager { get; set; } = null!; - - private string userName = ""; - - protected override async Task OnInitializedAsync() - { - //effettuo eventuale recupero dati dipendente - if (AppMServ.RigaDip == null) - { - await LoadUtente(); - } - // verifica attivazione - await VerifyActiv(); - } - - protected async Task DoReloadUtente() - { - AppMServ.RigaDip = null; - await Task.Delay(250); - await LoadUtente(); - // verifico attivazione dipendente... - await checkUserLicense(); - } - - protected async Task DoVerifyActiv() - { - AppMServ.PayloadOk = false; - await Task.Delay(250); - await VerifyActiv(); - } - - protected async Task LoadUtente() - { - var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); - var user = authState.User; - // verifico se ho utente loggato... - if (user.Identity != null && user.Identity.IsAuthenticated) - { - userName = $"{user.Identity.Name}"; - // cerco su DB - var listaDip = await GDataServ.DipendentiGetAll(); - DipendentiModel? rigaDip = listaDip - .Where(x => $"{x.Dominio}\\{x.Utente}".ToLower() == userName.ToLower()) - .FirstOrDefault(); - if (rigaDip != null) - { - // salvo riga info dipendente - AppMServ.RigaDip = rigaDip; - userName = $"{rigaDip.Cognome} {rigaDip.Nome}"; - } - } - else - { - userName = "N.A."; - } - } - - protected async Task VerifyActiv() - { - // preliminarmente verifica shared info - await checkSharedInfo(); - // refresh attivazioni se necessario - await checkActivations(); - // verifico e salvo dati attivazione dipendente... - await checkUserLicense(); - } - - /// - /// Verifica informazioni condivise applicazione - /// - /// - protected async Task checkSharedInfo() - { - bool allOk = false; - if (!LicServ.ValidData) - { - // salvo cod app da Conf... - LicServ.Applicazione = GDataServ.CodApp; - // effettuo lettura dati preliminari da AKV (eventualmente in cache...) - List? rawAkvList = await GDataServ.AKVList(); - if (rawAkvList != null) - { - LicServ.AKVList = rawAkvList; - allOk = LicServ.InitAkv(); - } - } - await Task.Delay(1); - return allOk; - } - - /// - /// Verifica informazioni condivise applicazione - /// - /// - protected async Task checkActivations() - { - bool allOk = false; - if (LicServ.ValidData) - { - // se non fosse tutto ok - if (!LicServ.HasActivData) - { - // chiamo refresh licenze da remoto - allOk = await LicServ.RefreshLicense(); - } - } - await Task.Delay(1); - return allOk; - } - - /// - /// Verifica info specifiche utente - /// - /// - protected async Task checkUserLicense() - { - bool answ = false; - // verifico utente attivo - answ = AppMServ.IsActive; - if (answ) - { - var rawActList = LicServ.ActivList; - // recupero hash utente - string hashImpiego = AppMServ.HashDip; - // confronto con elenco attivazioni dello shared service... - var foundRec = rawActList.Where(x => x.CodImpiego == hashImpiego); - answ = foundRec.Count() > 0; - // salvo status payloadOk - AppMServ.PayloadOk = answ; - } - await Task.Delay(1); - return answ; - } - - protected string cssActive - { - get => AppMServ.IsActive ? "text-success" : "text-danger"; - } - protected string cssLicOk - { - get => AppMServ.PayloadOk ? "text-success" : "text-danger"; - } -} \ No newline at end of file diff --git a/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs new file mode 100644 index 0000000..28bad9b --- /dev/null +++ b/GPW.CORE.WRKLOG/Shared/LoginDisplay.razor.cs @@ -0,0 +1,166 @@ +using GPW.CORE.Data.DbModels; +using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Authorization; + +namespace GPW.CORE.WRKLOG.Shared +{ + public partial class LoginDisplay + { + #region Protected Properties + + protected string cssActive { get => AppMServ.IsActive ? "text-success" : "text-danger"; } + + protected string cssLicOk { get => AppMServ.PayloadOk ? "text-success" : "text-danger"; } + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Verifica informazioni condivise applicazione + /// + /// + protected async Task checkActivations() + { + bool allOk = false; + if (LicServ.ValidData) + { + // se non fosse tutto ok + if (!LicServ.HasActivData) + { + // chiamo refresh licenze da remoto + allOk = await LicServ.RefreshLicense(); + } + } + + await Task.Delay(1); + return allOk; + } + + /// + /// Verifica informazioni condivise applicazione + /// + /// + protected async Task checkSharedInfo() + { + bool allOk = false; + if (!LicServ.ValidData) + { + // salvo cod app da Conf... + LicServ.Applicazione = GDataServ.CodApp; + // effettuo lettura dati preliminari da AKV (eventualmente in cache...) + List? rawAkvList = await GDataServ.AKVList(); + if (rawAkvList != null) + { + LicServ.AKVList = rawAkvList; + allOk = LicServ.InitAkv(); + } + } + + await Task.Delay(1); + return allOk; + } + + /// + /// Verifica info specifiche utente + /// + /// + protected async Task checkUserLicense() + { + bool answ = false; + // verifico utente attivo + answ = AppMServ.IsActive; + if (answ) + { + var rawActList = LicServ.ActivList; + // recupero hash utente + string hashImpiego = AppMServ.HashDip; + // confronto con elenco attivazioni dello shared service... + var foundRec = rawActList.Where(x => x.CodImpiego == hashImpiego); + answ = foundRec.Count() > 0; + // salvo status payloadOk + AppMServ.PayloadOk = answ; + } + + await Task.Delay(1); + return answ; + } + + protected async Task DoReloadUtente() + { + AppMServ.RigaDip = null; + await Task.Delay(250); + await LoadUtente(); + // verifico attivazione dipendente... + await checkUserLicense(); + } + + protected async Task DoVerifyActiv() + { + AppMServ.PayloadOk = false; + await Task.Delay(250); + await VerifyActiv(); + } + + protected async Task LoadUtente() + { + var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); + var user = authState.User; + // verifico se ho utente loggato... + if (user.Identity != null && user.Identity.IsAuthenticated) + { + userName = $"{user.Identity.Name}"; + // cerco su DB + var listaDip = await GDataServ.DipendentiGetAll(); + DipendentiModel? rigaDip = listaDip.Where(x => $"{x.Dominio}\\{x.Utente}".ToLower() == userName.ToLower()).FirstOrDefault(); + if (rigaDip != null) + { + // salvo riga info dipendente + AppMServ.RigaDip = rigaDip; + userName = $"{rigaDip.Cognome} {rigaDip.Nome}"; + } + } + else + { + userName = "N.A."; + } + } + + protected override async Task OnInitializedAsync() + { + //effettuo eventuale recupero dati dipendente + if (AppMServ.RigaDip == null) + { + await LoadUtente(); + } + + // verifica attivazione + await VerifyActiv(); + } + + protected async Task VerifyActiv() + { + // preliminarmente verifica shared info + await checkSharedInfo(); + // refresh attivazioni se necessario + await checkActivations(); + // verifico e salvo dati attivazione dipendente... + await checkUserLicense(); + } + + #endregion Protected Methods + + #region Private Fields + + private string userName = ""; + + #endregion Private Fields + + #region Private Properties + + [Inject] + private NavigationManager NavManager { get; set; } = null!; + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/Resources/ChangeLog.html b/Resources/ChangeLog.html index 4ded694..fa108a9 100644 --- a/Resources/ChangeLog.html +++ b/Resources/ChangeLog.html @@ -1,6 +1,6 @@ GPW - Gestione Presenze Web -

Versione: 3.0.2301.0510

+

Versione: 3.0.2301.0514


Note di rilascio:
  • diff --git a/Resources/VersNum.txt b/Resources/VersNum.txt index de6fceb..7c51c09 100644 --- a/Resources/VersNum.txt +++ b/Resources/VersNum.txt @@ -1 +1 @@ -3.0.2301.0510 +3.0.2301.0514 diff --git a/Resources/manifest.xml b/Resources/manifest.xml index 003120c..b1d0f08 100644 --- a/Resources/manifest.xml +++ b/Resources/manifest.xml @@ -1,6 +1,6 @@ - 3.0.2301.0510 + 3.0.2301.0514 http://nexus.steamware.net/repository/SWS/GWMS/stable/0/GWMS.UI.zip http://nexus.steamware.net/repository/SWS/GWMS/stable/0/ChangeLog.html false