Ajustes UsuariosTemp v1

This commit is contained in:
Dario F. Gomez Z 2023-11-27 08:52:45 -05:00
parent f97a42f296
commit 848232b585
4 changed files with 59 additions and 22 deletions

View File

@ -119,29 +119,29 @@ namespace MSAdminUsuarios.Context
entity.Property(e => e.NU_PK_USUTMP).HasPrecision(10); entity.Property(e => e.NU_PK_USUTMP).HasPrecision(10);
entity.Property(e => e.FE_INICIOACTIVACION_USUTMP).HasColumnType("DATE");
entity.Property(e => e.FE_FINACTIVACION_USUTMP).HasColumnType("DATE"); entity.Property(e => e.FE_FINACTIVACION_USUTMP).HasColumnType("DATE");
entity.Property(e => e.NU_ESTADO_USUTMP).HasPrecision(10); entity.Property(e => e.FE_INICIOACTIVACION_USUTMP).HasColumnType("DATE");
entity.Property(e => e.NU_TIPODOC_USUTMP).HasPrecision(10); entity.Property(e => e.NU_ESTADO_USUMS).HasPrecision(10);
entity.Property(e => e.TX_CORREO_USUTMP).HasMaxLength(200); entity.Property(e => e.NU_TIPODOC_USUMS).HasPrecision(10);
entity.Property(e => e.TX_IDENTIFICACION_USUTMP).HasMaxLength(100); entity.Property(e => e.TX_CORREO_USUMS).HasMaxLength(200);
entity.Property(e => e.TX_NOMBREPVD_USUTMP).HasMaxLength(1999); entity.Property(e => e.TX_NOMBRE_PVD).HasMaxLength(1999);
entity.Property(e => e.TX_PRIMERAPELL_USUTMP).HasMaxLength(200); entity.Property(e => e.TX_PKDOC_USUMS).HasMaxLength(200);
entity.Property(e => e.TX_PRIMERNOM_USUTMP).HasMaxLength(200); entity.Property(e => e.TX_PRIMERAPELL_USUMS).HasMaxLength(200);
entity.Property(e => e.TX_SEGUNDOAPELL_USUTMP).HasMaxLength(200); entity.Property(e => e.TX_PRIMERNOM_USUMS).HasMaxLength(200);
entity.Property(e => e.TX_SEGUNDONOM_USUTMP).HasMaxLength(200); entity.Property(e => e.TX_SEGUNDOAPELL_USUMS).HasMaxLength(200);
entity.Property(e => e.TX_TELEFONO_USUTMP).HasMaxLength(100); entity.Property(e => e.TX_SEGUNDONOM_USUMS).HasMaxLength(200);
entity.Property(e => e.TX_TELEFONO_USUMS).HasMaxLength(200);
}); });
OnModelCreatingPartial(modelBuilder); OnModelCreatingPartial(modelBuilder);

View File

@ -6,16 +6,16 @@ namespace MSAdminUsuarios.Context
public partial class USUARIOSTEMP public partial class USUARIOSTEMP
{ {
public int NU_PK_USUTMP { get; set; } public int NU_PK_USUTMP { get; set; }
public int? NU_TIPODOC_USUTMP { get; set; } public int? NU_TIPODOC_USUMS { get; set; }
public string? TX_IDENTIFICACION_USUTMP { get; set; } public string? TX_PKDOC_USUMS { get; set; }
public string? TX_PRIMERNOM_USUTMP { get; set; } public string? TX_PRIMERNOM_USUMS { get; set; }
public string? TX_SEGUNDONOM_USUTMP { get; set; } public string? TX_SEGUNDONOM_USUMS { get; set; }
public string? TX_PRIMERAPELL_USUTMP { get; set; } public string? TX_PRIMERAPELL_USUMS { get; set; }
public string? TX_SEGUNDOAPELL_USUTMP { get; set; } public string? TX_SEGUNDOAPELL_USUMS { get; set; }
public string? TX_NOMBREPVD_USUTMP { get; set; } public string? TX_NOMBRE_PVD { get; set; }
public string? TX_CORREO_USUTMP { get; set; } public string? TX_CORREO_USUMS { get; set; }
public string? TX_TELEFONO_USUTMP { get; set; } public string? TX_TELEFONO_USUMS { get; set; }
public int? NU_ESTADO_USUTMP { get; set; } public int? NU_ESTADO_USUMS { get; set; }
public DateTime? FE_INICIOACTIVACION_USUTMP { get; set; } public DateTime? FE_INICIOACTIVACION_USUTMP { get; set; }
public DateTime? FE_FINACTIVACION_USUTMP { get; set; } public DateTime? FE_FINACTIVACION_USUTMP { get; set; }
} }

View File

@ -66,5 +66,41 @@ namespace MSAdminUsuarios.Controllers
return BadRequest(_errorModel); return BadRequest(_errorModel);
} }
} }
[HttpPatch]
public async Task<IActionResult> Patch(USUARIOSTEMP editado)
{
_errorModel = new ErrorModel();
try
{
if (editado == null)
{
_errorModel.error = true;
_errorModel.cuerpo.Add("No se envió solicitud.");
return Conflict(_errorModel);
}
USUARIOSTEMP? existente = await _context.USUARIOSTEMP.FirstOrDefaultAsync(ut => ut.NU_PK_USUTMP == editado.NU_PK_USUTMP);
if (existente == null)
{
_errorModel.error = true;
_errorModel.cuerpo.Add("Diseño no encontrado.");
return Conflict(_errorModel);
}
_context.Entry(existente).CurrentValues.SetValues(editado);
await _context.SaveChangesAsync();
_errorModel.error = false;
_errorModel.cuerpo.Add("Solicitud de usuario temporal guardado correctamente.");
return Ok(_errorModel);
}
catch (Exception)
{
_errorModel.error = true;
_errorModel.cuerpo.Add("Error con la base de datos.");
return BadRequest(_errorModel);
}
}
} }
} }

View File

@ -38,6 +38,7 @@ namespace MSAdminUsuarios.Dto
public int? NU_MODALIDADCTT_USUMS { get; set; } public int? NU_MODALIDADCTT_USUMS { get; set; }
public string? TX_SEDES_USUMS { get; set; } public string? TX_SEDES_USUMS { get; set; }
public int? NU_BLOQUEO_USUMS { get; set; } public int? NU_BLOQUEO_USUMS { get; set; }
public string? TX_UUID_USUMS { get; set; }
public int? NU_TIPOUSUARIO_USUMS { get; set; } public int? NU_TIPOUSUARIO_USUMS { get; set; }
} }
} }