public ActionResult DeleteConfirmed(int id) { OuterWear outerWear = db.OuterWears.Find(id); db.OuterWears.Remove(outerWear); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "OuterWearID,OuterWearName,OuterWearPhotoURL,OuterWearType,ColorID,OccasionID,SeasonID")] OuterWear outerWear) { if (ModelState.IsValid) { db.Entry(outerWear).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ColorID = new SelectList(db.Colors, "ColorID", "ColorFamily", outerWear.ColorID); ViewBag.OccasionID = new SelectList(db.Occasions, "OccasionID", "OccasionType", outerWear.OccasionID); ViewBag.SeasonID = new SelectList(db.Seasons, "SeasonID", "SeasonName", outerWear.SeasonID); return(View(outerWear)); }
// GET: OuterWears/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OuterWear outerWear = db.OuterWears.Find(id); if (outerWear == null) { return(HttpNotFound()); } return(View(outerWear)); }
// GET: OuterWears/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OuterWear outerWear = db.OuterWears.Find(id); if (outerWear == null) { return(HttpNotFound()); } ViewBag.ColorID = new SelectList(db.Colors, "ColorID", "ColorFamily", outerWear.ColorID); ViewBag.OccasionID = new SelectList(db.Occasions, "OccasionID", "OccasionType", outerWear.OccasionID); ViewBag.SeasonID = new SelectList(db.Seasons, "SeasonID", "SeasonName", outerWear.SeasonID); return(View(outerWear)); }