Ejemplo n.º 1
0
        public bool Update(Personas entity)
        {
            try
            {
                var data = new InmDAL.Personas()
                {
                    Apellido        = entity.Apellido,
                    Celular         = entity.Celular,
                    DU              = entity.DU,
                    Email           = entity.Email,
                    Nombre          = entity.Nombre,
                    PersonasId      = entity.PersonasId.Value,
                    Telefono        = entity.Telefono,
                    TelefonoLaboral = entity.TelefonoLaboral
                };

                var response = genericDal.Update(data);
                if (response != null)
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
Ejemplo n.º 2
0
 public int Add(Personas entity)
 {
     try
     {
         int response = 0;
         if (!ExisteClienteConDNI(entity.DU))
         {
             var data = new InmDAL.Personas
             {
                 Apellido        = entity.Apellido,
                 Nombre          = entity.Nombre,
                 Email           = entity.Email,
                 DU              = entity.DU,
                 Telefono        = entity.Telefono,
                 TelefonoLaboral = entity.TelefonoLaboral,
                 Celular         = entity.Celular
             };
             response = genericDal.Add(data);
         }
         return(response);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Ejemplo n.º 3
0
 public bool Delete(Personas entity)
 {
     try
     {
         var data = new InmDAL.Personas();
         data.PersonasId = entity.PersonasId.Value;
         var response = genericDal.Delete(data);
         if (response != null)
         {
             return(true);
         }
         return(false);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }