public ActionResult DeleteConfirmed(int id) { CandidateGrid candidateGrid = db.Candidates.Find(id); db.Candidates.Remove(candidateGrid); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name,Email,Description,Office,PrimaryPhone,Status,City,ActionCreatedOn")] CandidateGrid candidateGrid) { if (ModelState.IsValid) { db.Entry(candidateGrid).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidateGrid)); }
// GET: CandidateGrids/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateGrid candidateGrid = db.Candidates.Find(id); if (candidateGrid == null) { return(HttpNotFound()); } return(View(candidateGrid)); }