Esempio n. 1
0
        //Para obtener por ID

        public Grupos obtenerPorId(int id)
        {
            try
            {
                using (MyDbContext context = new MyDbContext())
                {
                    //crear instancia de la DAL y se pasa el contexto de la bd
                    GruposDAL dal = new GruposDAL(context);

                    //llamada al metodo para obtener todos los registros
                    return(dal.obtenerPorID(id));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Esempio n. 2
0
        //Para modificar un estudiante
        public int modificar(int id, Grupos grupos)
        {
            try
            {
                using (MyDbContext context = new MyDbContext())
                {
                    //crear instancia de la DAL y se pasa el contexto de la bd
                    GruposDAL dal = new GruposDAL(context);

                    //llamada al metodo para obtener todos los registros
                    return(dal.modificarGrupos(id, grupos));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Esempio n. 3
0
 public GruposBLL(string stringConnection)
 {
     this.stringConnection = stringConnection;
     _GrupoDAL             = new GruposDAL(this.stringConnection);
     _MateriaDAL           = new MateriasDAL(this.stringConnection);
 }