public ActionResult DeleteConfirmed(int id) { FormalSho formalSho = db.FormalShoes.Find(id); db.FormalShoes.Remove(formalSho); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "FormalShoesID,FormalShoesName,FormalShoesPhoto,FormalShoesColor,FormalShoesSeason,FormalShoesOccasion,FormalShoesType")] FormalSho formalSho) { if (ModelState.IsValid) { formalSho.FormalShoesPhoto = "~/Content/Images/TuxedoShoes.jpg"; formalSho.FormalShoesType = "Formal"; db.Entry(formalSho).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(formalSho)); }
// GET: FormalShoes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } FormalSho formalSho = db.FormalShoes.Find(id); if (formalSho == null) { return(HttpNotFound()); } return(View(formalSho)); }