public bool commitVoInsert(volunteer_application_form vol) { //to ensure all data will be disposed of when finished using (objVol) { //using our model to set table columns to new values being passed and providing it to the insert command objVol.volunteer_application_forms.InsertOnSubmit(vol); //commit insert with db objVol.SubmitChanges(); return(true); } }
public ActionResult AppDetails(volunteer_application_form app) { var oppID = (int)TempData["id"]; var vol = objVol.getApplications(oppID); if (vol == null) { return(View("Error")); } else { return(View(vol)); } }
public ActionResult VolunteerInsert(volunteer_application_form vol) { if (ModelState.IsValid) { try { vol.oppID = (int)TempData["id"]; objVol.commitVoInsert(vol); return(RedirectToAction("VolunteerIndex")); //On sucessful insert, redirect to the index view } catch { //Error handling, return to Donation view if something goes wrong return(View()); } } return(View()); }