public ActionResult DeleteConfirmed(int id) { StudentPetition studentPetition = db.StudentPetition.Find(id); db.StudentPetition.Remove(studentPetition); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "StudentPetitionID,Status,SubmitDate,StudentID,PetitionID")] StudentPetition studentPetition) { if (ModelState.IsValid) { db.Entry(studentPetition).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PetitionID = new SelectList(db.Petition, "PetitionID", "Name", studentPetition.PetitionID); ViewBag.StudentID = new SelectList(db.Student, "StudentId", "FirstName", studentPetition.StudentID); return(View(studentPetition)); }
// GET: AdminStudentPetitions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentPetition studentPetition = db.StudentPetition.Find(id); if (studentPetition == null) { return(HttpNotFound()); } return(View(studentPetition)); }
// GET: AdminStudentPetitions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentPetition studentPetition = db.StudentPetition.Find(id); if (studentPetition == null) { return(HttpNotFound()); } ViewBag.PetitionID = new SelectList(db.Petition, "PetitionID", "Name", studentPetition.PetitionID); ViewBag.StudentID = new SelectList(db.Student, "StudentId", "FirstName", studentPetition.StudentID); return(View(studentPetition)); }