419 lines
20 KiB
C#
419 lines
20 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
|
using Modelo;
|
|
using Entidades.Admin;
|
|
using Entidades.Dto;
|
|
using Entidades;
|
|
using System.Linq.Expressions;
|
|
using AlquilaFacil.StrategyBusquedaAdmin;
|
|
using System.Diagnostics;
|
|
using AlquilaFacil.Builder;
|
|
using Minio.DataModel.Args;
|
|
using Minio;
|
|
using AlquilaFacil.Config;
|
|
using System.Text.Json;
|
|
namespace AlquilaFacil.Controllers;
|
|
|
|
[ApiController]
|
|
public class AdminController: ControllerBase
|
|
{
|
|
|
|
[HttpGet("api/contratos/controlPagos")]
|
|
public IActionResult obtenerContratosInpagos([FromHeader(Name = "Auth")] string Auth) {
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 14);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
var contratos = RepositorioContratos.Singleton.ObtenerContratosInpagos();
|
|
|
|
List<ContratoDto> dtos = new();
|
|
foreach (var i in contratos) {
|
|
if (i.DniinquilinoNavigation == null || i.IdpropiedadNavigation == null
|
|
|| i.DnipropietarioNavigation == null) continue;
|
|
|
|
var cont = new ContratoDtoBuilder()
|
|
.SetInquilino($"{i.DniinquilinoNavigation.Nombre} {i.DniinquilinoNavigation.Apellido}")
|
|
.SetUbicacion(i.IdpropiedadNavigation.Ubicacion)
|
|
.SetPropietario($"{i.DnipropietarioNavigation.Nombre} {i.DnipropietarioNavigation.Apellido}")
|
|
.SetId(i.Id)
|
|
.SetTipo(i.IdpropiedadNavigation.IdtipropiedadNavigation.Descripcion)
|
|
.SetFechaInicio(i.Fechainicio)
|
|
.SetEstado(i.Habilitado, i.Cancelado)
|
|
.Build();
|
|
dtos.Add(cont);
|
|
}
|
|
return Ok(dtos);
|
|
}
|
|
|
|
[HttpGet("api/contratos/controlPagos/propiedad")]
|
|
public IActionResult obtenerPropiedad([FromHeader(Name = "Auth")] string Auth, int id = 0) {
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioGrupos.Singleton.CheckGrupos(Auth, "Admin");
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
if (id <= 0) return BadRequest(new { message = "No hay propiedades con id igual o menor a 0"});
|
|
var i = RepositorioContratos.Singleton.ObtenerContratoPorId(id);
|
|
if (i == null || i.DniinquilinoNavigation == null ||
|
|
i.IdpropiedadNavigation == null || i.DnipropietarioNavigation == null)return BadRequest(new { message = "Fallo la query"});
|
|
|
|
var cont = new ContratoPropiedadDtoBuilder()
|
|
.SetInquilino($"{i.DniinquilinoNavigation.Nombre} {i.DniinquilinoNavigation.Apellido}")
|
|
.SetUbicacion(i.IdpropiedadNavigation.Ubicacion)
|
|
.SetId(i.Id)
|
|
.SetPropietario($"{i.DnipropietarioNavigation.Nombre} {i.DnipropietarioNavigation.Apellido}")
|
|
.SetTipo(i.IdpropiedadNavigation.IdtipropiedadNavigation.Descripcion)
|
|
.SetFechaInicio(i.Fechainicio)
|
|
.SetEstado(i.Habilitado, i.Cancelado)
|
|
.SetHabitaciones(i.IdpropiedadNavigation.Canthabitaciones)
|
|
.SetPiso(i.IdpropiedadNavigation.Piso??0)
|
|
.SetLetra(i.IdpropiedadNavigation.Letra??"")
|
|
.SetMesesAumento(i.MesesHastaAumento)
|
|
.SetMesesDuracion(i.MesesDurationContrato)
|
|
.Build();
|
|
|
|
return Ok(cont);
|
|
}
|
|
|
|
private readonly IMinioClient mc;
|
|
public AdminController(IMinioClient minioClient) {
|
|
mc = minioClient;
|
|
if (mc == null){
|
|
MinioConfigcus? mcon = JsonSerializer.Deserialize<MinioConfigcus>(System.IO.File.ReadAllText("./settings.json"))?? null;
|
|
if (mcon == null) throw new Exception();
|
|
|
|
mc = new MinioClient().WithCredentials(mcon.usr, mcon.scrt)
|
|
.WithEndpoint("192.168.1.11:9000")
|
|
.WithSSL(false)
|
|
.Build();
|
|
}
|
|
}
|
|
[HttpGet("/api/admin/contrato/verDocumento")]
|
|
public IActionResult verDocumento([FromHeader(Name = "Auth")] string Auth, int idcontrato = 0){
|
|
if (String.IsNullOrWhiteSpace(Auth)) return BadRequest("");
|
|
var validacion1 = RepositorioGrupos.Singleton.CheckGrupos(Auth, "Admin");
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
if (idcontrato <= 0) return BadRequest(new {message = "La id no puede ser igual o menor a 0"});
|
|
|
|
Contrato? contr = RepositorioContratos.Singleton.ObtenerContratoPorId(idcontrato);
|
|
|
|
try{
|
|
var memstream = new MemoryStream();
|
|
|
|
var goa = new GetObjectArgs()
|
|
.WithBucket("alquilafacil")
|
|
.WithObject(contr.UrlContrato)
|
|
.WithCallbackStream(stream => {
|
|
memstream.Position=0;
|
|
stream.CopyTo(memstream);
|
|
});
|
|
|
|
mc.GetObjectAsync(goa).Wait();
|
|
memstream.Position = 0;
|
|
|
|
if (memstream.Length == 0) return BadRequest(new { message = "El archivo está vacío" });
|
|
|
|
return File(memstream, "application/pdf", contr.UrlContrato);
|
|
|
|
} catch (Exception e){
|
|
Console.Error.WriteLine(e);
|
|
return BadRequest(new { message = "Fallo al intentar obtener el archivo del almacenamiento o este no existe"});
|
|
}
|
|
}
|
|
|
|
[HttpGet("api/admin/contrato/canons")]
|
|
public IActionResult ObtenerCanones([FromHeader(Name="Auth")]string Auth, int id = 0){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioGrupos.Singleton.CheckGrupos(Auth, "Admin");
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
var cont = RepositorioContratos.Singleton.ObtenerContratoPorId(id);
|
|
if (cont == null) return BadRequest(new { message = "No existe el contrato"});
|
|
|
|
var list = RepositorioCanons.Singleton.ObtenerCanonsPorContrato(id);
|
|
if (list == null) return BadRequest(new { message = "No hay contrato por esa id"});
|
|
|
|
DateTime date = DateTime.Now;
|
|
bool ret =list.Any(x=>x.Pagado ==0 && date > x.Fecha);
|
|
if (ret != true) return BadRequest(new { message = "Este contrato no tiene canones vencidos"});
|
|
|
|
string divisa ="";
|
|
if (cont.Iddivisa == 0) divisa = "AR$"; else if (cont.Iddivisa == 1) divisa = "US$";
|
|
|
|
List<CanonDto> d = new();
|
|
|
|
foreach (var i in list) {
|
|
if (i.Fecha > date) continue;
|
|
|
|
var c = new CanonDtoBuilder()
|
|
.SetId(i.Id)
|
|
.SetPago(i.Idrecibo==null?false:true)
|
|
.SetDivisa(divisa==""?"Ugh esta mal cargado la divisa en el contrato":divisa)
|
|
.SetMes(i.Fecha)
|
|
.SetMesNum(int.Parse((i.Fecha.Month - cont.Fechainicio.Month).ToString()) + 1)
|
|
.SetMonto(i.Monto)
|
|
.Build();
|
|
d.Add(c);
|
|
}
|
|
|
|
return Ok(d);
|
|
}
|
|
|
|
[HttpPost("api/admin/contrato/marcarPago")]
|
|
public IActionResult realizarPago([FromHeader(Name="Auth")]string Auth, MarcarPagoDto dto) {
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioGrupos.Singleton.CheckGrupos(Auth, "Admin");
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
if (dto.Idcontrato<=0) return BadRequest(new { message = "No puede existir un contrato con id 0 o menor"});
|
|
|
|
Cliente? cli = RepositorioUsuarios.Singleton.ObtenerClientePorToken(Auth);
|
|
if (cli == null)return Unauthorized();
|
|
|
|
Contrato? cont = RepositorioContratos.Singleton.ObtenerContratoPorId(dto.Idcontrato);
|
|
if (cont == null) return BadRequest(new { message = "No hay un contrato por esa id"});
|
|
|
|
Canon? c = RepositorioCanons.Singleton.ObtenerCanonContrato(dto.fecha, dto.Idcontrato);
|
|
if (c == null) return BadRequest(new { message = "no hay un canon por esa id"});
|
|
|
|
Recibo re = new Recibo{
|
|
Monto = c.Monto,
|
|
Fecha = DateTime.Now,
|
|
};
|
|
|
|
bool ret = RepositorioCanons.Singleton.SetRecibo(c, re, cli.Dni, "Admin Marca Recibo Como Pago");
|
|
return ret ?
|
|
Ok(new { message = "Se guardo correctamente"}):BadRequest(new { message = "No se pudo guardar"});
|
|
}
|
|
|
|
[HttpPost("api/admin/notificarInquilino")]
|
|
public IActionResult NotificarInquilino([FromHeader(Name ="Auth")]string Auth, NotificarAdmin data){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioGrupos.Singleton.CheckGrupos(Auth, "Admin");
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
Cliente? cli = RepositorioUsuarios.Singleton.ObtenerClientePorToken(Auth);
|
|
if (cli == null)return Unauthorized();
|
|
|
|
if (data.Mensaje == "") return BadRequest(new {message = "El campo Mensaje esta vacio"});
|
|
if (data.Idcontrato <= 0) return BadRequest(new {message = "La id de contrato no puede ser 0 o menor"});
|
|
if (data.Idcanon <= 0) return BadRequest(new {message = "La id de contrato no puede ser 0 o menor"});
|
|
|
|
Contrato? cont = RepositorioContratos.Singleton.ObtenerContratoPorId(data.Idcontrato);
|
|
if (cont == null || cont.DniinquilinoNavigation == null || cont.DnipropietarioNavigation == null || cont.IdpropiedadNavigation == null) return BadRequest(new { message = "no hay un contrato por esa id"});
|
|
|
|
Canon? can = RepositorioCanons.Singleton.ObtenerCanonPorId(data.Idcanon);
|
|
if (can == null)return BadRequest(new { message = "No existe un canon por esa id"});
|
|
|
|
var n = new NotificacioneBuilder()
|
|
.SetAccion("Notificacion Inquilino")
|
|
.SetMensaje(data.Mensaje)
|
|
.SetLeido(false)
|
|
.SetDnicliente(cont.DniinquilinoNavigation.Dni)
|
|
.SetDniremitente(cont.DnipropietarioNavigation.Dni)
|
|
.SetIdpropiedad(cont.IdpropiedadNavigation.Id)
|
|
.SetFecha(DateTime.Now)
|
|
.Build();
|
|
var ret = RepositorioNotificaciones.Singleton.AltaNotificacion(n, cli.Dni);
|
|
return ret?
|
|
Ok(new { message = "se envio el aviso" }):BadRequest(new { message = "Fallo al intentar enviar el aviso" });
|
|
|
|
}
|
|
|
|
[HttpGet("api/admin/clientes")]
|
|
public IActionResult GetClientes([FromHeader(Name ="Auth")]string Auth){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 9);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
IEnumerable<UsuarioAdmin>list = RepositorioUsuarios.Singleton.GetClientes();
|
|
return Ok(list);
|
|
}
|
|
|
|
[HttpGet("api/admin/cliente")]
|
|
public IActionResult ObtenerCliente([FromHeader(Name ="Auth")]string Auth, long dni = 0){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 9);
|
|
if (validacion1 == false) return Unauthorized();
|
|
if (dni <= 0) return BadRequest(new { message = "No puede haber un dni 0 o menor"});
|
|
|
|
Cliente? cambio = RepositorioUsuarios.Singleton.ObtenerClientePorDni(dni);
|
|
if (cambio == null) BadRequest(new { message = "no hay un cliente por ese dni"});
|
|
|
|
UpdateUsuarioAdmin a = new UpdateUsuarioAdmin{
|
|
Apellido = cambio.Apellido,
|
|
Celular = cambio.Celular,
|
|
Domicilio = cambio.Domicilio,
|
|
Nombre = cambio.Nombre,
|
|
};
|
|
|
|
return Ok(a);
|
|
}
|
|
|
|
[HttpPatch("api/admin/cliente")]
|
|
public IActionResult PatchCliente([FromHeader(Name ="Auth")]string Auth, [FromBody]UpdateUsuarioAdmin dto, [FromQuery]long dni=0){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 9);
|
|
if (validacion1 == false) return Unauthorized();
|
|
if (dni <= 0) return BadRequest(new { message = "No puede haber un dni 0 o menor"});
|
|
|
|
var validacion2 = checkdto(dto);
|
|
if (validacion2 != "") return BadRequest(new { message = validacion2});
|
|
|
|
Cliente?cli = RepositorioUsuarios.Singleton.ObtenerClientePorToken(Auth);
|
|
if (cli == null) return Unauthorized();
|
|
|
|
bool ret = RepositorioUsuarios.Singleton.PatchUsuario(dto, dni, cli.Dni);
|
|
|
|
return ret?
|
|
Ok(new { message = "Se actualizaron los datos"}):
|
|
BadRequest(new { message = "Fallo al guardar los datos"});
|
|
}
|
|
|
|
[HttpGet("api/admin/clientes/grupo")]
|
|
public IActionResult GetGruposByCliente([FromHeader(Name ="Auth")]string Auth, [FromQuery]long Dni){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 9);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
if (Dni <= 0) return BadRequest(new {message = "No puede tener un dni con numero negativo o cero"});
|
|
|
|
IEnumerable<GrupoAdmin> list = RepositorioGrupos.Singleton.ObtenerGruposPorDni(Dni);
|
|
return Ok(list);
|
|
}
|
|
[HttpPatch("api/admin/cliente/addGrupo")]
|
|
public IActionResult AddGrupoACliente([FromHeader(Name = "Auth")]string Auth, [FromBody]EmailGrupo data){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 9);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
Cliente? cli = RepositorioUsuarios.Singleton.ObtenerClientePorToken(Auth);
|
|
if (cli == null) return BadRequest(new { message = "No hay un cliente por ese token"});
|
|
|
|
if (data.email == "" || data.grupo == "") return BadRequest(new { message = "Faltan datos en la request" });
|
|
|
|
var ret = RepositorioUsuarios.Singleton.CheckGrupo(data.email, data.grupo);
|
|
if (ret) return BadRequest(new { message = $"El usuario ya pertenece al grupo {data.grupo}"});
|
|
|
|
var ret2 = RepositorioUsuarios.Singleton.AñadirClienteAGrupo(data.email, data.grupo, cli.Dni);
|
|
|
|
return ret2 ? Ok(new {message = "Se Añadio al Grupo"}): BadRequest(new { message = "Fallo al añadirse al Grupo" });
|
|
}
|
|
|
|
[HttpPatch("api/admin/cliente/rmGrupo")]
|
|
public IActionResult RmGrupoACliente([FromHeader(Name = "Auth")]string Auth, [FromBody]EmailGrupo data){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 9);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
Cliente? cli = RepositorioUsuarios.Singleton.ObtenerClientePorToken(Auth);
|
|
if (cli == null) return BadRequest(new { message = "No hay un cliente por ese token"});
|
|
|
|
|
|
if (data.email == "" || data.grupo == "") return BadRequest(new { message = "Faltan datos en la request" });
|
|
|
|
//una ward para que no me bloquee a mi mismo de tener acceso a admin
|
|
if (data.email == "celu@fedesrv.ddns.net" && data.grupo == "Admin") return BadRequest(new { message = "Si hago esto me estaria bloqueando la cuenta a mi mismo" });
|
|
|
|
var ret = RepositorioUsuarios.Singleton.CheckGrupo(data.email, data.grupo);
|
|
if (!ret) return BadRequest(new { message = $"El usuario no pertenece al grupo {data.grupo}"});
|
|
|
|
if (data.grupo == "Propietario") {
|
|
IQueryable<PropiedadesDto> ret3 = RepositorioPropiedades.Singleton.ObtenerPropiedadesPorEmail(data.email);
|
|
if (ret3.Count() > 0){
|
|
bool ret4 = RepositorioPropiedades.Singleton.BajaPropiedades(data.email);
|
|
if (ret4 == false) return BadRequest(new { message = "No se pudo dar de baja las propiedades"});
|
|
}
|
|
}
|
|
if (data.grupo == "Inquilino") {
|
|
var ret5 = RepositorioContratos.Singleton.ObtenerContratosPorEmailInquilino(data.email);
|
|
if ( ret5 == null || ret5.Where(x=>x.Habilitado == 0).Count() > 0) return BadRequest(new { message = "Aun tenes alquileres pendientes o fallo al intentar obtener la lista de alquileres, no se puede dar de baja"});
|
|
}
|
|
|
|
var ret2 = RepositorioUsuarios.Singleton.EliminarClienteAGrupo(data.email, data.grupo, cli.Dni);
|
|
return ret2 ? Ok(new {message = $"Se elimino del Grupo: {data.grupo}"}): BadRequest(new { message = "Fallo al añadirse al Grupo" });
|
|
}
|
|
|
|
[HttpDelete("api/admin/cliente")]
|
|
public IActionResult BajaCliente([FromHeader(Name ="Auth")]string Auth, long Dni){
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 9);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
if ( Dni <=0) return BadRequest(new {message = "No puede tener un Dni menor o igual a 0"});
|
|
|
|
Cliente? cli = RepositorioUsuarios.Singleton.ObtenerClientePorDni(Dni);
|
|
|
|
if (cli == null) return BadRequest(new {message = "No existe un cliente con ese numero de dni"});
|
|
|
|
bool esPropietario = RepositorioUsuarios.Singleton.CheckGrupo(cli.Email, "Propietario");
|
|
bool esInquilino = RepositorioUsuarios.Singleton.CheckGrupo(cli.Email, "Inquilino");
|
|
|
|
if (esPropietario) {
|
|
IQueryable<PropiedadesDto> ret3 = RepositorioPropiedades.Singleton.ObtenerPropiedadesPorEmail(cli.Email);
|
|
if (ret3.Count() > 0){
|
|
bool ret4 = RepositorioPropiedades.Singleton.BajaPropiedades(cli.Email);
|
|
if (ret4 == false) return BadRequest(new { message = "No se pudo dar de baja las propiedades"});
|
|
}
|
|
}
|
|
|
|
if (esInquilino) {
|
|
var ret5 = RepositorioContratos.Singleton.ObtenerContratosPorEmailInquilino(cli.Email);
|
|
if ( ret5 == null || ret5.Where(x=>x.Habilitado == 0).Count() > 0) return BadRequest(new { message = "Aun tenes alquileres pendientes o fallo al intentar obtener la lista de alquileres, no se puede dar de baja"});
|
|
}
|
|
// lo da de baja si no tiene el grupo propietario y no tiene alquileres pendientes
|
|
var ret = RepositorioUsuarios.Singleton.BajaCliente(Dni);
|
|
return Ok(ret);
|
|
}
|
|
|
|
[HttpDelete("api/admin/propiedad")]
|
|
public IActionResult BajaPropiedad([FromHeader(Name = "Auth")] string Auth, int id = 0) {
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 10);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
if (id <= 0) return BadRequest(new { message = "Falto indicar id Propiedad"});
|
|
|
|
Cliente? cli = RepositorioUsuarios.Singleton.ObtenerClientePorToken(Auth);
|
|
if (cli == null) return Unauthorized();
|
|
|
|
var ret = RepositorioPropiedades.Singleton.BajaPropiedad(id, cli.Dni);
|
|
return ret ?
|
|
Ok(new {message = "Se cambio el estado de la propiedad"}): BadRequest(new { message = "No se pudo dar de baja"});
|
|
}
|
|
|
|
[HttpGet("api/admin/busqueda/paginada")]
|
|
public IActionResult FiltroPropiedadesPaginado([FromHeader(Name = "Auth")]string Auth, int cantidadHabitaciones = 0, int tipoPropiedad = 0, [FromQuery]string servicios = "", int pag = 1) {
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 10);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
IQueryable<PropiedadesAdmin>? props = null;
|
|
pag -= 1;
|
|
|
|
var clave = $"{(cantidadHabitaciones != 0 ? "1" : "0")}{(tipoPropiedad != 0 ? "1" : "0")}{(!string.IsNullOrEmpty(servicios) ? "1" : "0")}";
|
|
var gen = AdminBusquedaContext.Singleton;
|
|
var estrategia = gen.ObtenerEstrategia(clave);
|
|
props = estrategia.Filtrar(servicios, cantidadHabitaciones, tipoPropiedad, pag);
|
|
|
|
return Ok(props);
|
|
}
|
|
|
|
[HttpGet("api/admin/busqueda/cantPag")]
|
|
public IActionResult CantidadPaginas([FromHeader(Name = "Auth")]string Auth, int cantidadHabitaciones = 0, int tipoPropiedad = 0, [FromQuery]string servicios = "") {
|
|
if (String.IsNullOrEmpty(Auth)) return Unauthorized();
|
|
var validacion1 = RepositorioPermisos.Singleton.CheckPermisos(Auth, 10);
|
|
if (validacion1 == false) return Unauthorized();
|
|
|
|
int ret = RepositorioPropiedades.Singleton.CuantasPaginasBusqueda(cantidadHabitaciones, servicios, tipoPropiedad, 0);
|
|
return Ok(new { message = ret});
|
|
}
|
|
|
|
private string checkdto(UpdateUsuarioAdmin d){
|
|
string ret ="";
|
|
if (d.Nombre=="") ret+="Campo Nombre vacio\n";
|
|
if (d.Apellido=="") ret+="Campo Apellido vacio\n";
|
|
if (d.Celular=="") ret+="Campo Celular vacio\n";
|
|
if (d.Domicilio=="")ret+="Campo Domicilio vacio\n";
|
|
return ret;
|
|
}
|
|
} |