public ActionResult DeleteConfirmed(int id) { AlumnosTb alumnosTb = db.AlumnosTb.Find(id); db.AlumnosTb.Remove(alumnosTb); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id_Alumno,matricula,nombre,apellidoP,apellidoM,idCarrera,grupo")] AlumnosTb alumnosTb) { if (ModelState.IsValid) { db.Entry(alumnosTb).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(alumnosTb)); }
public ActionResult Create([Bind(Include = "id_Alumno,matricula,nombre,apellidoP,apellidoM,idCarrera,grupo")] AlumnosTb alumnosTb) { if (ModelState.IsValid) { db.AlumnosTb.Add(alumnosTb); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(alumnosTb)); }
// GET: AlumnosTbs/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AlumnosTb alumnosTb = db.AlumnosTb.Find(id); if (alumnosTb == null) { return(HttpNotFound()); } return(View(alumnosTb)); }
public ActionResult FindAlumno(string m) { int matricula = Convert.ToInt32(m); AlumnosTb alumno = new AlumnosTb(); var result = new { status = "Not Find", name = "", lstGrupos = new SelectList("", "") }; alumno = db.AlumnosTb.Where(i => i.matricula == matricula).FirstOrDefault(); if (alumno != null) { SelectList lstGrupos = new SelectList(db.SP_GetGruposAlumno(alumno.id_Alumno), "id_grupo", "num_grupo"); result = new { status = "Succes", name = alumno.nombre + " " + alumno.apellidoP + " " + alumno.apellidoM, lstGrupos }; return(Json(result, JsonRequestBehavior.AllowGet)); } return(Json(result, JsonRequestBehavior.AllowGet)); }