public ActionResult DeleteConfirmed(int id) { BestPicture bestPicture = db.bestPicture.Find(id); db.bestPicture.Remove(bestPicture); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "bestPictureID,movieID,year,winner")] BestPicture bestPicture) { if (ModelState.IsValid) { db.Entry(bestPicture).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bestPicture)); }
public ActionResult Create([Bind(Include = "bestPictureID,movieID,year,winner")] BestPicture bestPicture) { if (ModelState.IsValid) { db.bestPicture.Add(bestPicture); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(bestPicture)); }
// GET: BestPictures/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BestPicture bestPicture = db.bestPicture.Find(id); if (bestPicture == null) { return(HttpNotFound()); } return(View(bestPicture)); }