public ActionResult DeleteConfirmed(int id) { TeamPerson teamPerson = db.TeamPersons.Find(id); db.TeamPersons.Remove(teamPerson); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ID,Image,Name,Category,Description,FacebookUrl,TwitterUrl,InstagramUrl")] TeamPerson teamPerson) { if (ModelState.IsValid) { db.Entry(teamPerson).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(teamPerson)); }
public ActionResult Create([Bind(Include = "ID,Image,Name,Category,Description,FacebookUrl,TwitterUrl,InstagramUrl")] TeamPerson teamPerson) { if (ModelState.IsValid) { db.TeamPersons.Add(teamPerson); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(teamPerson)); }
// GET: TeamPersons/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TeamPerson teamPerson = db.TeamPersons.Find(id); if (teamPerson == null) { return(HttpNotFound()); } return(View(teamPerson)); }