コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Wardrobe_Items wardrobe_Items = db.Wardrobe_Items.Find(id);

            db.Wardrobe_Items.Remove(wardrobe_Items);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "ItemID,TypeID,Name,Photo,Color,Season,Occasion")] Wardrobe_Items wardrobe_Items)
 {
     if (ModelState.IsValid)
     {
         db.Entry(wardrobe_Items).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.TypeID = new SelectList(db.Categorty_Type, "TypeId", "Categories", wardrobe_Items.TypeID);
     return(View(wardrobe_Items));
 }
コード例 #3
0
        // GET: Wardrobe_Items/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Wardrobe_Items wardrobe_Items = db.Wardrobe_Items.Find(id);

            if (wardrobe_Items == null)
            {
                return(HttpNotFound());
            }
            return(View(wardrobe_Items));
        }
コード例 #4
0
        // GET: Wardrobe_Items/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Wardrobe_Items wardrobe_Items = db.Wardrobe_Items.Find(id);

            if (wardrobe_Items == null)
            {
                return(HttpNotFound());
            }
            ViewBag.TypeID = new SelectList(db.Categorty_Type, "TypeId", "Categories", wardrobe_Items.TypeID);
            return(View(wardrobe_Items));
        }