public ActionResult DeleteConfirmed(int id) { ClothingProperty clothingProperty = db.ClothingProperties.Find(id); db.ClothingProperties.Remove(clothingProperty); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ClothingID,Name,Photo,Color,Season,Occasion")] ClothingProperty clothingProperty) { if (ModelState.IsValid) { db.Entry(clothingProperty).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClothingID = new SelectList(db.Accessories, "AccessoriesID", "Accessories", clothingProperty.ClothingID); ViewBag.ClothingID = new SelectList(db.Bottoms, "BottomsID", "Bottoms", clothingProperty.ClothingID); ViewBag.ClothingID = new SelectList(db.Shoes, "ShoesID", "Shoes", clothingProperty.ClothingID); ViewBag.ClothingID = new SelectList(db.Tops, "TopsID", "Tops", clothingProperty.ClothingID); return(View(clothingProperty)); }
// GET: ClothingProperties/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClothingProperty clothingProperty = db.ClothingProperties.Find(id); if (clothingProperty == null) { return(HttpNotFound()); } return(View(clothingProperty)); }
// GET: ClothingProperties/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClothingProperty clothingProperty = db.ClothingProperties.Find(id); if (clothingProperty == null) { return(HttpNotFound()); } ViewBag.ClothingID = new SelectList(db.Accessories, "AccessoriesID", "Accessories", clothingProperty.ClothingID); ViewBag.ClothingID = new SelectList(db.Bottoms, "BottomsID", "Bottoms", clothingProperty.ClothingID); ViewBag.ClothingID = new SelectList(db.Shoes, "ShoesID", "Shoes", clothingProperty.ClothingID); ViewBag.ClothingID = new SelectList(db.Tops, "TopsID", "Tops", clothingProperty.ClothingID); return(View(clothingProperty)); }