Exemple #1
0
        public ActionResult Eliminar(MateriaDetalle materiaDetalle)
        {
            var gradoDetalle = materiaDetalle.GradoDetalleId;

            _materiaBL.EliminarMateriaDetalle(materiaDetalle.Id);

            return(RedirectToAction("Index", new { gradoDetalleId = gradoDetalle }));
        }
Exemple #2
0
        public ActionResult Crear(int gradoDetalleId)
        {
            var nuevamateriaDetalle = new MateriaDetalle();

            nuevamateriaDetalle.GradoDetalleId = gradoDetalleId;

            var materias = _materiaBL.Obtenermaterias();



            //ViewBag.idalumno = alumnoId;


            ViewBag.MateriaId = new SelectList(materias, "Id", "Descripcion");


            return(View(nuevamateriaDetalle));
        }
Exemple #3
0
        public ActionResult Crear(MateriaDetalle materiaDetalle)
        {
            var materias = _materiaBL.Obtenermaterias();

            if (ModelState.IsValid)
            {
                if (materiaDetalle.MateriaId == 0)
                {
                    ModelState.AddModelError("MateriaId", "Seleccione una Materia");
                    ViewBag.MateriaId = new SelectList(materias, "Id", "Descripcion");
                    return(View(materiaDetalle));
                }

                _materiaBL.GuardarMateriaDetalle(materiaDetalle);
                return(RedirectToAction("Index", new { gradoDetalleId = materiaDetalle.GradoDetalleId }));
            }

            ViewBag.MateriaId = new SelectList(materias, "Id", "Descripcion");

            return(View(materiaDetalle));
        }
Exemple #4
0
        public ActionResult Editar(MateriaDetalle materiaDetalle)
        {
            _materiaBL.GuardarMateriaDetalle(materiaDetalle);

            return(RedirectToAction("Index", new { gradoDetalleId = materiaDetalle.GradoDetalleId }));
        }