From 8fd141abaa0f5fd7f6837316dd3e6b99fc9d746c Mon Sep 17 00:00:00 2001 From: Alejandro Date: Thu, 17 Sep 2026 09:15:52 +0200 Subject: [PATCH] =?UTF-8?q?-=20Edici=C3=B3n=20de=20todas=20las=20tablas=20?= =?UTF-8?q?y=20campos=20dentro=20de=20infoPers=20-=20Controladores=20vario?= =?UTF-8?q?s=20para=20poder=20hacer=20estas=20ediciones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .serena/.gitignore | 2 + .serena/project.yml | 169 +++++++++++++ .../Components/Pages/InfoPers.razor | 68 +++-- .../InfoPersComponents/AscendientesGrid.razor | 20 +- .../ConceptosPuestosTrabajo.razor | 234 +++++++++++++++++- .../InfoPersComponents/DiferenciaGrid.razor | 3 +- .../DiferenciaTrieniosGrid.razor | 95 ++++++- .../InfoPersComponents/EnfermedadesGrid.razor | 4 +- .../InfoPersComponents/ExpedientesGrid.razor | 15 +- .../Pages/InfoPersComponents/HijosGrid.razor | 22 +- .../InfoPersComponents/HuelgasGrid.razor | 3 +- .../InfoPersComponents/IRPFActGrid.razor | 41 +-- .../InfoPersComponents/IRPFHistGrid.razor | 18 +- .../InfoPersComponents/IncidenciaGrid.razor | 9 +- .../InfoPersComponents/MaternidadesGrid.razor | 2 + .../OtrasRetribucionesGrid.razor | 19 +- .../InfoPersComponents/OtrosDatosGrid.razor | 165 ++++++++---- .../InfoPersComponents/PermisosGrid.razor | 39 +-- .../PermisosSinRetriGrid.razor | 3 +- .../InfoPersComponents/PrestamosGrid.razor | 197 ++++++++++++++- .../ProductividadGrid.razor | 28 ++- .../PuestosTrabajoGrid.razor | 2 +- .../ReduccionesJornadaGrid.razor | 86 ++++++- .../RetencionesJudicialesGrid.razor | 225 +++++++++++++++-- .../SexeniosQuinqueniosGrid.razor | 40 +-- .../TrabajadoresTiempoParcialGrid.razor | 85 ++++++- .../TrieniosCarreraGrid.razor | 85 ++++--- .../Components/Pages/NominaPersona.razor | 4 - .../Controllers/ASCENDIENTESController.cs | 12 + .../CONCEPTOSPUESTOSDETRABAJOController.cs | 70 ++++++ .../DIFERENCIATRIENIOSController.cs | 15 ++ .../EXPEDIENTESPERSONASController.cs | 12 + .../Controllers/HIJOSController.cs | 12 + .../Controllers/HISTORICOIRPFController.cs | 12 + .../OTRASRETRIBUCIONESController.cs | 12 + .../Controllers/PRESTAMOSController.cs | 12 + .../Controllers/PRODUCTIVIDADController.cs | 12 + .../Controllers/PUESTOSTRABAJOController.cs | 113 +++++++++ .../REDUCCIONDEJORNADAController.cs | 15 ++ .../RETENCIONJUDICIALController.cs | 12 + .../SITUACIONACTUALIRPFController.cs | 12 + .../TRABAJADORTIEMPOPARCIALController.cs | 15 ++ 42 files changed, 1823 insertions(+), 196 deletions(-) create mode 100644 .serena/.gitignore create mode 100644 .serena/project.yml create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/ASCENDIENTESController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/CONCEPTOSPUESTOSDETRABAJOController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/DIFERENCIATRIENIOSController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/EXPEDIENTESPERSONASController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/HIJOSController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/HISTORICOIRPFController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/OTRASRETRIBUCIONESController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/PRESTAMOSController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/PRODUCTIVIDADController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/PUESTOSTRABAJOController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/REDUCCIONDEJORNADAController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/RETENCIONJUDICIALController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/SITUACIONACTUALIRPFController.cs create mode 100644 Antifraude.Net/SwaggerAntifraude/Controllers/TRABAJADORTIEMPOPARCIALController.cs diff --git a/.serena/.gitignore b/.serena/.gitignore new file mode 100644 index 0000000..2e510af --- /dev/null +++ b/.serena/.gitignore @@ -0,0 +1,2 @@ +/cache +/project.local.yml diff --git a/.serena/project.yml b/.serena/project.yml new file mode 100644 index 0000000..a8e60a9 --- /dev/null +++ b/.serena/project.yml @@ -0,0 +1,169 @@ +# the name by which the project can be referenced within Serena/when chatting with the LLM. +project_name: "ANTIFRAUDE.NET" + +# list of language servers to start when using the LSP backend; choose from: +# ada al angular ansible bash +# bsl clojure cpp cpp_ccls crystal +# csharp csharp_omnisharp cue dart deno +# elixir elm erlang fortran fsharp +# gdscript gleam go groovy haskell +# haxe hlsl html java json +# julia kotlin latex lean4 lua +# luau markdown matlab msl nextflow +# nix ocaml pascal perl php +# php_phpactor php_phpantom powershell python python_basedpyright +# python_jedi python_pyrefly python_ty qml r +# rego ruby ruby_solargraph rust scala +# scss solidity svelte swift systemverilog +# terraform toml typescript typescript_vts vue +# wolfram yaml zig +# (This list may be outdated; generated with scripts/print_language_list.py; +# For the current list, see values of the LanguageServerId enum here: +# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py) +# For some languages, there are several alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.) +# Note: +# - For C, use cpp +# - For JavaScript, use typescript +# - For Angular projects, use angular (subsumes typescript+html; requires `npm install` in the project root) +# - For Svelte projects, use svelte (subsumes typescript/javascript for .svelte projects; requires npm) +# - For Deno projects, use deno (serves the same .ts/.js files as typescript; requires the deno CLI on PATH) +# - For SCSS / Sass / plain CSS, use scss (some-sass-language-server handles all three) +# - For Free Pascal/Lazarus, use pascal +# Special requirements: +# Some language servers require additional setup/installations. +# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers +# When using multiple language servers, the first language server that supports a given file will be used for that file. +# The first language server is the default language and the respective language server will be used as a fallback. +# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored. +language_servers: +- csharp + +# the encoding used by text files in the project +# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings +encoding: "utf-8" + +# optional shell command to run before the language backend (LSP or JetBrains) is initialised. +# the command runs in the project root directory and is only executed if the project is trusted +# (see trusted_project_path_patterns in the global configuration). +# serena waits for the command to exit: a non-zero exit code is logged as an error but does not +# abort activation. a per-project timeout (activation_command_timeout, default 180s) is the safety +# backstop for non-terminating commands; on expiry the process is killed and activation continues. +# example: activation_command: "npx nx run-many -t build" +activation_command: + +# maximum time in seconds to wait for activation_command to complete before killing it (default 180s). +# must be a positive number. +activation_command_timeout: 180.0 + +# line ending convention to use when writing source files. +# Possible values: unset (use global setting), "lf", "crlf", or "native" (platform default) +# This does not affect Serena's own files (e.g. memories and configuration files), which always use native line endings. +line_ending: + +# The language backend to use for this project. +# If not set, the global setting from serena_config.yml is used. +# Valid values: LSP, JetBrains +# Note: the backend is fixed at startup. If a project with a different backend +# is activated post-init, an error will be returned. +language_backend: + +# whether to use project's .gitignore files to ignore files +ignore_all_files_in_gitignore: true + +# advanced configuration option allowing to configure language server-specific options. +# Maps the language key to the options. +# The settings are considered only if the project is trusted (see global configuration to define trusted projects). +# See https://oraios.github.io/serena/02-usage/050_configuration.html#language-server-specific-settings +ls_specific_settings: {} + +# list of workspace folder paths (LSP backend only). +# These folders will be used to build up Serena's symbol index. +# Paths must be within the project root and should thus be relative to the project root. +# Furthermore, the paths should not be filtered by ignore settings. +# Default setting: The entire project root folder (".") is considered. +# In (large) monorepos, this can be used to index only subfolders of the project root, e.g. +# ls_workspace_folders: +# - "./subproject1" +# - "./subproject2" +ls_workspace_folders: +- "." + +# list of additional workspace folder paths for cross-package reference support. +# Paths can be absolute or relative to the project root. +# Each folder is registered as an LSP workspace folder, enabling language servers to discover +# symbols and references across package boundaries, but these folders are not indexed by Serena, +# i.e. the respective symbols will not be found using Serena's symbol search tools. +# Example: +# additional_workspace_folders: +# - ../sibling-package +# - ../shared-lib +ls_additional_workspace_folders: [] + +# list of additional paths to ignore in this project. +# Same syntax as gitignore, so you can use * and **. +# Important: quote patterns that start with `*`, otherwise YAML treats them as aliases. +# Example: +# ignored_paths: +# - "examples/**" +# - ".worktrees/**" +# - "**/bin/**" +# - "**/obj/**" +# Note: global ignored_paths from serena_config.yml are also applied additively. +ignored_paths: [] + +# whether the project is in read-only mode +# If set to true, all editing tools will be disabled and attempts to use them will result in an error +# Added on 2025-04-18 +read_only: false + +# list of tool names to exclude. +# This extends the existing exclusions (e.g. from the global configuration) +# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html +excluded_tools: [] + +# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default). +# This extends the existing inclusions (e.g. from the global configuration). +# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html +included_optional_tools: [] + +# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools. +# This cannot be combined with non-empty excluded_tools or included_optional_tools. +# Find the list of tools here: https://oraios.github.io/serena/01-about/035_tools.html +fixed_tools: [] + +# list of mode names that are to be activated by default, overriding the setting in the global configuration. +# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes. +# If the setting is undefined/empty, the default_modes from the global configuration (serena_config.yml) apply. +# Otherwise, this overrides the setting from the global configuration (serena_config.yml). +# Therefore, you can set this to [] if you do not want the default modes defined in the global config to apply +# for this project. +# This setting can, in turn, be overridden by CLI parameters (--mode). +# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes +default_modes: + +# list of mode names to be activated additionally for this project, e.g. ["query-projects"] +# The full set of modes to be activated is base_modes (from global config) + default_modes + added_modes. +# See https://oraios.github.io/serena/02-usage/050_configuration.html#modes +added_modes: + +# initial prompt for the project. It will always be given to the LLM upon activating the project +# (contrary to the memories, which are loaded on demand). +initial_prompt: "" + +# time budget (seconds) per tool call for the retrieval of additional symbol information +# such as docstrings or parameter information. +# This overrides the corresponding setting in the global configuration; see the documentation there. +# If null or missing, use the setting from the global configuration. +symbol_info_budget: + +# list of regex patterns which, when matched, mark a memory entry as read‑only. +# Extends the list from the global configuration, merging the two lists. +read_only_memory_patterns: [] + +# list of regex patterns for memories to completely ignore. +# Matching memories will not appear in list_memories or activate_project output +# and cannot be accessed via read_memory or write_memory. +# To access ignored memory files, use the read_file tool on the raw file path. +# Extends the list from the global configuration, merging the two lists. +# Example: ["_archive/.*", "_episodes/.*"] +ignored_memory_patterns: [] diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPers.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPers.razor index 20044f0..9821151 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPers.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPers.razor @@ -312,42 +312,42 @@ - + - + - + - + - + - + - + - + @@ -357,57 +357,57 @@ - + - + - + - + - + - + - + - + - + - + - + @@ -417,17 +417,17 @@ - + - + - + @@ -771,6 +771,30 @@ } } + private async Task ActualizarPersonaDesdeHijo() + { + try + { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + var nifDesencriptado = tsUtilidades.crypt.FEncS(cl, + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*", + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*", + -875421649); + var response = await cliente.GetAsync($"/api/PERSONAS/PersonaNominaNif/{nifDesencriptado}"); + if (response.IsSuccessStatusCode) + { + var contenido = await response.Content.ReadAsStringAsync(); + persona = JsonConvert.DeserializeObject(contenido) + ?? throw new InvalidOperationException("No se pudo actualizar la persona."); + await InvokeAsync(StateHasChanged); + } + } + catch (Exception ex) + { + Console.WriteLine($"Error al actualizar la persona después de guardar: {ex.Message}"); + } + } + private async Task CerrarConfirmacion() { await popupConfirmacion.HideAsync(); diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/AscendientesGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/AscendientesGrid.razor index 892728d..e18899c 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/AscendientesGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/AscendientesGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ @context.NOMBRE @@ -54,6 +56,13 @@
+
+
+
+
+
+
+
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); @@ -61,16 +70,25 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + private Modal popupGestionDatos = default!; + private ASCENDIENTES ItemEnEdicion { get; set; } = new(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.ASCENDIENTES; - foreach (ASCENDIENTES i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + protected override void OnParametersSet() + { + itmList = Persona.ASCENDIENTES?.ToList() ?? new List(); + } + private async Task abrirPopupModificacion(ASCENDIENTES objeto, bool esNuevo) { ItemEnEdicion = objeto; if (esNuevo) ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await popupGestionDatos.ShowAsync(); } + private async Task cerrarPopupModificacion() => await popupGestionDatos.HideAsync(); + private async Task GestionarDatos(bool esNuevo) { if (esNuevo) { ItemEnEdicion.IDASCENDIENTES = 0; ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await Utilidades.NuevoObjeto(cliente, "/api/ASCENDIENTES/", ItemEnEdicion); } else await Utilidades.ActualizarObjeto(cliente, "/api/ASCENDIENTES/" + ItemEnEdicion.IDASCENDIENTES, ItemEnEdicion); await cerrarPopupModificacion(); await OnPersonaActualizada.InvokeAsync(); } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ConceptosPuestosTrabajo.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ConceptosPuestosTrabajo.razor index e6aaef7..30aa4bf 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ConceptosPuestosTrabajo.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ConceptosPuestosTrabajo.razor @@ -15,8 +15,8 @@ @inject IHttpClientFactory HttpClientFactory @inject IHttpContextAccessor HttpContextAccessor @inject UserState UserState - -
+@if (Puesto != null){ +
@@ -29,32 +29,210 @@ - + @foreach (TIPOSPUESTOSTRABAJO con in lPuestos) { } + - + @* *@ +
+
+ + + + @foreach (ENUMERACIONES con in lGrupo) + { + + } + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ @* *@ + + + + + + + + + @context.NOMBRE + + + @context.DESCRIPCION + + + @context.IMPORTE + + + @context.CONCEPTOAPLPRES + + + @context.APLICACIONPRESUPUESTARIA + + + @if (context.RETRIBUCIONES == true) + { + + } + + + @if (context.DEDUCCIONES == true) + { + + } + + + @if (context.COTIZASEGURIDADSOCIAL == true) + { + + } + + + @if (context.COTIZAIRPF == true) + { + + } + + + @if (context.EXTRA == true) + { + + } + + + +
+ + + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + + + +
+
+ + + + + + + + + +
+
+
+ + + @if (ItemEnEdicion.IDCONCEPTOSPUESTOSDETRABAJO != 0) + { + + } + else + { + + } + +
+ +} @code { [Parameter] public string? cl { get; set; } = ""; + private Modal popupGestionDatos = default; + private CONCEPTOSPUESTOSDETRABAJO ItemEnEdicion { get; set; } = new CONCEPTOSPUESTOSDETRABAJO(); private PUESTOSTRABAJO Puesto { get; set; } = new PUESTOSTRABAJO(); private List lPuestos = new List(); + private List lGrupo = new List(); + private List lConceptosPuestos = new List(); private string itmDescripPuesto { get; set; } + private string itmGrupPuesto { get; set; } + private bool chbRetribuciones { get; set; } + private bool chbDeduccion { get; set; } + private bool chbCotizaSS { get; set; } + private bool chbCotizaIRPF { get; set; } + private bool chbExtra { get; set; } + private bool chbLiquida { get; set; } private HttpClient cliente = new HttpClient(); + private async Task cerrarPopupModificacion() + { + await popupGestionDatos.HideAsync(); + } + private async Task abrirPopupModificacion(CONCEPTOSPUESTOSDETRABAJO objeto, bool esNuevo) + { + ItemEnEdicion = objeto; + chbRetribuciones = ItemEnEdicion.RETRIBUCIONES; + chbDeduccion= ItemEnEdicion.DEDUCCIONES; + chbCotizaSS= ItemEnEdicion.COTIZASEGURIDADSOCIAL; + chbCotizaIRPF= ItemEnEdicion.COTIZAIRPF; + chbExtra= ItemEnEdicion.EXTRA; + await popupGestionDatos.ShowAsync(); + } protected override async Task OnInitializedAsync() { cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); await CargarListas(); } - private async Task CargarListas() { try @@ -65,8 +243,14 @@ cl = clValue; } var idPuesto = Utilidades.Desencriptar(cl); - Puesto = await Utilidades.ObtenerObjeto(cliente, "/api/PUESTOSTRABAJO/" + idPuesto); + Puesto = await Utilidades.ObtenerObjeto(cliente, "/api/PUESTOSTRABAJO/" + idPuesto); + itmDescripPuesto = Puesto.IDTIPOPUESTOTRABAJONavigation.DESCRIPCION; lPuestos = await Utilidades.ObtenerObjeto>(cliente, "/api/TIPOSPUESTOSTRABAJO/"); + foreach(CONCEPTOSPUESTOSDETRABAJO pues in Puesto.CONCEPTOSPUESTOSDETRABAJO) + { + lConceptosPuestos.Add(pues); + } + chbLiquida = Puesto.LIQUIDAPAGA; StateHasChanged(); } @@ -75,5 +259,43 @@ Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + private async Task GestionarDatos(bool tipo) + { + var inci = ItemEnEdicion; + if (tipo == true) + { + inci.IDCONCEPTOSPUESTOSDETRABAJO = 0; + } + inci.IDPUESTOSDETRABAJO = Puesto.IDPUESTOSTRABAJO; + string chbRetri = "chbRetribuciones"; + inci.RETRIBUCIONES = await JS.InvokeAsync("obtenerCheck", chbRetri); + string chbDeduc = "chbDeduccion"; + inci.DEDUCCIONES = await JS.InvokeAsync("obtenerCheck", chbDeduc); + string chbCotizaSS = "chbCotizaSS"; + inci.COTIZASEGURIDADSOCIAL = await JS.InvokeAsync("obtenerCheck", chbCotizaSS); + string chbCotizaIRPF = "chbCotizaIRPF"; + inci.COTIZAIRPF = await JS.InvokeAsync("obtenerCheck", chbCotizaIRPF); + string chbExtra = "chbExtra"; + inci.EXTRA = await JS.InvokeAsync("obtenerCheck", chbExtra); + + + if (inci.IDCONCEPTOSPUESTOSDETRABAJO != 0) + { + var response = await Utilidades.ActualizarObjeto(cliente, "/api/CONCEPTOSPUESTOSDETRABAJO/" + inci.IDCONCEPTOSPUESTOSDETRABAJO, inci); + } + else + { + var response = await Utilidades.NuevoObjeto(cliente, "/api/CONCEPTOSPUESTOSDETRABAJO/", inci); + } + await cerrarPopupModificacion(); + await CargarListas(); + + + } } + \ No newline at end of file diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaGrid.razor index d579b2a..27c2ac3 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaGrid.razor @@ -101,6 +101,7 @@ private DIFERENCIAPAGODELEGADO ItemEnEdicion { get; set; } = new DIFERENCIAPAGODELEGADO(); // private List meses = new List(); private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.DIFERENCIAPAGODELEGADO?.ToList() ?? new(); protected override async Task OnInitializedAsync() @@ -115,7 +116,6 @@ try { var listnom = Persona.DIFERENCIAPAGODELEGADO; - foreach (DIFERENCIAPAGODELEGADO i in listnom) { itmList.Add(i); } } catch (Exception e) { @@ -153,6 +153,7 @@ var resultContent = await response1.Content.ReadAsStringAsync(); Persona = JsonConvert.DeserializeObject(resultContent) ?? throw new Exception("Error al deserializar los datos de la persona."); await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaTrieniosGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaTrieniosGrid.razor index 5514645..6c85dcb 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaTrieniosGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/DiferenciaTrieniosGrid.razor @@ -15,6 +15,8 @@ @inject UserState UserState
+ +
+ + + + + @context.NUMEROTRIENIOS @@ -51,23 +58,109 @@
+ + + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ + + @if (ItemEnEdicion.IDDIFERENCIASTRIENIOS != 0) + { + + } + else + { + + } + +
+ + + + @code { + private Modal popupGestionDatos = default; + private DIFERENCIATRIENIOS ItemEnEdicion { get; set; } = new DIFERENCIATRIENIOS(); [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); private HttpClient cliente = new HttpClient(); [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.DIFERENCIATRIENIOS?.ToList() ?? new(); + protected override async Task OnInitializedAsync() + { + + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + await CargarListas(); + + + } + private async Task CargarListas() { try { var listnom = Persona.DIFERENCIATRIENIOS; - foreach (DIFERENCIATRIENIOS i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + private async Task cerrarPopupModificacion() + { + await popupGestionDatos.HideAsync(); + } + private async Task abrirPopupModificacion(DIFERENCIATRIENIOS objeto, bool esNuevo) + { + ItemEnEdicion = objeto; + + await popupGestionDatos.ShowAsync(); + } + private async Task GestionarDatos(bool tipo) + { + var inci = ItemEnEdicion; + if (tipo == true) + { + inci.IDDIFERENCIASTRIENIOS= 0; + inci.IDPERSONA = Persona.IDPERSONA; + } + + if (inci.IDDIFERENCIASTRIENIOS != 0) + { + var response = await Utilidades.ActualizarObjeto(cliente, "/api/DIFERENCIATRIENIOS/" + inci.IDDIFERENCIASTRIENIOS, inci); + } + else + { + var response = await Utilidades.NuevoObjeto(cliente, "/api/DIFERENCIATRIENIOS/", inci); + } + await cerrarPopupModificacion(); + await OnPersonaActualizada.InvokeAsync(); + } + + } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/EnfermedadesGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/EnfermedadesGrid.razor index 5e0e3d4..0b2747c 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/EnfermedadesGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/EnfermedadesGrid.razor @@ -132,6 +132,7 @@ public EventCallback OnPersonaActualizada { get; set; } private string itmTipo { get; set; } private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.ENFERMEDADES?.ToList() ?? new(); private List lTipo = new List(); private ENFERMEDADES ItemEnEdicion { get; set; } = new ENFERMEDADES(); @@ -223,7 +224,8 @@ var resultContent = await response1.Content.ReadAsStringAsync(); Persona = JsonConvert.DeserializeObject(resultContent) ?? throw new Exception("Error al deserializar los datos de la persona."); await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); } -} \ No newline at end of file +} diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ExpedientesGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ExpedientesGrid.razor index 740babc..d894255 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ExpedientesGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ExpedientesGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ @context.FECHA?.ToString("dd/MM/yyyy") @@ -46,6 +48,11 @@
+
+
+
+
+
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); @@ -53,16 +60,22 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + private Modal popup = default!; + private EXPEDIENTESPERSONAS ItemEnEdicion { get; set; } = new(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.EXPEDIENTESPERSONAS; - foreach (EXPEDIENTESPERSONAS i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + protected override void OnParametersSet() => itmList = Persona.EXPEDIENTESPERSONAS?.ToList() ?? new(); + private async Task abrirPopup(EXPEDIENTESPERSONAS item, bool nuevo) { ItemEnEdicion = item; if (nuevo) ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await popup.ShowAsync(); } + private async Task cerrarPopup() => await popup.HideAsync(); + private async Task Guardar() { if (ItemEnEdicion.IDEXPEDIENTESPERSONAS == 0) { ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await Utilidades.NuevoObjeto(cliente, "/api/EXPEDIENTESPERSONAS/", ItemEnEdicion); } else await Utilidades.ActualizarObjeto(cliente, "/api/EXPEDIENTESPERSONAS/" + ItemEnEdicion.IDEXPEDIENTESPERSONAS, ItemEnEdicion); await cerrarPopup(); await OnPersonaActualizada.InvokeAsync(); } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HijosGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HijosGrid.razor index 0b698c9..443180d 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HijosGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HijosGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ @context.NOMBRE @@ -63,6 +65,15 @@
+
+
+
+
+
+
+
+
+
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); @@ -70,16 +81,25 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + private Modal popupGestionDatos = default!; + private HIJOS ItemEnEdicion { get; set; } = new(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.HIJOS; - foreach (HIJOS i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + protected override void OnParametersSet() + { + itmList = Persona.HIJOS?.ToList() ?? new List(); + } + private async Task abrirPopupModificacion(HIJOS objeto, bool esNuevo) { ItemEnEdicion = objeto; if (esNuevo) ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await popupGestionDatos.ShowAsync(); } + private async Task cerrarPopupModificacion() => await popupGestionDatos.HideAsync(); + private async Task GestionarDatos(bool esNuevo) { if (esNuevo) { ItemEnEdicion.IDHIJO = 0; ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await Utilidades.NuevoObjeto(cliente, "/api/HIJOS/", ItemEnEdicion); } else await Utilidades.ActualizarObjeto(cliente, "/api/HIJOS/" + ItemEnEdicion.IDHIJO, ItemEnEdicion); await cerrarPopupModificacion(); await OnPersonaActualizada.InvokeAsync(); } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HuelgasGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HuelgasGrid.razor index 2f25445..135f54f 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HuelgasGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/HuelgasGrid.razor @@ -140,12 +140,14 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.HUELGAS?.ToList() ?? new(); private List lNominas = new List(); private HUELGAS ItemEnEdicion { get; set; } = new HUELGAS(); protected override async Task OnInitializedAsync() { cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); } private async Task CargarListas() @@ -154,7 +156,6 @@ try { var listnom = Persona.HUELGAS; - foreach (HUELGAS i in listnom) { itmList.Add(i); } var lNomi = await Utilidades.ObtenerObjeto>(cliente, "/api/NOMINAS"); lNominas = lNomi.OrderBy(x => x.FECHAINICIO).ToList(); } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFActGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFActGrid.razor index 7ecb16c..bf36e87 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFActGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFActGrid.razor @@ -15,14 +15,15 @@ @inject UserState UserState
+

Discapacidad

@* % Discapacidad *@
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null && @Persona.IDSITUACIONACTUALIRPFNavigation.IDDISCAPACIDADNavigation != null){ - + } else { @@ -31,10 +32,10 @@
@* Necesita Ayuda 3º Persona *@
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null) { - + } else { @@ -48,10 +49,10 @@
@* Situación *@
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null) { - + } else { @@ -60,10 +61,10 @@
@* Ingreso Administración Estado *@
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null) { - + } else { } @@ -82,10 +83,10 @@
@* Situación *@
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null) { - + } else { @@ -93,10 +94,10 @@ }
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null && Persona.IDSITUACIONACTUALIRPFNavigation.IDCONTRATOORELACIONNavigation != null) { - + } else { @@ -104,10 +105,10 @@ }
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null) { - + } else { @@ -116,10 +117,10 @@
- + @if (Persona.IDSITUACIONACTUALIRPFNavigation != null) { - + } else { @@ -137,4 +138,12 @@ private HttpClient cliente = new HttpClient(); [Parameter] public EventCallback OnPersonaActualizada { get; set; } + private async Task Guardar() + { + if (Persona.IDSITUACIONACTUALIRPFNavigation is null) + return; + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + await Utilidades.ActualizarObjeto(cliente, "/api/SITUACIONACTUALIRPF/" + Persona.IDSITUACIONACTUALIRPFNavigation.IDSITUACIONACTUALIRPF, Persona.IDSITUACIONACTUALIRPFNavigation); + await OnPersonaActualizada.InvokeAsync(); + } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFHistGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFHistGrid.razor index b95daf9..a101dda 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFHistGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IRPFHistGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ @context.FECHACALCULO?.ToString("dd/MM/yyyy") @@ -46,6 +48,14 @@
+
+
+
+
+
+
+
+
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); @@ -53,16 +63,22 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + private Modal popup = default!; + private HISTORICOIRPF ItemEnEdicion { get; set; } = new(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.HISTORICOIRPF; - foreach (HISTORICOIRPF i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + protected override void OnParametersSet() => itmList = Persona.HISTORICOIRPF?.ToList() ?? new(); + private async Task abrirPopup(HISTORICOIRPF item, bool nuevo) { ItemEnEdicion = item; if (nuevo) ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await popup.ShowAsync(); } + private async Task cerrarPopup() => await popup.HideAsync(); + private async Task Guardar() { if (ItemEnEdicion.IDHISTORICOIRPF == 0) { ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await Utilidades.NuevoObjeto(cliente, "/api/HISTORICOIRPF/", ItemEnEdicion); } else await Utilidades.ActualizarObjeto(cliente, "/api/HISTORICOIRPF/" + ItemEnEdicion.IDHISTORICOIRPF, ItemEnEdicion); await cerrarPopup(); await OnPersonaActualizada.InvokeAsync(); } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor index 22994a3..2aa6f51 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/IncidenciaGrid.razor @@ -241,6 +241,7 @@ private List annos = new List(); // private List meses = new List(); private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.INCIDENCIAS?.Where(x => !x.ESDELIQUIDACION).ToList() ?? new(); private List nombMeses = ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"]; private List lNom = new List(); private List lConceptos = new List(); @@ -277,10 +278,11 @@ { try { - itmList.Clear(); + itmList = Persona.INCIDENCIAS? + .Where(x => !x.ESDELIQUIDACION) + .ToList() + ?? new List(); annos.Clear(); - var listnom = Persona.INCIDENCIAS.Where(x => x.ESDELIQUIDACION == false).ToList(); - foreach (INCIDENCIAS i in listnom){ itmList.Add(i); } for (var i = 0; i < itmList.Count; i++) { int? year = itmList[i].AÑONOMINA; @@ -352,6 +354,7 @@ var resultContent = await response1.Content.ReadAsStringAsync(); Persona = JsonConvert.DeserializeObject(resultContent) ?? throw new Exception("Error al deserializar los datos de la persona."); await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/MaternidadesGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/MaternidadesGrid.razor index 1a49a65..32a5150 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/MaternidadesGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/MaternidadesGrid.razor @@ -128,10 +128,12 @@ private MATERNIDADES ItemEnEdicion { get; set; } = new MATERNIDADES(); // private List meses = new List(); private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.MATERNIDADES?.ToList() ?? new(); protected override async Task OnInitializedAsync() { cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); } private async Task CargarListas() { diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrasRetribucionesGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrasRetribucionesGrid.razor index e22a7cc..29ddba2 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrasRetribucionesGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrasRetribucionesGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ @context.MES @@ -62,6 +64,15 @@
+
+
+
+
+
+
+
+
+
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); @@ -69,16 +80,22 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + private Modal popup = default!; + private OTRASRETRIBUCIONES ItemEnEdicion { get; set; } = new(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.OTRASRETRIBUCIONES; - foreach (OTRASRETRIBUCIONES i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + protected override void OnParametersSet() => itmList = Persona.OTRASRETRIBUCIONES?.ToList() ?? new(); + private async Task abrirPopup(OTRASRETRIBUCIONES item, bool nuevo) { ItemEnEdicion = item; if (nuevo) ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await popup.ShowAsync(); } + private async Task cerrarPopup() => await popup.HideAsync(); + private async Task Guardar() { if (ItemEnEdicion.IDOTRASRETRIBUCIONES == 0) { ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await Utilidades.NuevoObjeto(cliente, "/api/OTRASRETRIBUCIONES/", ItemEnEdicion); } else await Utilidades.ActualizarObjeto(cliente, "/api/OTRASRETRIBUCIONES/" + ItemEnEdicion.IDOTRASRETRIBUCIONES, ItemEnEdicion); await cerrarPopup(); await OnPersonaActualizada.InvokeAsync(); } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrosDatosGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrosDatosGrid.razor index b03413e..9f82065 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrosDatosGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/OtrosDatosGrid.razor @@ -15,36 +15,58 @@ @inject UserState UserState
+

Varios

@* Mutua *@
- @if (Persona.IDMUTUANavigation != null){ - - } - else - { - - } - + + + @*Meter combo Mutuas*@ + + + @if (lMutuas != null) + { + @foreach (var enumera in lMutuas) + { + + } + } + +
@* Mutua2 *@
- @if (Persona.IDMUTUA2Navigation != null) - { - - } - else - { - - } + + + @if (lMutuas != null) + { + @foreach (var enumera in lMutuas) + { + + } + } + + @*Meter combo Mutuas*@ +
@* Puesto Trabajo Oposición *@
- @if (Persona.IDPUESTOTRABAJOOPOSICIONNavigation != null) + @*Meter combo puestoTrabajoOposicion*@ + + + @if (lPuestosTrabajo != null) + { + @foreach (var enumera in lPuestosTrabajo) + { + + } + } + +@* @if (Persona.IDPUESTOTRABAJOOPOSICIONNavigation != null) { } @@ -52,117 +74,125 @@ { } -
+ *@
@* Nº Afiliación *@
- +
@* Nº Afiliación 2 *@
- +
@* Tratamiento *@
- +
@* Importe Seguro Accidentes *@
- +
@* Cuenta Bancaria *@
- +
@* Nº Pluriempleo*@
- +
@* Base Seguridad Social Junio 2010 *@
- +
@* Formación Academica *@
- +
@* Base Mes Anterior *@
- +
- @* Fecha Alta *@ - - + @* Fecha Alta *@
- +
@* Porcentaje de Pluriempleo *@
- +
@* Causa Baja *@
- - @if (Persona.IDCAUSABAJAPARNavigation != null) + @*Meter Combo CausaBaja*@ + + + @if (lCausaBaja != null) + { + @foreach (var enumera in lCausaBaja) + { + + } + } + + @* @if (Persona.IDCAUSABAJAPARNavigation != null) { } else { - } + } *@
@* Base Anterior a la Baja *@
- +
@* Fecha Baja *@
- +
@* Premio Jubilación Mensual *@
- +
@* Fecha Baja Seguridad Social *@
- +
@* Movilidad *@

Movilidad:

- +
@* No Cotizas Desempleo *@

No Cotiza Desempleo:

- +
@* Ceuta/Melilla *@

Ceuta / Melilla:

- +
@* Pensionistas *@

Pensionistas:

- +

Ingresos

@@ -170,17 +200,17 @@ @* Ingreso Administración Autonómica *@
- +
@* Ingreso Administración Estado *@
- +
@* Ingreso Administración Local *@
- +

Sindicatos

@@ -188,20 +218,20 @@ @* Sindicato 1 *@
- +
- +
- +
- +
@@ -212,4 +242,39 @@ private HttpClient cliente = new HttpClient(); [Parameter] public EventCallback OnPersonaActualizada { get; set; } + public List lMutuas = new List(); + public List lPuestosTrabajo = new List(); + public List lCausaBaja = new List(); + + + protected override async Task OnInitializedAsync() + { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + await CargarListas(); + + } + private async Task CargarListas() + { + lMutuas = await Utilidades.ObtenerObjeto>(cliente, "/api/ENUMERACIONES/EnumeracionesGrupo/MUT"); + lPuestosTrabajo = await Utilidades.ObtenerObjeto>(cliente, "/api/TIPOSPUESTOSTRABAJO/"); + lCausaBaja = await Utilidades.ObtenerObjeto>(cliente, "/api/ENUMERACIONES/EnumeracionesGrupo/CAUBAJ"); + } + private async Task GestionarDatos() + { + + var personaGuardar = Persona; + personaGuardar.NOMINATRABAJADORCABECERA = null; + var responsea = await Utilidades.ActualizarObjeto(cliente, "/api/PERSONAS/" + personaGuardar.IDPERSONA, personaGuardar); + var url = NavigationManager.ToAbsoluteUri(NavigationManager.Uri); + var response = await cliente.GetAsync($"/api/PERSONAS/PersonaNominaNif/{Persona.NIF}"); + if (!response.IsSuccessStatusCode) + { + throw new Exception($"Error al obtener los datos de la persona. Código: {response.StatusCode}"); + } + + var resultContent = await response.Content.ReadAsStringAsync(); + Persona = JsonConvert.DeserializeObject(resultContent) ?? throw new Exception("Error al deserializar los datos de la persona."); + CargarListas(); + } + } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosGrid.razor index 2c2f9ef..2c855f3 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosGrid.razor @@ -15,36 +15,38 @@ @inject UserState UserState
+
+ +

Permisos

-

Permisos

- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
- - + +
@@ -110,6 +112,7 @@ private List itmList = new List(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.EXCEPCIONESPERMISOSIDPERSONANavigation; @@ -121,5 +124,11 @@ } } + private async Task GuardarPersona() + { + await Utilidades.ActualizarObjeto(cliente, "/api/PERSONAS/" + Persona.IDPERSONA, Persona); + await OnPersonaActualizada.InvokeAsync(); + } + } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosSinRetriGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosSinRetriGrid.razor index 4b4d24a..05ab265 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosSinRetriGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PermisosSinRetriGrid.razor @@ -139,11 +139,13 @@ public EventCallback OnPersonaActualizada { get; set; } private PERMISOSSINRETRIBUCION ItemEnEdicion { get; set; } = new PERMISOSSINRETRIBUCION(); private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.PERMISOSSINRETRIBUCION?.ToList() ?? new(); private List lNominas = new List(); protected override async Task OnInitializedAsync() { cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); } private async Task CargarListas() @@ -152,7 +154,6 @@ try { var listnom = Persona.PERMISOSSINRETRIBUCION; - foreach (PERMISOSSINRETRIBUCION i in listnom) { itmList.Add(i); } var lNomi = await Utilidades.ObtenerObjeto>(cliente, "/api/NOMINAS"); lNominas = lNomi.OrderBy(x => x.FECHAINICIO).ToList(); } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PrestamosGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PrestamosGrid.razor index 85c32b8..4757602 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PrestamosGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PrestamosGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ + + - @context.IDNOMINAINICIONavigation.DESCRIPCION + @context.IDNOMINAINICIONavigation?.DESCRIPCION @context.FECHAINICIO.ToString("dd/MM/yyyy") @@ -53,13 +57,47 @@ @context.SALDO - +
+ + + +
+
+ + +
+
+
+
+
+
+
+
+
+ + + @if (ItemEnEdicion.IDPRESTAMO != 0) + { + + } + else + { + + } + +
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); @@ -67,16 +105,169 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + private List lNominas = new List(); + private Modal popupGestionDatos = default!; + private PRESTAMOS ItemEnEdicion { get; set; } = new PRESTAMOS(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.PRESTAMOS; - foreach (PRESTAMOS i in listnom) { itmList.Add(i); } + lNominas = await Utilidades.ObtenerObjeto>(cliente, "/api/NOMINAS") ?? new List(); } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + protected override void OnParametersSet() + { + itmList = Persona.PRESTAMOS?.ToList() ?? new List(); + } + + private async Task abrirPopupModificacion(PRESTAMOS objeto, bool esNuevo) + { + ItemEnEdicion = objeto; + if (esNuevo) + { + ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; + ItemEnEdicion.FECHAINICIO = DateTime.Today; + ItemEnEdicion.FECHAFIN = DateTime.Today; + ItemEnEdicion.SALDO = ItemEnEdicion.IMPORTE; + } + await popupGestionDatos.ShowAsync(); + } + + private async Task cerrarPopupModificacion() => await popupGestionDatos.HideAsync(); + + private async Task GestionarDatos(bool tipo) + { + if (tipo) + { + ItemEnEdicion.IDPRESTAMO = 0; + ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; + } + + if (ItemEnEdicion.IDPRESTAMO != 0) + await Utilidades.ActualizarObjeto(cliente, "/api/PRESTAMOS/" + ItemEnEdicion.IDPRESTAMO, ItemEnEdicion); + else + { + await Utilidades.NuevoObjeto(cliente, "/api/PRESTAMOS/", ItemEnEdicion); + } + await cerrarPopupModificacion(); + await OnPersonaActualizada.InvokeAsync(); + } + + private async Task GenerarAmortizacion(PRESTAMOS pr) + { + + + try + { + // const string mensaje = + // "¿Está seguro de querer eliminar las amortizaciones existentes y recalcularlas de nuevo?"; + + // if (DXMessageBox.Show(mensaje, "Atención", MessageBoxButton.YesNo) != MessageBoxResult.Yes) + // return; + + // gcPrestamos.View.CommitEditing(true); + + + var enumPibe = await Utilidades.ObtenerObjeto>(cliente, "/api/ENUMERACIONES/EnumeracionesGrupo/NOM.PIBE"); + var pibe = enumPibe.FirstOrDefault().VALORNUMERICO1; + + if (pibe == null) + throw new InvalidOperationException("No se ha encontrado la enumeración NOM.PIBE."); + + var nomina = new NOMINAS(); + var response = await cliente.GetAsync("/api/NOMINAS/" + pr.IDNOMINAINICIO.ToString()); + var ResponseContent = await response.Content.ReadAsStringAsync(); + if (response.IsSuccessStatusCode) + { + nomina = JsonConvert.DeserializeObject(ResponseContent) ?? new NOMINAS(); + } + else + { + nomina = new NOMINAS(); + } + + + if (nomina == null) + throw new InvalidOperationException( + $"No se ha encontrado la nómina {pr.IDNOMINAINICIO}."); + + var saldoRestante = pr.SALDO; + var añoAmortizacion = nomina.AÑO; + var mesAmortizacion = nomina.MES; + + // Eliminar las amortizaciones existentes + foreach (var amortizacion in pr.AMORTIZACIONESPRESTAMOS.ToList()) + { + + var responsed = await cliente.DeleteAsync("/api/AMORTIZACIONESPRESTAMOS/" + amortizacion.IDAMORTIZACIONESPRESTAMOS); + // AMORTIZACIONESPRESTAMOS.DeleteObject(amortizacion); + } + + pr.AMORTIZACIONESPRESTAMOS.Clear(); + + // Generar las nuevas amortizaciones + for (var plazo = 1; plazo <= pr.MESES; plazo++) + { + var cantidadAmortizada = Math.Round( + pr.IMPORTE / pr.MESES, + 2, + MidpointRounding.AwayFromZero); + + // Ajustar la última cuota para evitar diferencias de redondeo + if (plazo == pr.MESES) + { + cantidadAmortizada = Math.Round( + saldoRestante, + 2, + MidpointRounding.AwayFromZero); + } + + var importePagoEspecie = Math.Round( + saldoRestante * pibe.Value / 100 / 12, + 2, + MidpointRounding.AwayFromZero); + + saldoRestante = Math.Round( + Math.Max(0, saldoRestante - cantidadAmortizada), + 2, + MidpointRounding.AwayFromZero); + + var amortizacion = new AMORTIZACIONESPRESTAMOS + { + AMORTIZADO = false, + AÑO = añoAmortizacion, + MES = mesAmortizacion, + INTERESBANCOESPAÑA = pibe.Value, + CANTIDADAMORTIZADA = cantidadAmortizada, + IMPORTEPAGOESPECIE = importePagoEspecie, + SALDORESTANTE = saldoRestante + }; + + pr.AMORTIZACIONESPRESTAMOS.Add(amortizacion); + + // Pasar al siguiente mes + mesAmortizacion++; + + if (mesAmortizacion > 12) + { + mesAmortizacion = 1; + añoAmortizacion++; + } + } + } + catch (Exception ex) + { + // Gestionar el error + } + + + + } + } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ProductividadGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ProductividadGrid.razor index cbbf008..dd9e203 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ProductividadGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ProductividadGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ @context.AÑO @@ -51,6 +53,16 @@
+ +
+
+
+
+
+
+
+ +
@code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); @@ -58,16 +70,30 @@ [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + private Modal popupGestionDatos = default!; + private PRODUCTIVIDAD ItemEnEdicion { get; set; } = new(); protected override async Task OnInitializedAsync() { + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); try { var listnom = Persona.PRODUCTIVIDAD; - foreach (PRODUCTIVIDAD i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + protected override void OnParametersSet() + { + itmList = Persona.PRODUCTIVIDAD?.ToList() ?? new List(); + } + private async Task abrirPopupModificacion(PRODUCTIVIDAD objeto, bool esNuevo) { ItemEnEdicion = objeto; if (esNuevo) ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await popupGestionDatos.ShowAsync(); } + private async Task cerrarPopupModificacion() => await popupGestionDatos.HideAsync(); + private async Task GestionarDatos(bool esNuevo) + { + if (esNuevo) { ItemEnEdicion.IDPRODUCTIVIDAD = 0; ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; await Utilidades.NuevoObjeto(cliente, "/api/PRODUCTIVIDAD/", ItemEnEdicion); } + else await Utilidades.ActualizarObjeto(cliente, "/api/PRODUCTIVIDAD/" + ItemEnEdicion.IDPRODUCTIVIDAD, ItemEnEdicion); + await cerrarPopupModificacion(); await OnPersonaActualizada.InvokeAsync(); + } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PuestosTrabajoGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PuestosTrabajoGrid.razor index d87f246..ad0d6a5 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PuestosTrabajoGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/PuestosTrabajoGrid.razor @@ -33,7 +33,7 @@ - @context.IDTIPOPUESTOTRABAJONavigation.DESCRIPCION + @context.IDTIPOPUESTOTRABAJONavigation.DESCRIPCION @context.FECHAINICIO?.ToString("dd/MM/yyyy") diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ReduccionesJornadaGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ReduccionesJornadaGrid.razor index 8936955..58fa981 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ReduccionesJornadaGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/ReduccionesJornadaGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ + + + + @context.FECHAINICIO?.ToString("dd/MM/yyyy") @@ -44,23 +50,101 @@
+ + + + + + +
+ +
+ + +
+
+ + +
+
+ + +
+
+
+ + + @if (ItemEnEdicion.IDREDUCCIONDEJORNADA != 0) + { + + } + else + { + + } + +
+ + @code { + private Modal popupGestionDatos = default; + private REDUCCIONDEJORNADA ItemEnEdicion { get; set; } = new REDUCCIONDEJORNADA(); [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); private HttpClient cliente = new HttpClient(); [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.REDUCCIONDEJORNADA?.ToList() ?? new(); protected override async Task OnInitializedAsync() + { + + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); + + } + private async Task cerrarPopupModificacion() + { + await popupGestionDatos.HideAsync(); + } + private async Task abrirPopupModificacion(REDUCCIONDEJORNADA objeto, bool esNuevo) + { + ItemEnEdicion = objeto; + + await popupGestionDatos.ShowAsync(); + } + private async Task CargarListas() { try { var listnom = Persona.REDUCCIONDEJORNADA; - foreach (REDUCCIONDEJORNADA i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + private async Task GestionarDatos(bool tipo) + { + var inci = ItemEnEdicion; + if (tipo == true) + { + inci.IDREDUCCIONDEJORNADA = 0; + inci.IDPERSONA = Persona.IDPERSONA; + } + + if (inci.IDREDUCCIONDEJORNADA != 0) + { + var response = await Utilidades.ActualizarObjeto(cliente, "/api/REDUCCIONDEJORNADA/" + inci.IDREDUCCIONDEJORNADA, inci); + } + else + { + var response = await Utilidades.NuevoObjeto(cliente, "/api/REDUCCIONDEJORNADA/", inci); + } + await cerrarPopupModificacion(); + await CargarListas(); + + + } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/RetencionesJudicialesGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/RetencionesJudicialesGrid.razor index 20ee046..a38ca89 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/RetencionesJudicialesGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/RetencionesJudicialesGrid.razor @@ -1,20 +1,14 @@ -@using System.Net.Http.Headers -@using System.Linq.Expressions -@using Newtonsoft.Json -@using System.Text -@using Serialize.Linq.Serializers +@using Newtonsoft.Json @using GestionPersonalWeb.Models @using BlazorBootstrap @using bdAntifraude.db @using Microsoft.AspNetCore.Components @rendermode InteractiveServer -@inject IJSRuntime JS -@inject NavigationManager NavigationManager @inject IHttpClientFactory HttpClientFactory -@inject IHttpContextAccessor HttpContextAccessor @inject UserState UserState
+
- + + + + + @context.FECHAINICIO?.ToString("dd/MM/yyyy") @@ -56,30 +60,215 @@ @context.REFERENCIAFICHERO - @context.IDPLANTILLANavigation.DESCRIPCION + @context.IDPLANTILLANavigation?.DESCRIPCION -
+ + + +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+ +
+
+
+ + + + + + +
+ @code { [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); - private HttpClient cliente = new HttpClient(); + [Parameter] public EventCallback OnPersonaActualizada { get; set; } - private List itmList = new List(); - protected override async Task OnInitializedAsync() + + private Modal popupGestionDatos = default!; + private HttpClient cliente = default!; + + private List itmList = new(); + private RETENCIONJUDICIAL ItemEnEdicion { get; set; } = new(); + private RETENCIONJUDICIAL? itemOriginal; + + private bool guardando; + private string? mensajeError; + + protected override void OnInitialized() { + cliente = Utilidades.ObtenerCliente( + UserState.Token, + HttpClientFactory); + } + + protected override void OnParametersSet() + { + CargarListas(); + } + + private void CargarListas() + { + itmList = Persona.RETENCIONJUDICIAL?.ToList() + ?? new List(); + } + + private async Task abrirPopupModificacion(RETENCIONJUDICIAL objeto, bool esNuevo) + { + mensajeError = null; + itemOriginal = objeto; + + // Copia independiente: cerrar el modal no modifica la fila. + var json = JsonConvert.SerializeObject( + objeto, + new JsonSerializerSettings + { + ReferenceLoopHandling = ReferenceLoopHandling.Ignore + }); + + ItemEnEdicion = + JsonConvert.DeserializeObject(json) + ?? throw new InvalidOperationException( + "No se ha podido preparar la retención para editar."); + if (esNuevo) + ItemEnEdicion.IDPERSONA = Persona.IDPERSONA; + + await popupGestionDatos.ShowAsync(); + } + + private async Task cerrarPopupModificacion() + { + if (guardando) + return; + + await popupGestionDatos.HideAsync(); + mensajeError = null; + itemOriginal = null; + } + + private async Task GestionarDatos(bool esNuevo) + { + if (guardando || (!esNuevo && itemOriginal is null)) + return; + + mensajeError = null; + + if (ItemEnEdicion.FECHAINICIO.HasValue + && ItemEnEdicion.FECHAFIN.HasValue + && ItemEnEdicion.FECHAFIN.Value < ItemEnEdicion.FECHAINICIO.Value) + { + mensajeError = + "La fecha fin no puede ser anterior a la fecha inicio."; + return; + } + + guardando = true; + try { - var listnom = Persona.RETENCIONJUDICIAL; - foreach (RETENCIONJUDICIAL i in listnom) { itmList.Add(i); } + if (esNuevo) + await Utilidades.NuevoObjeto(cliente, "/api/RETENCIONJUDICIAL/", ItemEnEdicion); + else + await Utilidades.ActualizarObjeto(cliente, "/api/RETENCIONJUDICIAL/" + ItemEnEdicion.IDRETENCIONJUDICIAL, ItemEnEdicion); + + // Actualiza la fila y la colección de Persona tras guardar. + if (!esNuevo) + { + itemOriginal!.FECHAINICIO = ItemEnEdicion.FECHAINICIO; + itemOriginal.FECHAFIN = ItemEnEdicion.FECHAFIN; + itemOriginal.SALDOINICIO = ItemEnEdicion.SALDOINICIO; + itemOriginal.SALDORESTANTE = ItemEnEdicion.SALDORESTANTE; + itemOriginal.DESCRIPCION = ItemEnEdicion.DESCRIPCION; + itemOriginal.JUZGADO = ItemEnEdicion.JUZGADO; + itemOriginal.IBAN = ItemEnEdicion.IBAN; + itemOriginal.REFERENCIAFICHERO = ItemEnEdicion.REFERENCIAFICHERO; + } + + CargarListas(); } - catch (Exception e) + catch (Exception) { - Console.WriteLine($"Error al obtener los datos: {e.Message}"); + mensajeError = + "No se ha podido guardar la retención judicial."; + return; } + finally + { + guardando = false; + } + + await cerrarPopupModificacion(); + await OnPersonaActualizada.InvokeAsync(); } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/SexeniosQuinqueniosGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/SexeniosQuinqueniosGrid.razor index 4a8c94c..bfc5c83 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/SexeniosQuinqueniosGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/SexeniosQuinqueniosGrid.razor @@ -15,33 +15,34 @@ @inject UserState UserState
+
@* Numero Sexenio *@
- +
@* Sexenio *@
- +
@* Numero Quinquenio *@
- +
@* Quinquenio *@
- +
@* Quinquenio extra *@
- +
@@ -54,14 +55,25 @@ // private List itmList = new List<>(); protected override async Task OnInitializedAsync() { - // try - // { - // var listnom = Persona.TRABAJADORTIEMPOPARCIAL; - // foreach (TRABAJADORTIEMPOPARCIAL i in listnom) { itmList.Add(i); } - // } - // catch (Exception e) - // { - // Console.WriteLine($"Error al obtener los datos: {e.Message}"); - // } + + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); } + private async Task GestionarDatos() + { + + var personaGuardar = Persona; + personaGuardar.NOMINATRABAJADORCABECERA = null; + var responsea = await Utilidades.ActualizarObjeto(cliente, "/api/PERSONAS/" + personaGuardar.IDPERSONA, personaGuardar); + var url = NavigationManager.ToAbsoluteUri(NavigationManager.Uri); + var response = await cliente.GetAsync($"/api/PERSONAS/PersonaNominaNif/{Persona.NIF}"); + if (!response.IsSuccessStatusCode) + { + throw new Exception($"Error al obtener los datos de la persona. Código: {response.StatusCode}"); + } + + var resultContent = await response.Content.ReadAsStringAsync(); + Persona = JsonConvert.DeserializeObject(resultContent) ?? throw new Exception("Error al deserializar los datos de la persona."); + + } + } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrabajadoresTiempoParcialGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrabajadoresTiempoParcialGrid.razor index c3f5349..3db12cb 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrabajadoresTiempoParcialGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrabajadoresTiempoParcialGrid.razor @@ -15,6 +15,7 @@ @inject UserState UserState
+
+ + + + + @context.FECHAINICIO?.ToString("dd/MM/yyyy") @@ -44,23 +50,98 @@
+ + + + + +
+ +
+ + +
+
+ + +
+
+ + +
+
+
+ + + @if (ItemEnEdicion.IDTRABAJADORTIEMPOPARCIAL != 0) + { + + } + else + { + + } + +
+ + @code { + private Modal popupGestionDatos = default; + private TRABAJADORTIEMPOPARCIAL ItemEnEdicion { get; set; } = new TRABAJADORTIEMPOPARCIAL(); [Parameter] public PERSONAS Persona { get; set; } = new PERSONAS(); private HttpClient cliente = new HttpClient(); [Parameter] public EventCallback OnPersonaActualizada { get; set; } private List itmList = new List(); + protected override void OnParametersSet() => itmList = Persona.TRABAJADORTIEMPOPARCIAL?.ToList() ?? new(); protected override async Task OnInitializedAsync() { - try + + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + await CargarListas(); + await OnPersonaActualizada.InvokeAsync(); + + + } + private async Task CargarListas() + { + try { var listnom = Persona.TRABAJADORTIEMPOPARCIAL; - foreach (TRABAJADORTIEMPOPARCIAL i in listnom) { itmList.Add(i); } } catch (Exception e) { Console.WriteLine($"Error al obtener los datos: {e.Message}"); } } + private async Task cerrarPopupModificacion() + { + await popupGestionDatos.HideAsync(); + } + private async Task abrirPopupModificacion(TRABAJADORTIEMPOPARCIAL objeto, bool esNuevo) + { + ItemEnEdicion = objeto; + + await popupGestionDatos.ShowAsync(); + } + private async Task GestionarDatos(bool tipo) + { + var inci = ItemEnEdicion; + if (tipo == true) + { + inci.IDTRABAJADORTIEMPOPARCIAL = 0; + inci.IDPERSONA = Persona.IDPERSONA; + } + + if (inci.IDTRABAJADORTIEMPOPARCIAL != 0) + { + var response = await Utilidades.ActualizarObjeto(cliente, "/api/TRABAJADORTIEMPOPARCIAL/" + inci.IDTRABAJADORTIEMPOPARCIAL, inci); + } + else + { + var response = await Utilidades.NuevoObjeto(cliente, "/api/TRABAJADORTIEMPOPARCIAL/", inci); + } + await cerrarPopupModificacion(); +} } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrieniosCarreraGrid.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrieniosCarreraGrid.razor index 5f444e8..417e294 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrieniosCarreraGrid.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/InfoPersComponents/TrieniosCarreraGrid.razor @@ -15,136 +15,137 @@ @inject UserState UserState
+

Trienios cumplidos en la Administración Económicamente

- +
- +
- +
- +
- +
- +
- +
- +

Trienios cumplidos en la Administración Administrativamente

- +
- +
- +
- +
- +
- +
- +
- +

Trienios cumplidos en la OficinaAntifraude

- +
- +
- +
- +
- +
- +
- +

Complementos de Carrera cumplidos en la OficinaAntifraude

- +
- +
- +
- +
- +
- +
- +
@@ -155,4 +156,28 @@ private HttpClient cliente = new HttpClient(); [Parameter] public EventCallback OnPersonaActualizada { get; set; } + + + protected override async Task OnInitializedAsync() + { + + cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory); + } + private async Task GestionarDatos() + { + + var personaGuardar = Persona; + personaGuardar.NOMINATRABAJADORCABECERA = null; + var responsea = await Utilidades.ActualizarObjeto(cliente, "/api/PERSONAS/" + personaGuardar.IDPERSONA, personaGuardar); + var url = NavigationManager.ToAbsoluteUri(NavigationManager.Uri); + var response = await cliente.GetAsync($"/api/PERSONAS/PersonaNominaNif/{Persona.NIF}"); + if (!response.IsSuccessStatusCode) + { + throw new Exception($"Error al obtener los datos de la persona. Código: {response.StatusCode}"); + } + + var resultContent = await response.Content.ReadAsStringAsync(); + Persona = JsonConvert.DeserializeObject(resultContent) ?? throw new Exception("Error al deserializar los datos de la persona."); + + } } diff --git a/Antifraude.Net/GestionPersonalWeb/Components/Pages/NominaPersona.razor b/Antifraude.Net/GestionPersonalWeb/Components/Pages/NominaPersona.razor index e6a56db..1065b3e 100644 --- a/Antifraude.Net/GestionPersonalWeb/Components/Pages/NominaPersona.razor +++ b/Antifraude.Net/GestionPersonalWeb/Components/Pages/NominaPersona.razor @@ -638,10 +638,6 @@ messageStore = new ValidationMessageStore(editContext); listaIdentificadores.Clear(); } - - - - private async Task abrirGuardar() { await popupConfirmacion.ShowAsync(); diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/ASCENDIENTESController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/ASCENDIENTESController.cs new file mode 100644 index 0000000..c60e2a6 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/ASCENDIENTESController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class ASCENDIENTESController : GenericoController + { + public ASCENDIENTESController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/CONCEPTOSPUESTOSDETRABAJOController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/CONCEPTOSPUESTOSDETRABAJOController.cs new file mode 100644 index 0000000..e0e4ddd --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/CONCEPTOSPUESTOSDETRABAJOController.cs @@ -0,0 +1,70 @@ +using bdAntifraude.db; +using bdAntifraude.dbcontext; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.EntityFrameworkCore; +using Serialize.Linq.Serializers; +using System.Linq.Expressions; +using SwaggerAntifraude.Controllers; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class CONCEPTOSPUESTOSDETRABAJOController : GenericoController + { + public CONCEPTOSPUESTOSDETRABAJOController() + : base() + { + } + + [HttpGet] + public override async Task GetAll() + { + try + { + using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false)) + { + var entities = await context.CONCEPTOSPUESTOSDETRABAJO + //.Include(x => x.IDTIPOPERSONANavigation) + .AsNoTracking() + .ToListAsync(); + return Ok(entities); + } + } + catch (Exception ex) + { + return StatusCode(500, $"Error interno del servidor: {ex.Message}"); + } + } + + [Authorize(Policy = "LecturaPolicy")] + [HttpGet("{id}")] + public override IActionResult GetById(int id) + { + try + { + using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false)) + { + //var dbSet = context.Set(); + var entities = context.CONCEPTOSPUESTOSDETRABAJO + .AsNoTracking() + .FirstOrDefault(v => v.IDCONCEPTOSPUESTOSDETRABAJO == id); + + + + if (entities == null) + return NotFound(); + + return Ok(entities); + } + } + catch (Exception ex) + { + return StatusCode(500, $"Error interno del servidor: {ex.Message}"); + } + } + + + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/DIFERENCIATRIENIOSController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/DIFERENCIATRIENIOSController.cs new file mode 100644 index 0000000..5bd7144 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/DIFERENCIATRIENIOSController.cs @@ -0,0 +1,15 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class DIFERENCIATRIENIOSController : GenericoController + { + public DIFERENCIATRIENIOSController() + : base() + { + } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/EXPEDIENTESPERSONASController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/EXPEDIENTESPERSONASController.cs new file mode 100644 index 0000000..2151891 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/EXPEDIENTESPERSONASController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class EXPEDIENTESPERSONASController : GenericoController + { + public EXPEDIENTESPERSONASController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/HIJOSController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/HIJOSController.cs new file mode 100644 index 0000000..2d02a38 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/HIJOSController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class HIJOSController : GenericoController + { + public HIJOSController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/HISTORICOIRPFController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/HISTORICOIRPFController.cs new file mode 100644 index 0000000..7530bea --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/HISTORICOIRPFController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class HISTORICOIRPFController : GenericoController + { + public HISTORICOIRPFController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/OTRASRETRIBUCIONESController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/OTRASRETRIBUCIONESController.cs new file mode 100644 index 0000000..91cc8f9 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/OTRASRETRIBUCIONESController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class OTRASRETRIBUCIONESController : GenericoController + { + public OTRASRETRIBUCIONESController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/PRESTAMOSController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/PRESTAMOSController.cs new file mode 100644 index 0000000..cd4bc2b --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/PRESTAMOSController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class PRESTAMOSController : GenericoController + { + public PRESTAMOSController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/PRODUCTIVIDADController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/PRODUCTIVIDADController.cs new file mode 100644 index 0000000..24af247 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/PRODUCTIVIDADController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class PRODUCTIVIDADController : GenericoController + { + public PRODUCTIVIDADController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/PUESTOSTRABAJOController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/PUESTOSTRABAJOController.cs new file mode 100644 index 0000000..e2b82df --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/PUESTOSTRABAJOController.cs @@ -0,0 +1,113 @@ +using bdAntifraude.db; +using bdAntifraude.dbcontext; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Authorization; +using Microsoft.EntityFrameworkCore; +using Serialize.Linq.Serializers; +using System.Linq.Expressions; +using SwaggerAntifraude.Controllers; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class PUESTOSTRABAJOController : GenericoController + { + public PUESTOSTRABAJOController() + : base() + { + } + + + [HttpGet] + public override async Task GetAll() + { + try + { + using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false)) + { + var entities = await context.PUESTOSTRABAJO + .Include(x => x.IDTIPOPUESTOTRABAJONavigation) + .Include(x => x.CONCEPTOSPUESTOSDETRABAJO) + .AsNoTracking() + .ToListAsync(); + //.Include(v => v.IDSERVICIOADSCRITONavigation) + //.Include(v => v.IDUNIDADADMINISTRATIVANavigation) + return Ok(entities); + } + } + catch (Exception ex) + { + return StatusCode(500, $"Error interno del servidor: {ex.Message}"); + } + } + + [Authorize(Policy = "LecturaPolicy")] + [HttpGet("{id}")] + public override IActionResult GetById(int id) + { + try + { + using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false)) + { + //var dbSet = context.Set(); + var entities = context.PUESTOSTRABAJO + .Include(x => x.IDTIPOPUESTOTRABAJONavigation) + .Include(x => x.CONCEPTOSPUESTOSDETRABAJO) + .AsNoTracking() + .FirstOrDefault(v => v.IDPUESTOSTRABAJO == id); + + + + if (entities == null) + return NotFound(); + + return Ok(entities); + } + } + catch (Exception ex) + { + return StatusCode(500, $"Error interno del servidor: {ex.Message}"); + } + } + + + [Authorize(Policy = "LecturaPolicy")] + [HttpPost("filtrar")] // Cambié a POST ya que estás usando [FromBody] + public override async Task Filtrar([FromBody] ExpressionWrapper request) + { + try + { + using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false)) + { + // Crear el deserializador + var serializer = new ExpressionSerializer(new Serialize.Linq.Serializers.JsonSerializer()); + + // Deserializar la expresión + var deserializedExpression = serializer.DeserializeText(request.Expression) as Expression>; + if (deserializedExpression == null) + { + return BadRequest("La expresión deserializada es nula o incorrecta."); + } + var entities = await context.PUESTOSTRABAJO.Where(deserializedExpression) + .Include(x => x.IDTIPOPUESTOTRABAJONavigation) + .Include(x => x.CONCEPTOSPUESTOSDETRABAJO) + .AsNoTracking() + .ToListAsync(); + + // Verificar si el resultado es vacío + if (entities.Count == 0) + { + Console.WriteLine("La consulta no devolvió resultados."); + } + + return Ok(entities); + } + } + catch (Exception ex) + { + return StatusCode(500, $"Error interno del servidor: {ex.Message}"); + } + } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/REDUCCIONDEJORNADAController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/REDUCCIONDEJORNADAController.cs new file mode 100644 index 0000000..6136c83 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/REDUCCIONDEJORNADAController.cs @@ -0,0 +1,15 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class REDUCCIONDEJORNADAController : GenericoController + { + public REDUCCIONDEJORNADAController() + : base() + { + } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/RETENCIONJUDICIALController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/RETENCIONJUDICIALController.cs new file mode 100644 index 0000000..b32c37a --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/RETENCIONJUDICIALController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class RETENCIONJUDICIALController : GenericoController + { + public RETENCIONJUDICIALController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/SITUACIONACTUALIRPFController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/SITUACIONACTUALIRPFController.cs new file mode 100644 index 0000000..61bd719 --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/SITUACIONACTUALIRPFController.cs @@ -0,0 +1,12 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class SITUACIONACTUALIRPFController : GenericoController + { + public SITUACIONACTUALIRPFController() : base() { } + } +} diff --git a/Antifraude.Net/SwaggerAntifraude/Controllers/TRABAJADORTIEMPOPARCIALController.cs b/Antifraude.Net/SwaggerAntifraude/Controllers/TRABAJADORTIEMPOPARCIALController.cs new file mode 100644 index 0000000..2f3efbc --- /dev/null +++ b/Antifraude.Net/SwaggerAntifraude/Controllers/TRABAJADORTIEMPOPARCIALController.cs @@ -0,0 +1,15 @@ +using bdAntifraude.db; +using Microsoft.AspNetCore.Mvc; + +namespace SwaggerAntifraude.Controllers +{ + [ApiController] + [Route("api/[controller]")] + public class TRABAJADORTIEMPOPARCIALController : GenericoController + { + public TRABAJADORTIEMPOPARCIALController() + : base() + { + } + } +}