arreglos registroPersonal

This commit is contained in:
2026-04-17 13:26:15 +02:00
parent 95fa241611
commit 3b77fc827d
6 changed files with 143 additions and 24 deletions

View File

@@ -26,6 +26,18 @@
@* <EditForm EditContext="@editContext"> @* <EditForm EditContext="@editContext">
<DataAnnotationsValidator /> *@ <DataAnnotationsValidator /> *@
<Modal @ref="popupConfirmacion" Title="Confirmar Guardar persona" IsVerticallyCentered="true" UseStaticBackdrop="true" CloseOnEscape="false">
<BodyTemplate>
<p>Se van a dar de alta o modificar datos de la persona seleccionada ¿desea continuar?</p>
</BodyTemplate>
<FooterTemplate>
<Button Color="ButtonColor.Secondary" @onclick="CerrarConfirmacion">Cancelar</Button>
<Button @onclick="GuardarPersona" Color="ButtonColor.Primary">Aceptar</Button>
</FooterTemplate>
</Modal>
<div class="datos-personales-container mt-3"> <div class="datos-personales-container mt-3">
<div> <div>
<div> <div>
@@ -352,10 +364,96 @@
private List<ENUMERACIONES> lOcupacion = new List<ENUMERACIONES>(); private List<ENUMERACIONES> lOcupacion = new List<ENUMERACIONES>();
private List<ENUMERACIONES> lSexo = new List<ENUMERACIONES>(); private List<ENUMERACIONES> lSexo = new List<ENUMERACIONES>();
private Tabs tabsDtsPer { get; set; } = new Tabs(); private Tabs tabsDtsPer { get; set; } = new Tabs();
private Modal popupConfirmacion = default!;
List<ToastMessage> mensajes = new List<ToastMessage>();
private async Task GuardarPersona() private async Task GuardarPersona()
{ {
CerrarConfirmacion();
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
// ValidarTodos();
if (!editContext.GetValidationMessages().Any())
{
persona.AÑOCAMBIORESIDENCIA = 0;
//Te quedaste en que tienes que coger la foto del navigation y guardarla (Por cierto el nuevo no aparece en la lista)
if (persona.IDFICHEROFOTONavigation != null)
{
FICHEROS fi = persona.IDFICHEROFOTONavigation;
if (persona.IDFICHEROFOTO != null)
{
var responsef = await Utilidades.ActualizarObjeto(cliente, "/api/FICHEROS/" + fi.IDFICHERO, fi);
persona.IDFICHEROFOTO = responsef.IDFICHERO;
}
else
{
var responsef = await Utilidades.NuevoObjeto(cliente, "/api/FICHEROS", fi);
persona.IDFICHEROFOTO = responsef.IDFICHERO;
}
}
if (persona.IDPERSONA == 0)//Nuevo
{
var response = await Utilidades.NuevoObjeto(cliente, "/api/PERSONAS", persona);
string link = "/InfoPers?cl=" + tsUtilidades.crypt.FEncS(response.NIF, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*", 875421649);
NavigationManager.NavigateTo(link, forceLoad: true);
}
else//Actualizar
{
var responsea = await Utilidades.ActualizarObjeto(cliente, "/api/PERSONAS/" + persona.IDPERSONA, persona);
var url = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
if (QueryHelpers.ParseQuery(url.Query).TryGetValue("cl", out var clValue)) { cl = clValue; }
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
string nifDesencriptado = tsUtilidades.crypt.FEncS(cl,
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
-875421649);
var response = await cliente.GetAsync($"/api/PERSONAS/PersonaNominaNif/{nifDesencriptado}");
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<PERSONAS>(resultContent) ?? throw new Exception("Error al deserializar los datos de la persona.");
mensajes.Add(new ToastMessage
{
Type = ToastType.Primary,
Message = $"Guardado correctamente.",
});
}
}
else
{
var html = "";
html += "Revise los errores antes de guardar:";
foreach (string m in editContext.GetValidationMessages())
{
html += "\n" + m + ". ";
}
mensajes.Add(new ToastMessage
{
Type = ToastType.Danger,
Message = html,
});
}
}
private async Task CerrarConfirmacion()
{
await popupConfirmacion.HideAsync();
}
private async Task abrirGuardar()
{
await popupConfirmacion.ShowAsync();
} }
private async Task OnTabShownAsync(TabsEventArgs args) private async Task OnTabShownAsync(TabsEventArgs args)
{ {

View File

@@ -14,7 +14,7 @@
<link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" /> <link href="_content/Blazor.Bootstrap/blazor.bootstrap.css" rel="stylesheet" />
<link href="_content/Blazor.Bootstrap/Blazor.Bootstrap.bundle.scp.css" rel="stylesheet" /> <link href="_content/Blazor.Bootstrap/Blazor.Bootstrap.bundle.scp.css" rel="stylesheet" />
<link rel="icon" type="image/x-icon" href="Content/imagenes/faviconParlamento.ico" /> <link rel="icon" type="image/x-icon" href="Content/imagenes/faviconParlamento.ico" />
<link href="Content/Site.css?v=0.4" rel="stylesheet" /> <link href="Content/Site.css?v=0.5" rel="stylesheet" />
<link href="Content/all.min.css" rel="stylesheet" /> <link href="Content/all.min.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<script src="Scripts/jquery.min.js"></script> <script src="Scripts/jquery.min.js"></script>

View File

@@ -163,7 +163,7 @@
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="lblInput" for="fecha-alta">cuenta bancaria:</label> <label class="lblInput" for="fecha-alta">cuenta bancaria:</label>
<input type="text" class="form-control" @bind-value="Persona.CUENTABANCARIA" /> <input type="text" class="form-control" @bind-value="Persona.CUENTABANCARIA" @oninput="QuitarEspacios" />
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="lblInput" for="causa-baja"> Porcentaje de pluriempleo:</label> <label class="lblInput" for="causa-baja"> Porcentaje de pluriempleo:</label>
@@ -295,6 +295,7 @@
private List<COMPLEMENTOSCARRERA> listadoComCar = new List<COMPLEMENTOSCARRERA>(); private List<COMPLEMENTOSCARRERA> listadoComCar = new List<COMPLEMENTOSCARRERA>();
private List<ENUMERACIONES> listadotramos = new List<ENUMERACIONES>(); private List<ENUMERACIONES> listadotramos = new List<ENUMERACIONES>();
private int? IDTRAMOCOMCAR { get; set; } private int? IDTRAMOCOMCAR { get; set; }
private string? inputCuentaBancaria { get; set; }
private DateTime? FECHACOMCAR { get; set; } private DateTime? FECHACOMCAR { get; set; }
private List<ENUMERACIONES> listadoCausaBaja = new List<ENUMERACIONES>(); private List<ENUMERACIONES> listadoCausaBaja = new List<ENUMERACIONES>();
private List<ENUMERACIONES> listadoMutua = new List<ENUMERACIONES>(); private List<ENUMERACIONES> listadoMutua = new List<ENUMERACIONES>();
@@ -311,7 +312,11 @@
StateHasChanged(); StateHasChanged();
} }
private void QuitarEspacios(ChangeEventArgs e)
{
Persona.CUENTABANCARIA = e.Value?.ToString().Replace(" ", "");
StateHasChanged();
}
private async Task CargarCompCar() private async Task CargarCompCar()
{ {

View File

@@ -30,7 +30,7 @@
} }
@if (mostrarMensajeCuerpo == true) @if (mostrarMensajeCuerpo == true)
{ {
<div class="loadingFrame"> <div class="loadingFrameVida">
<div class="popupRPCard row"> <div class="popupRPCard row">
<p>No es posible editar vidas administrativas si la persona no tiene un cuerpo asignado</p> <p>No es posible editar vidas administrativas si la persona no tiene un cuerpo asignado</p>
<input type="button" value="Continuar" @onclick="OcultarMenCuer" /> <input type="button" value="Continuar" @onclick="OcultarMenCuer" />
@@ -39,7 +39,7 @@
} }
@if (mostrarMensajeEliminar == true) @if (mostrarMensajeEliminar == true)
{ {
<div class="loadingFrame"> <div class="loadingFrameVida">
<div class="popupRPCard row"> <div class="popupRPCard row">
<p>¿Esta seguro de eliminar esta vida administrativa?</p> <p>¿Esta seguro de eliminar esta vida administrativa?</p>
<div class="col-12 d-flex gap-2 justify-content-end"> <div class="col-12 d-flex gap-2 justify-content-end">
@@ -51,7 +51,7 @@
} }
@if (mostrarAnadirLineaVida == true) @if (mostrarAnadirLineaVida == true)
{ {
<div class="loadingFrame"> <div class="loadingFrameVida">
<div class="popupRPCard row"> <div class="popupRPCard row">
<div class="col-12 formatoCampos"> <label class="tituloLbl">Descripción:</label><InputText @bind-Value="DESCRIPCIONLINEAVIDA" class="inputForm" /></div> <div class="col-12 formatoCampos"> <label class="tituloLbl">Descripción:</label><InputText @bind-Value="DESCRIPCIONLINEAVIDA" class="inputForm" /></div>
<div class="col-6 formatoCampos"> <div class="col-6 formatoCampos">
@@ -75,7 +75,7 @@
} }
@if (mostrarEditarLineaVida == true) @if (mostrarEditarLineaVida == true)
{ {
<div class="loadingFrame"> <div class="loadingFrameVida">
<div class="popupRPCard row"> <div class="popupRPCard row">
<div class="col-12 formatoCampos"> <label class="tituloLbl">Descripción:</label><InputText @bind-Value="DESCRIPCIONLINEAVIDAED" class="inputForm" /></div> <div class="col-12 formatoCampos"> <label class="tituloLbl">Descripción:</label><InputText @bind-Value="DESCRIPCIONLINEAVIDAED" class="inputForm" /></div>
<div class="col-6 formatoCampos"> <div class="col-6 formatoCampos">
@@ -928,6 +928,9 @@
} }
protected async void AnadirLineaVida() protected async void AnadirLineaVida()
{ {
mostrar = true;
await Task.Delay(1);
LINEASVIDAADMINISTRATIVA VA = new LINEASVIDAADMINISTRATIVA(); LINEASVIDAADMINISTRATIVA VA = new LINEASVIDAADMINISTRATIVA();
VA.IDTIPO = IDTIPODOCU; VA.IDTIPO = IDTIPODOCU;
VA.FECHASUBIDA = DateTime.Now; VA.FECHASUBIDA = DateTime.Now;
@@ -1074,6 +1077,7 @@
cargarGridLineas(); cargarGridLineas();
cerrarAnadirLineaVida(); cerrarAnadirLineaVida();
mostrar = false;
StateHasChanged(); StateHasChanged();
} }

View File

@@ -582,6 +582,18 @@ body {
border-bottom: 3px solid var(--AzulMuyOscuro) !important; border-bottom: 3px solid var(--AzulMuyOscuro) !important;
} }
.loadingFrame { .loadingFrame {
display: flex;
background-color: #000000e5;
position: fixed;
left: 0;
top: 0;
z-index: 1000;
justify-content: center;
align-items: center;
width: 100%;
height: 100vh;
}
.loadingFrameVida {
display: flex; display: flex;
background-color: #000000e5; background-color: #000000e5;
position: fixed; position: fixed;
@@ -593,14 +605,14 @@ body {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
} }
.loadingDiv{ .loadingDiv {
padding:20px; padding: 20px;
border-radius:5px; border-radius: 5px;
background-color:white; background-color: white;
display:flex; display: flex;
justify-content:center; justify-content: center;
align-items:center; align-items: center;
} }
.loadingImg { .loadingImg {
background-image: url(imagenes/cargaOAAF.gif); background-image: url(imagenes/cargaOAAF.gif);
width: 80px; width: 80px;

View File

@@ -5,15 +5,15 @@
"Audience": "TuDominio.com", "Audience": "TuDominio.com",
"ExpiresInMinutes": 60 "ExpiresInMinutes": 60
}, },
//"ConnectionStrings": {
// "WriteConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDEDESARROLLO",
// "ReadOnlyConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDEDESARROLLO"
//},
//PRODUCCION
"ConnectionStrings": { "ConnectionStrings": {
"WriteConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDE", "WriteConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDEDESARROLLO",
"ReadOnlyConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDE" "ReadOnlyConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDEDESARROLLO"
}, },
//PRODUCCION
//"ConnectionStrings": {
// "WriteConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDE",
// "ReadOnlyConnection": "DATA SOURCE=192.168.41.203:21521/XE;PASSWORD=antifraude2022;PERSIST SECURITY INFO=True;USER ID=ANTIFRAUDE"
//},
"Logging": { "Logging": {
"LogLevel": { "LogLevel": {
"Default": "Information", "Default": "Information",