Esempio n. 1
0
        public GRUPO_ADJUNTO traeGrupo(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();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(grupo);
        }
Esempio n. 2
0
        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);
            }
        }