public ActionResult DeleteConfirmed(int id) { AttendanceIssue attendanceIssue = db.AttendanceIssues.Find(id); db.AttendanceIssues.Remove(attendanceIssue); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "AttendanceIssueId,PersonId,SchoolId,IsResolved,ResolvedDate,Comment")] AttendanceIssue attendanceIssue) { if (ModelState.IsValid) { db.Entry(attendanceIssue).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PersonId = new SelectList(db.Persons, "PersonId", "GivenName", attendanceIssue.PersonId); ViewBag.SchoolId = new SelectList(db.Schools, "SchoolId", "Name", attendanceIssue.SchoolId); return(View(attendanceIssue)); }
// GET: AttendanceIssues/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AttendanceIssue attendanceIssue = db.AttendanceIssues.Find(id); if (attendanceIssue == null) { return(HttpNotFound()); } return(View(attendanceIssue)); }
// GET: AttendanceIssues/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AttendanceIssue attendanceIssue = db.AttendanceIssues.Find(id); if (attendanceIssue == null) { return(HttpNotFound()); } ViewBag.PersonId = new SelectList(db.Persons, "PersonId", "GivenName", attendanceIssue.PersonId); ViewBag.SchoolId = new SelectList(db.Schools, "SchoolId", "Name", attendanceIssue.SchoolId); return(View(attendanceIssue)); }