Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ClothingProperty clothingProperty = db.ClothingProperties.Find(id);

            db.ClothingProperties.Remove(clothingProperty);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
        // 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));
        }
Ejemplo n.º 4
0
        // 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));
        }