public ActionResult DeleteConfirmed(int id) { CandidateListing candidateListing = db.CandidateListings.Find(id); db.CandidateListings.Remove(candidateListing); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,FullName,PhotoItem,Icon,Work,Location,Price,Skills")] CandidateListing candidateListing) { if (ModelState.IsValid) { db.Entry(candidateListing).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidateListing)); }
public ActionResult Create([Bind(Include = "Id,FullName,PhotoItem,Icon,Work,Location,Price,Skills")] CandidateListing candidateListing) { if (ModelState.IsValid) { db.CandidateListings.Add(candidateListing); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(candidateListing)); }
// GET: Admin/CandidateListings/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CandidateListing candidateListing = db.CandidateListings.Find(id); if (candidateListing == null) { return(HttpNotFound()); } return(View(candidateListing)); }