public ActionResult Edit([Bind(Include = "Id,FirstName,LastName,Email,Company,Offerings")] VolunteerDonor volunteerDonor) { if (ModelState.IsValid) { service.Edit(volunteerDonor); return(RedirectToAction("Index")); } return(View(volunteerDonor)); }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } VolunteerDonor volunteerDonor = service.GetVolunteerDonorById((int)id); if (volunteerDonor == null) { return(HttpNotFound()); } return(View(volunteerDonor)); }
public void Edit(VolunteerDonor toEdit) { repo.Edit(toEdit); }
public void Delete(VolunteerDonor toDelete) { repo.Delete(toDelete); }
public void Add(VolunteerDonor toAdd) { repo.Add(toAdd); }
public void Edit(VolunteerDonor toEdit) { db.Entry(toEdit).State = EntityState.Modified; db.SaveChanges(); }
public void Delete(VolunteerDonor toDelete) { db.VolunteerDonors.Remove(toDelete); db.SaveChanges(); }
public void Add(VolunteerDonor toAdd) { db.VolunteerDonors.Add(toAdd); db.SaveChanges(); }