public ActionResult DeleteConfirmed(Int32 id) { VolunteerCommitments volunteercommitments = db.VolunteerCommitments.Find(id); db.VolunteerCommitments.Remove(volunteercommitments); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /VolunteerCommitments/Delete/5 public ActionResult Delete(Int32 id) { VolunteerCommitments volunteercommitments = db.VolunteerCommitments.Find(id); if (volunteercommitments == null) { return(HttpNotFound()); } return(View(volunteercommitments)); }
// // GET: /VolunteerCommitments/Edit/5 public ActionResult Edit(Int32 id) { VolunteerCommitments volunteercommitments = db.VolunteerCommitments.Find(id); if (volunteercommitments == null) { return(HttpNotFound()); } //ViewBag.EventID = new SelectList(db.VolunteerEvents, "EventID", "EventName", volunteercommitments.EventID); PopulateEventDropDownList(volunteercommitments.EventID); ViewBag.RoleID = new SelectList(db.VolunteerRoles, "RoleID", "Role", volunteercommitments.RoleID); return(View(volunteercommitments)); }
public ActionResult Edit(VolunteerCommitments volunteercommitments) { if (ModelState.IsValid) { db.Entry(volunteercommitments).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } // ViewBag.EventID = new SelectList(db.VolunteerEvents, "EventID", "EventName", volunteercommitments.EventID); PopulateEventDropDownList(volunteercommitments.EventID); ViewBag.RoleID = new SelectList(db.VolunteerRoles, "RoleID", "Role", volunteercommitments.RoleID); return(View(volunteercommitments)); }
public ActionResult Create(VolunteerCommitments volunteercommitments) { if (ModelState.IsValid) { db.VolunteerCommitments.Add(volunteercommitments); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EventID = new SelectList(db.VolunteerEvents, "EventID", "EventName", volunteercommitments.EventID); PopulateEventDropDownList(volunteercommitments.EventID); ViewBag.RoleID = new SelectList(db.VolunteerRoles, "RoleID", "Role", volunteercommitments.RoleID); return(View(volunteercommitments)); }