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