示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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);
            }
        }