示例#1
0
        public List<cliente> update(cliente o, int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var empresa = db.clientes.Find(id);
                    empresa.razon_social = o.razon_social;
                    empresa.ruc = o.ruc;
                    empresa.telefono = o.telefono;
                    empresa.latitud = o.latitud;
                    empresa.longitud = o.longitud;
                    empresa.estado = o.estado;
                    empresa.fec_mod = o.fec_mod;
                    empresa.usu_mod = o.usu_mod;

                    if (db.SaveChanges() > 0)
                    {
                        return new List<cliente>() { empresa };
                    }
                    else
                        return null;

                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }
 public List<gpregunta> save(gpregunta o)
 {
     try
     {
         using (var db = new PruebaContext())
         {
             db.gpreguntas.Add(o);
             db.SaveChanges();
             return this.listAll();
         }
     }
     catch (Exception)
     {
         throw;
     }
 }
        public List<encuesta_config> save(encuesta_config o)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    db.encuesta_config.Add(o);
                    db.SaveChanges();
                    return listAll();
                }
            }
            catch (Exception ex)
            {

                throw;
            }
        }
        public Boolean save(resultado o)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    db.resultadoes.Add(o);
                    db.SaveChanges();
                }
                return true;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<evaluador> save(evaluador o)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    db.evaluadors.Add(o);
                    db.SaveChanges();

                    return listAll();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<cliente_empleadoList> save(cliente_empleado o)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    db.cliente_empleado.Add(o);

                    var validationErrors = db.GetValidationErrors();

                    db.SaveChanges();
                    return listAll();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message.ToString());
            }
        }
        public List<cliente_empleadoList> update(cliente_empleado o,int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var entity = db.cliente_empleado.Find(id);
                    entity.id_evaluador = o.id_evaluador;
                    entity.id_cliente = o.id_cliente;
                    entity.id_empleado = o.id_empleado;
                    db.SaveChanges();
                    return listAll();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<pregunta> update(pregunta o, int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var pregunta = db.preguntas.Find(id);
                    pregunta.descripcion = o.descripcion;
                    pregunta.estado = o.estado;
                    pregunta.id_gpregunta = o.id_gpregunta;
                    db.SaveChanges();
                    return listAll(o.id_gpregunta);
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
 public List<asistencia> add(asistencia o)
 {
     try
     {
         using (var db = new PruebaContext())
         {
             db.asistencias.Add(o);
             if (db.SaveChanges() > 0)
             {
                 return this.listAll(o.id_empleado);
             }
             else
                 return null;
         }
     }
     catch (Exception ex)
     {
         return null;
     }
 }
示例#10
0
 public List<cliente> add(cliente o)
 {
     try
     {
         using (var db = new PruebaContext())
         {
             db.clientes.Add(o);
             if (db.SaveChanges() > 0)
             {
                 return listAll();
             }
             else
                 return null;
         }
     }
     catch (Exception ex)
     {
         return null;
     }
 }
示例#11
0
        public List<gpregunta> update(gpregunta o,int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var gp = db.gpreguntas.Find(id);
                    gp.descripcion = o.descripcion;
                    gp.estado = o.estado;
                    db.SaveChanges();

                    return this.listAll();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
示例#12
0
        public List<empleado> add(empleado o)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    db.empleados.Add(o);

                    //var validationErrors = db.GetValidationErrors();

                    if (db.SaveChanges() > 0)
                    {
                        return this.listAll();
                    }
                    else
                        return null;
                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }
        public List<encuesta_config> update(encuesta_config o,int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var entity = db.encuesta_config.Find(id);
                    entity.fecha_ini = o.fecha_ini;
                    entity.fecha_fin = o.fecha_fin;
                    entity.estado = o.estado;
                    entity.usu_mod = o.usu_mod;
                    entity.fec_mod = o.fec_mod;
                    db.SaveChanges();

                    return listAll();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }
示例#14
0
        public List<empleado> updateFoto(empleado o, int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var usuario = db.empleados.Find(id);
                    usuario.foto = o.foto;

                    //var validationErrors = db.GetValidationErrors();

                    if (db.SaveChanges() > 0)
                    {
                        return new List<empleado>() { usuario };
                    }
                    else
                        return null;

                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
示例#15
0
        public List<empleado> update(empleado o, int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var usuario = db.empleados.Find(id);
                    usuario.nombres = o.nombres;
                    usuario.apellidos = o.apellidos;
                    usuario.telefono = o.telefono;
                    usuario.correo = o.correo;
                    usuario.usuario = o.usuario;
                    usuario.password = o.password;
                    usuario.tipo_usuario = o.tipo_usuario;
                    usuario.hora_ingreso = o.hora_ingreso;
                    usuario.estado = o.estado;
                    usuario.fec_mod = o.fec_mod;
                    usuario.usu_mod = o.usu_mod;
                    usuario.curri_file = o.curri_file;
                    usuario.hora_salida = o.hora_salida;

                    //var validationErrors = db.GetValidationErrors();

                    if (db.SaveChanges() > 0)
                    {
                        return new List<empleado>() { usuario };
                    }
                    else
                        return null;

                }
            }
            catch (Exception ex)
            {
                return null;
            }
        }
示例#16
0
        public List<evaluador> update(evaluador o,int id)
        {
            try
            {
                using (var db = new PruebaContext())
                {
                    var evaluador = db.evaluadors.Find(id);
                    evaluador.apellidos = o.apellidos;
                    evaluador.nombres = o.nombres;
                    evaluador.estado = o.estado;
                    evaluador.cargo = o.cargo;
                    evaluador.email = o.email;
                    evaluador.password = o.password;
                    evaluador.usuario = o.usuario;
                    evaluador.fec_mod = o.fec_mod;
                    evaluador.usu_mod = o.usu_mod;
                    db.SaveChanges();

                    return listAll();
                }
            }
            catch (Exception)
            {

                throw;
            }
        }