Ejemplo n.º 1
0
        public EMPRESA traeEmpresa(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();
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }

            return(empresa);
        }
Ejemplo n.º 2
0
        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);
            }
        }