public ActionResult DeleteConfirmed(int id) { InformalSho informalSho = db.InformalShoes.Find(id); db.InformalShoes.Remove(informalSho); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "InformalShoesID,InformalShoesName,InformalShoesPhoto,InformalShoesColor,InformalShoesSeason,InformalShoesOccasion,InformalShoesType")] InformalSho informalSho) { if (ModelState.IsValid) { informalSho.InformalShoesPhoto = "~/Content/Images/boots.jpg"; informalSho.InformalShoesType = "Informal"; db.Entry(informalSho).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(informalSho)); }
// GET: InformalShoes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } InformalSho informalSho = db.InformalShoes.Find(id); if (informalSho == null) { return(HttpNotFound()); } return(View(informalSho)); }