public ActionResult DeleteConfirmed(int id) { Footgear footgear = db.Footgears.Find(id); db.Footgears.Remove(footgear); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "FootgearID,Name,Photo,Type,ColorID,SeasonID,OccasionID")] Footgear footgear) { if (ModelState.IsValid) { db.Entry(footgear).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ColorID = new SelectList(db.Colors, "ColorID", "Color1", footgear.ColorID); ViewBag.OccasionID = new SelectList(db.Occasions, "OccasionID", "Occasion1", footgear.OccasionID); ViewBag.SeasonID = new SelectList(db.Seasons, "SeasonID", "Season1", footgear.SeasonID); return(View(footgear)); }
// GET: Footgears/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Footgear footgear = db.Footgears.Find(id); if (footgear == null) { return(HttpNotFound()); } return(View(footgear)); }
// GET: Footgears/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Footgear footgear = db.Footgears.Find(id); if (footgear == null) { return(HttpNotFound()); } ViewBag.ColorID = new SelectList(db.Colors, "ColorID", "Color1", footgear.ColorID); ViewBag.OccasionID = new SelectList(db.Occasions, "OccasionID", "Occasion1", footgear.OccasionID); ViewBag.SeasonID = new SelectList(db.Seasons, "SeasonID", "Season1", footgear.SeasonID); return(View(footgear)); }