public ActionResult DeleteConfirmed(int id) { DimSum dimSum = db.DimSums.Find(id); db.DimSums.Remove(dimSum); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Category,Name,ShortDescription,LongDescription,ThumbnailImage,FullImage,Price")] DimSum dimSum) { if (ModelState.IsValid) { db.Entry(dimSum).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dimSum)); }
public ActionResult Create([Bind(Include = "Id,Category,Name,ShortDescription,LongDescription,ThumbnailImage,FullImage,Price")] DimSum dimSum) { if (ModelState.IsValid) { db.DimSums.Add(dimSum); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(dimSum)); }
// GET: DimSums/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DimSum dimSum = db.DimSums.Find(id); if (dimSum == null) { return(HttpNotFound()); } return(View(dimSum)); }
// GET: DimSums/Details/5 public ActionResult Details(int?id) { // dimsums/details is not valid if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DimSum dimSum = db.DimSums.Find(id); if (dimSum == null) { return(HttpNotFound()); } return(View(dimSum)); }