// Get Volunteer info public ActionResult Index() { VolunteerDBhandle dbhandle = new VolunteerDBhandle(); ModelState.Clear(); return(View(dbhandle.GetVolunteer())); }
public ActionResult Edit(int id, VolunteerModel vmodel) { try { VolunteerDBhandle sdb = new VolunteerDBhandle(); sdb.UpdateDetails(vmodel); return(RedirectToAction("Index")); } catch { return(View()); } }
// Delete Volunteer info public ActionResult Delete(int id) { try { VolunteerDBhandle sdb = new VolunteerDBhandle(); if (sdb.DeleteVolunteer(id)) { ViewBag.AlertMsg = "Volunteer Deleted Successfully"; } return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Register(VolunteerModel vmodel) { try { if (ModelState.IsValid) { VolunteerDBhandle sdb = new VolunteerDBhandle(); if (sdb.AddVolunteer(vmodel)) { ViewBag.Message = "Volunteer Details Added Successfully"; ModelState.Clear(); return(RedirectToAction("Index")); } } return(View()); } catch { return(View()); } }
// Edit Volunteer info public ActionResult Edit(int id) { VolunteerDBhandle sdb = new VolunteerDBhandle(); return(View(sdb.GetVolunteer().Find(vmodel => vmodel.Id == id))); }