//method: Insert a New Opportunity public bool commitInsertO(volunteer_opportunity o) { using (objVolunteers) { objVolunteers.volunteer_opportunities.InsertOnSubmit(o); objVolunteers.SubmitChanges(); return(true); } }
public ActionResult Admin_oppDelete(int id, volunteer_opportunity opp) { ViewBag.Group = "Admin"; try { objVol.commitDeleteO(id); return(RedirectToAction("VolunteerAdmin_Index")); } catch { return(View()); } }
public ActionResult Admin_oppInsert([Bind(Include = "o_name, o_regular, o_date, o_day, o_start, o_end, o_location, o_description")] volunteer_opportunity o) { ViewBag.Group = "Admin"; if (ModelState.IsValid) { try { objVol.commitInsertO(o); return(RedirectToAction("VolunteerAdmin_Index")); } catch { return(View()); } } return(View()); }
public ActionResult Admin_oppUpdate([Bind(Include = "o_name, o_regular, o_date, o_day, o_start, o_end, o_location, o_description")] int id, volunteer_opportunity opp) { ViewBag.Group = "Admin"; if (ModelState.IsValid) { try { objVol.commitUpdateO(id, opp.o_name, opp.o_regular, opp.o_date, opp.o_start, opp.o_end, opp.o_day, opp.o_location, opp.o_description); return(RedirectToAction("Admin_oppDetails/" + id)); } catch { return(View()); } } return(View()); }