public ActionResult DeleteConfirmed(int id) { EmpVolunteer empVolunteer = db.EmpVolunteers.Find(id); db.EmpVolunteers.Remove(empVolunteer); db.SaveChanges(); return(RedirectToAction("Create")); }
public ActionResult Edit([Bind(Include = "empVolID,empID,OrganizationName,OrganizationAddress,StartDate,EndDate,HoursVolunteered,InvolveTypeID,OrganizationNature")] EmpVolunteer empVolunteer) { if (ModelState.IsValid) { db.Entry(empVolunteer).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create")); } return(View(empVolunteer)); }
public ActionResult Create([Bind(Prefix = "Item1", Include = "empVolID,empID,OrganizationName,OrganizationAddress,StartDate,EndDate,HoursVolunteered,InvolveTypeID,OrganizationNature")] EmpVolunteer empVolunteer) { if (ModelState.IsValid) { db.EmpVolunteers.Add(empVolunteer); db.SaveChanges(); return(RedirectToAction("Create")); } return(View(empVolunteer)); }
// GET: VoluntaryWorkInvolvement/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EmpVolunteer empVolunteer = db.EmpVolunteers.Find(id); if (empVolunteer == null) { return(HttpNotFound()); } return(View(empVolunteer)); }