public ActionResult Eliminar(MateriaDetalle materiaDetalle) { var gradoDetalle = materiaDetalle.GradoDetalleId; _materiaBL.EliminarMateriaDetalle(materiaDetalle.Id); return(RedirectToAction("Index", new { gradoDetalleId = gradoDetalle })); }
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)); }
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)); }
public ActionResult Editar(MateriaDetalle materiaDetalle) { _materiaBL.GuardarMateriaDetalle(materiaDetalle); return(RedirectToAction("Index", new { gradoDetalleId = materiaDetalle.GradoDetalleId })); }