public void guardaAdjunto() { try { var context = new SIGHUContext(); context.Entry(this).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void delAdjunto(int id) { try { var context = new SIGHUContext(); context.Database.ExecuteSqlCommand("DELETE FROM ADJUNTOS WHERE IdAdjunto = " + id); context.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public void editarGrupo() { try { using (var context = new SIGHUContext()) { context.Entry(this).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void ingresaVehiculo() { try { using (var context = new SIGHUContext()) { context.Entry(this).State = System.Data.Entity.EntityState.Added; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void activaUsuario(int id) { USUARIO usuario = new USUARIO(); try { using (var context = new SIGHUContext()) { usuario = context.USUARIO.Where(u => u.IdUsuario == id).FirstOrDefault(); usuario.Activo = 1; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void cambiaFoto(int id, string Foto) { PERSONA persona = new PERSONA(); try { using (var context = new SIGHUContext()) { persona = (from p in context.PERSONA where p.IdPersona == id select p).FirstOrDefault(); persona.FotoPerfil = Foto; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void asignaUsuario(int id) { PERSONA persona = new PERSONA(); try { using (var context = new SIGHUContext()) { persona = (from p in context.PERSONA where p.IdPersona == id select p).FirstOrDefault(); persona.UsuarioAsig = 1; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void cambiaPassword(int id, string password) { USUARIO usuario = new USUARIO(); try { using (var context = new SIGHUContext()) { usuario = (from u in context.USUARIO where u.IdUsuario == id select u).FirstOrDefault(); usuario.PasswordUsuario = password; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void desGrupo(int id) { GRUPO_ADJUNTO grupo = new GRUPO_ADJUNTO(); try { using (var context = new SIGHUContext()) { grupo = (from g in context.GRUPO_ADJUNTO where g.IdGrupo == id select g).FirstOrDefault(); grupo.Activo = 0; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void desEmpresa(int id) { EMPRESA empresa = new EMPRESA(); try { using (var context = new SIGHUContext()) { empresa = (from e in context.EMPRESA where e.IdEmpresa == id select e).FirstOrDefault(); empresa.Activo = 0; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void desTipoAdjunto(int id) { TIPO_ADJUNTO tipo = new TIPO_ADJUNTO(); try { using (var context = new SIGHUContext()) { tipo = (from t in context.TIPO_ADJUNTO where t.IdTAdjunto == id select t).FirstOrDefault(); tipo.Activo = 0; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }
public void activaCargo(int id) { CARGO cargo = new CARGO(); try { using (var context = new SIGHUContext()) { cargo = (from c in context.CARGO where c.IdCargo == id select c).FirstOrDefault(); cargo.Activo = 1; context.SaveChanges(); } } catch (Exception ex) { throw new Exception(ex.Message); } }