Genreacion de amoritzaciones obtencion de PIBE

This commit is contained in:
2026-09-21 12:50:04 +02:00
parent ffb2fe08c0
commit deadc1fa5c
2 changed files with 24 additions and 2 deletions

View File

@@ -174,9 +174,9 @@
// gcPrestamos.View.CommitEditing(true);
var enumPibe = await Utilidades.ObtenerObjeto<List<ENUMERACIONES>>(cliente, "/api/ENUMERACIONES/EnumeracionesGrupo/NOM");
var enumPibe = await Utilidades.ObtenerObjeto<ENUMERACIONES>(cliente, "/api/ENUMERACIONES/EnumeracionesCodigo/NOM.PIBE");
// var pibe = enumPibe.FirstOrDefault().VALORNUMERICO1;
var pibe = enumPibe.FirstOrDefault(x => x.CODIGO == "NOM.PIBE")?.VALORNUMERICO1;
var pibe = enumPibe.VALORNUMERICO1;
if (pibe == null)

View File

@@ -42,5 +42,27 @@ namespace SwaggerAntifraude.Controllers
return StatusCode(500, $"Error interno del servidor: {ex.Message}");
}
}
[Authorize(Policy = "LecturaPolicy")]
[HttpGet("EnumeracionesCodigo/{codigo}")]
public async Task<IActionResult> EnumCodigo(string codigo)
{
try
{
using (var context = tsGestionAntifraude.NuevoContexto(SoloLectura: true, UseLazyLoadingProxies: false))
{
var enumes = context.ENUMERACIONES.Include(v => v.IDGRUPOENUMERACIONNavigation)
.FirstOrDefault(p => p.CODIGO == codigo);
if (enumes == null)
return NotFound();
return Ok(enumes);
}
}
catch (Exception ex)
{
return StatusCode(500, $"Error interno del servidor: {ex.Message}");
}
}
}
}