Merge branch 'main' of https://gitea.tecnosis.net/Antifraude/Antifraude.Net
This commit is contained in:
@@ -92,7 +92,7 @@
|
|||||||
<nav class="navbar navbar-expand navbar-dark justify-content-between " style="margin-inline: 20px;">
|
<nav class="navbar navbar-expand navbar-dark justify-content-between " style="margin-inline: 20px;">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a class="navbar-brand" href="/RPT">
|
<a class="navbar-brand" href="/trabajadores">
|
||||||
<img style="margin-inline: auto; padding: 15px; padding-right: 40px; padding-left: 40px; height: 100px;" src="/Content/imagenes/2-oaaf-logo-negativoBN.png" alt="Logo Oficina Andaluza Antifraude">
|
<img style="margin-inline: auto; padding: 15px; padding-right: 40px; padding-left: 40px; height: 100px;" src="/Content/imagenes/2-oaaf-logo-negativoBN.png" alt="Logo Oficina Andaluza Antifraude">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -404,7 +404,9 @@
|
|||||||
}
|
}
|
||||||
else//Actualizar
|
else//Actualizar
|
||||||
{
|
{
|
||||||
var responsea = await Utilidades.ActualizarObjeto(cliente, "/api/PERSONAS/" + persona.IDPERSONA, persona);
|
var personaGuardar = persona;
|
||||||
|
personaGuardar.NOMINATRABAJADORCABECERA = null;
|
||||||
|
var responsea = await Utilidades.ActualizarObjeto(cliente, "/api/PERSONAS/" + personaGuardar.IDPERSONA, personaGuardar);
|
||||||
var url = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
|
var url = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
|
||||||
if (QueryHelpers.ParseQuery(url.Query).TryGetValue("cl", out var clValue)) { cl = clValue; }
|
if (QueryHelpers.ParseQuery(url.Query).TryGetValue("cl", out var clValue)) { cl = clValue; }
|
||||||
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
|
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
|
||||||
|
|||||||
@@ -22,19 +22,19 @@
|
|||||||
<div class="row mb-3 mt-4" style=" padding: 20px;border:solid 1px grey">
|
<div class="row mb-3 mt-4" style=" padding: 20px;border:solid 1px grey">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label for="txtApellidos" class="fw-bold widthLabel li-height50">Apellidos: </label>
|
<label for="txtApellidos" class="fw-bold widthLabel li-height50">Apellidos: </label>
|
||||||
<input class="form-control" id="txtApellidos" @bind-value="@Persona.APELLIDOS" />
|
<input class="form-control" readonly="readonly" id="txtApellidos" @bind-value="@Persona.APELLIDOS" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<label for="txtNombre" class="fw-bold widthLabel li-height50">Nombre: </label>
|
<label for="txtNombre" class="fw-bold widthLabel li-height50">Nombre: </label>
|
||||||
<input class="form-control" id="txtNombre" @bind-value="@Persona.NOMBRE" />
|
<input class="form-control" readonly="readonly" id="txtNombre" @bind-value="@Persona.NOMBRE" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label for="txtNIF" class="fw-bold widthLabel li-height50">DNI: </label>
|
<label for="txtNIF" class="fw-bold widthLabel li-height50">DNI: </label>
|
||||||
<input class="form-control" id="txtNIF" @bind-value="@Persona.NIF" />
|
<input class="form-control" readonly="readonly" id="txtNIF" @bind-value="@Persona.NIF" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label for="txtsexo" class="fw-bold widthLabel li-height50">Sexo: </label>
|
<label for="txtsexo" class="fw-bold widthLabel li-height50">Sexo: </label>
|
||||||
<InputSelect @bind-Value="Persona.IDSEXO" class="form-select">
|
<InputSelect readonly="readonly" @bind-Value="Persona.IDSEXO" class="form-select">
|
||||||
<option value="">Seleccionar</option>
|
<option value="">Seleccionar</option>
|
||||||
@if (lSexo != null)
|
@if (lSexo != null)
|
||||||
{
|
{
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label for="txtTiCont" class="fw-bold widthLabel li-height50">Tipo Contrato: </label>
|
<label for="txtTiCont" class="fw-bold widthLabel li-height50">Tipo Contrato: </label>
|
||||||
<InputSelect @bind-Value="Persona.IDCONTRATO" class="form-select">
|
<InputSelect readonly="readonly" @bind-Value="Persona.IDCONTRATO" class="form-select">
|
||||||
<option value="">Seleccionar</option>
|
<option value="">Seleccionar</option>
|
||||||
@if (lTipoContra != null)
|
@if (lTipoContra != null)
|
||||||
{
|
{
|
||||||
@@ -60,6 +60,20 @@
|
|||||||
@* <input class="form-control" id="txtTiCont" value="@persona.IDCONTRATONavigation?.DESCRIPCION" /> *@
|
@* <input class="form-control" id="txtTiCont" value="@persona.IDCONTRATONavigation?.DESCRIPCION" /> *@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="button" value="Guardar Nómina" class="btnOAAFAzul" @onclick="GuardarNomina" />
|
||||||
|
|
||||||
|
<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="GuardarNomina" Color="ButtonColor.Primary">Aceptar</Button>
|
||||||
|
|
||||||
|
</FooterTemplate>
|
||||||
|
</Modal>
|
||||||
|
<Toasts class="p-3 font-weight-bold" Style="color:white;" AutoHide="true" Delay="4000" Messages="mensajes" Placement="ToastsPlacement.BottomCenter" />
|
||||||
<div>
|
<div>
|
||||||
<Tabs @ref=tabsDtsPer style="margin-top:25px; font-size:12px; gap:0;" OnShown="@(args => OnTabShownAsync(args))">
|
<Tabs @ref=tabsDtsPer style="margin-top:25px; font-size:12px; gap:0;" OnShown="@(args => OnTabShownAsync(args))">
|
||||||
<Tab Title="Nómina" Name="tabNomina">
|
<Tab Title="Nómina" Name="tabNomina">
|
||||||
@@ -125,11 +139,11 @@
|
|||||||
<label for="txtFecha" class="fw-bold widthLabel li-height50">Valor Sindicato 1: </label>
|
<label for="txtFecha" class="fw-bold widthLabel li-height50">Valor Sindicato 1: </label>
|
||||||
@if (Nomina.IDSINDICATO1Navigation != null)
|
@if (Nomina.IDSINDICATO1Navigation != null)
|
||||||
{
|
{
|
||||||
<input class="form-control" id="txtFecha" @bind-value="@Nomina.IDSINDICATO1Navigation.VALORNUMERICO1" />
|
<input class="form-control" id="txtFecha" readonly="readonly" @bind-value="@Nomina.IDSINDICATO1Navigation.VALORNUMERICO1" />
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<input class="form-control" />
|
<input class="form-control" />
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
@@ -149,7 +163,7 @@
|
|||||||
<label for="txtFecha" class="fw-bold widthLabel li-height50">Valor Sindicato 2: </label>
|
<label for="txtFecha" class="fw-bold widthLabel li-height50">Valor Sindicato 2: </label>
|
||||||
@if (Nomina.IDSINDICATO2Navigation != null)
|
@if (Nomina.IDSINDICATO2Navigation != null)
|
||||||
{
|
{
|
||||||
<input class="form-control" id="txtFecha" @bind-value="@Nomina.IDSINDICATO2Navigation.VALORNUMERICO1" />
|
<input class="form-control" id="txtFecha" readonly="readonly" @bind-value="@Nomina.IDSINDICATO2Navigation.VALORNUMERICO1" />
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -591,7 +605,7 @@
|
|||||||
@code {
|
@code {
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public PERSONAS Persona { get; set; } = new PERSONAS();
|
public PERSONAS Persona { get; set; } = new PERSONAS();
|
||||||
public NOMINATRABAJADORCABECERA Nomina { get; set; } = new NOMINATRABAJADORCABECERA();
|
public static NOMINATRABAJADORCABECERA Nomina { get; set; } = new NOMINATRABAJADORCABECERA();
|
||||||
private HttpClient cliente = new HttpClient();
|
private HttpClient cliente = new HttpClient();
|
||||||
[Parameter]
|
[Parameter]
|
||||||
public EventCallback OnPersonaActualizada { get; set; }
|
public EventCallback OnPersonaActualizada { get; set; }
|
||||||
@@ -605,10 +619,23 @@
|
|||||||
private List<PERIODOSSILTRA> lSiltra= new List<PERIODOSSILTRA>();
|
private List<PERIODOSSILTRA> lSiltra= new List<PERIODOSSILTRA>();
|
||||||
private ValidationMessageStore? messageStore;
|
private ValidationMessageStore? messageStore;
|
||||||
private string errorMessage = "";
|
private string errorMessage = "";
|
||||||
|
public string nifDesencriptado { get; set; }
|
||||||
|
public int NominaDesencriptada { get; set; }
|
||||||
public string? cl { get; set; } = "";
|
public string? cl { get; set; } = "";
|
||||||
public string? cn { get; set; } = "";
|
public string? cn { get; set; } = "";
|
||||||
private Tabs tabsDtsPer { get; set; } = new Tabs();
|
private Tabs tabsDtsPer { get; set; } = new Tabs();
|
||||||
private Tabs tabsDtsNom { get; set; } = new Tabs();
|
private Tabs tabsDtsNom { get; set; } = new Tabs();
|
||||||
|
private Modal popupConfirmacion = default!;
|
||||||
|
List<ToastMessage> mensajes = new List<ToastMessage>();
|
||||||
|
private EditContext editContext = new EditContext(Nomina);
|
||||||
|
private async Task abrirGuardar()
|
||||||
|
{
|
||||||
|
await popupConfirmacion.ShowAsync();
|
||||||
|
}
|
||||||
|
private async Task CerrarConfirmacion()
|
||||||
|
{
|
||||||
|
await popupConfirmacion.HideAsync();
|
||||||
|
}
|
||||||
private async Task OnTabShownAsync(TabsEventArgs args)
|
private async Task OnTabShownAsync(TabsEventArgs args)
|
||||||
{
|
{
|
||||||
var panelActivo = args.ActiveTabName;
|
var panelActivo = args.ActiveTabName;
|
||||||
@@ -626,21 +653,16 @@
|
|||||||
{
|
{
|
||||||
cl = clValue;
|
cl = clValue;
|
||||||
}
|
}
|
||||||
// if (QueryHelpers.ParseQuery(url.Query).TryGetValue("cn", out var cnValue))
|
|
||||||
// {
|
|
||||||
// cn = cnValue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
|
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
|
||||||
// ListaSexos = await Utilidades.ObtenerObjeto<List<ENUMERACIONES>>(cliente, "/api/ENUMERACIONES/EnumeracionesGrupo/SEXO");
|
|
||||||
string clDesencriptado = tsUtilidades.crypt.FEncS(cl,
|
string clDesencriptado = tsUtilidades.crypt.FEncS(cl,
|
||||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
||||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
||||||
-875421649);
|
-875421649);
|
||||||
|
|
||||||
var clCn = clDesencriptado.Split("-");
|
var clCn = clDesencriptado.Split("-");
|
||||||
var nifDesencriptado = clCn[0];
|
nifDesencriptado = clCn[0];
|
||||||
var NominaDesencriptada = Int32.Parse(clCn[1]);
|
NominaDesencriptada = Int32.Parse(clCn[1]);
|
||||||
// int NominaDesencriptada = Int32.Parse(tsUtilidades.crypt.FEncS(cn,
|
// int NominaDesencriptada = Int32.Parse(tsUtilidades.crypt.FEncS(cn,
|
||||||
// "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
// "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
||||||
// "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
// "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*",
|
||||||
@@ -678,8 +700,6 @@
|
|||||||
Console.WriteLine($"Error durante la inicialización: {ex.Message}");
|
Console.WriteLine($"Error durante la inicialización: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private string HashRed(string id)
|
private string HashRed(string id)
|
||||||
{
|
{
|
||||||
string link = "/PeriodoSiltra?cl=" + tsUtilidades.crypt.FEncS(
|
string link = "/PeriodoSiltra?cl=" + tsUtilidades.crypt.FEncS(
|
||||||
@@ -689,8 +709,6 @@
|
|||||||
875421649);
|
875421649);
|
||||||
return link;
|
return link;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task CargarSelects()
|
private async Task CargarSelects()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -712,6 +730,66 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
private async Task GuardarNomina()
|
||||||
|
{
|
||||||
|
CerrarConfirmacion();
|
||||||
|
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
|
||||||
|
// ValidarTodos();
|
||||||
|
if (!editContext.GetValidationMessages().Any())
|
||||||
|
|
||||||
|
{
|
||||||
|
if (Nomina.IDNOMINATRABAJADOR== 0)//Nuevo
|
||||||
|
{
|
||||||
|
|
||||||
|
var response = await Utilidades.NuevoObjeto(cliente, "/api/NOMINATRABAJADORCABECERA", Nomina);
|
||||||
|
string link = "/NomPers?cl=" + tsUtilidades.crypt.FEncS(response.IDNOMINATRABAJADOR.ToString(), "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.:/-*", 875421649);
|
||||||
|
NavigationManager.NavigateTo(link, forceLoad: true);
|
||||||
|
|
||||||
|
}
|
||||||
|
else//Actualizar
|
||||||
|
{
|
||||||
|
// Nomina.IMPORTESEGURO = null;
|
||||||
|
var responsea = await Utilidades.ActualizarObjeto(cliente, "/api/NOMINATRABAJADORCABECERA/" + Nomina.IDNOMINATRABAJADOR, Nomina);
|
||||||
|
var url = NavigationManager.ToAbsoluteUri(NavigationManager.Uri);
|
||||||
|
if (QueryHelpers.ParseQuery(url.Query).TryGetValue("cl", out var clValue)) { cl = clValue; }
|
||||||
|
cliente = Utilidades.ObtenerCliente(UserState.Token, HttpClientFactory);
|
||||||
|
var responsePers = await cliente.GetAsync($"/api/PERSONAS/PersonaNominaNif/{nifDesencriptado}");
|
||||||
|
if (!responsePers.IsSuccessStatusCode)
|
||||||
|
{
|
||||||
|
throw new Exception($"Error al obtener los datos de la persona. Código: {responsePers.StatusCode}");
|
||||||
|
}
|
||||||
|
|
||||||
|
var resultContentPers = await responsePers.Content.ReadAsStringAsync();
|
||||||
|
Persona = JsonConvert.DeserializeObject<PERSONAS>(resultContentPers) ?? throw new Exception("Error al deserializar los datos de la persona.");
|
||||||
|
Nomina = Persona.NOMINATRABAJADORCABECERA?.FirstOrDefault(x => x.IDNOMINA == NominaDesencriptada);
|
||||||
|
|
||||||
|
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,
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -198,7 +198,7 @@ namespace GestionPersonalWeb.Models
|
|||||||
public static async Task<String> ActualizarObjeto<T>(HttpClient cliente, String uri, T objeto, List<ToastMessage> mensajes = null)
|
public static async Task<String> ActualizarObjeto<T>(HttpClient cliente, String uri, T objeto, List<ToastMessage> mensajes = null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Limpiar propiedades de navegación
|
// Limpiar propiedades de navegación
|
||||||
VaciarPropiedadesDeNavegacion(objeto);
|
VaciarPropiedadesDeNavegacion(objeto);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@page "/ListadoPersonas"
|
@page "/ListadoPersonas"
|
||||||
@using System.Net.Http.Headers
|
@using System.Net.Http.Headers
|
||||||
@using System.Linq.Expressions
|
@using System.Linq.Expressions
|
||||||
@using Newtonsoft.Json
|
@using Newtonsoft.Json
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ namespace SwaggerAntifraude.Controllers
|
|||||||
using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false))
|
using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false))
|
||||||
{
|
{
|
||||||
//var dbSet = context.Set<VIDA_ADMINISTRATIVA>();
|
//var dbSet = context.Set<VIDA_ADMINISTRATIVA>();
|
||||||
var entities = context.PERIODOSSILTRA
|
var entities = context.NOMINATRABAJADORCABECERA
|
||||||
.Include(x => x.TRAMOSSILTRA)
|
.Include(x => x.IDPERSONANavigation)
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
.FirstOrDefault(v => v.IDPERIODOSILTRA == id);
|
.FirstOrDefault(v => v.IDNOMINATRABAJADOR == id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1631,11 +1631,19 @@ namespace bdAntifraude.db
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public double IMPORTESEGURO
|
public double? IMPORTESEGURO
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return (double)(this.IDPERSONANavigation.SEGUROACCIDENTE);
|
if (this.IDPERSONANavigation != null)
|
||||||
|
{
|
||||||
|
return (double)(this.IDPERSONANavigation.SEGUROACCIDENTE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user