public ActionResult Listar() { Alumno objCiclo = new Alumno(); DataAccessAlumno objDB = new DataAccessAlumno(); objCiclo.ShowallAlumno = objDB.GetAllAlumno(); return(View(objCiclo)); }
public ActionResult EditarAlumno(int cod) { if (cod == 0) { return(RedirectToAction("Listado")); } else { DataAccessAlumno objDB = new DataAccessAlumno(); Alumno objalumno = new Alumno(); return(View(objDB.ObtenerAlumno(cod))); } }
public ActionResult EditarAlumno(Alumno Alu) { try { if (ModelState.IsValid) { DataAccessAlumno objDB = new DataAccessAlumno(); if (objDB.EditarAl(Alu)) { ViewBag.Message = "Registro Editado con exito!"; } } return(View()); }catch { return(View()); } }
public ActionResult DeleteAlumno(int cod) { if (cod == 0) { return(RedirectToAction("Listado")); } else { DataAccessAlumno objDB = new DataAccessAlumno(); //Alumno objciclo = new Alumno (); if (objDB.DeleteAlumno(cod) == true) { return(RedirectToAction("Listado")); } else { return(RedirectToAction("Listado")); } } }
public ActionResult Agregaralumno(Alumno Emp) { try { if (ModelState.IsValid) { DataAccessAlumno objDB = new DataAccessAlumno(); if (objDB.AgregarAlumno(Emp)) { ModelState.Clear(); ViewBag.Message = "Registro agregado con exito!"; } } return(View()); } catch { return(View()); } }
public JsonResult ListAlumno() { DataAccessAlumno objDB = new DataAccessAlumno(); return(Json(objDB.GetAllAlumno(), JsonRequestBehavior.AllowGet)); }