Exemple #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);
        }
Exemple #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);
            }
        }
Exemple #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);
            }
        }