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