Ejemplo n.º 1
0
        // Para insertar estudiante

        public int insertar(Profesores profesores)
        {
            try
            {
                return(profesoresDal.insertarProfesores(profesores));
            }
            catch (Exception ex)
            {
                throw;
            }
        }
Ejemplo n.º 2
0
        // Instancia para acceder a todos los metodos de la DAL

        //public ProfesoresDAL profesoresDal = new ProfesoresDAL();

        // Para insertar estudiante

        public int insertar(Profesores profesores)
        {
            try
            {
                using (MyDbContext context = new MyDbContext())
                {
                    //crear instancia de la DAL y se pasa el contexto de la bd
                    ProfesoresDAL dal = new ProfesoresDAL(context);

                    //llamada al metodo para obtener todos los registros
                    return(dal.insertarProfesores(profesores));
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }