public PERSONA traePersona(int id) { PERSONA persona = new PERSONA(); try { using (var context = new SIGHUContext()) { persona = context.PERSONA.Where(p => p.IdPersona == id).FirstOrDefault(); } } catch (Exception ex) { throw new Exception(ex.Message); } return(persona); }
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); } }