Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ClothingDetail clothingDetail = db.ClothingDetails.Find(id);

            db.ClothingDetails.Remove(clothingDetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ClothingID,Title,Color,Photo,OccassionID,SeasonID,TypeID")] ClothingDetail clothingDetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(clothingDetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TypeID      = new SelectList(db.ClothingTypes, "TypeID", "ClothingType1", clothingDetail.TypeID);
     ViewBag.OccassionID = new SelectList(db.Occassions, "OccassionsID", "Occassions", clothingDetail.OccassionID);
     ViewBag.SeasonID    = new SelectList(db.Seasons, "SeasonsID", "Seasons", clothingDetail.SeasonID);
     return(View(clothingDetail));
 }
Beispiel #3
0
        //end methods of added views for clothing types

        // GET: ClothingDetails/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ClothingDetail clothingDetail = db.ClothingDetails.Find(id);

            if (clothingDetail == null)
            {
                return(HttpNotFound());
            }
            return(View(clothingDetail));
        }
Beispiel #4
0
        // GET: ClothingDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ClothingDetail clothingDetail = db.ClothingDetails.Find(id);

            if (clothingDetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TypeID      = new SelectList(db.ClothingTypes, "TypeID", "ClothingType1", clothingDetail.TypeID);
            ViewBag.OccassionID = new SelectList(db.Occassions, "OccassionsID", "Occassions", clothingDetail.OccassionID);
            ViewBag.SeasonID    = new SelectList(db.Seasons, "SeasonsID", "Seasons", clothingDetail.SeasonID);
            return(View(clothingDetail));
        }