public ActionResult DeleteConfirmed(int id) { LeisureBottom leisureBottom = db.LeisureBottoms.Find(id); db.LeisureBottoms.Remove(leisureBottom); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "LeisureBottomID,LeisureBottomName,LeisureBottomPhoto,LeisureBottomColor,LeisureBottomSeason,LeisureBottomOccasion,LeisureBottomType")] LeisureBottom leisureBottom) { if (ModelState.IsValid) { leisureBottom.LeisureBottomPhoto = "~/Content/Images/athleticbottom.jpg"; leisureBottom.LeisureBottomType = "Leisure"; db.Entry(leisureBottom).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(leisureBottom)); }
// GET: LeisureBottoms/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LeisureBottom leisureBottom = db.LeisureBottoms.Find(id); if (leisureBottom == null) { return(HttpNotFound()); } return(View(leisureBottom)); }