public ActionResult DeleteConfirmed(int id)
        {
            Accessories2 accessories2 = db.Accessories2.Find(id);

            db.Accessories2.Remove(accessories2);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "AccessoryID,Name,Photo,Type,Color,SeasonID,OccassionID")] Accessories2 accessories2)
 {
     if (ModelState.IsValid)
     {
         db.Entry(accessories2).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.OccassionID = new SelectList(db.Occassions, "OccassionID", "OccassionName", accessories2.OccassionID);
     ViewBag.SeasonID    = new SelectList(db.Seasons, "SeasonID", "SeasonName", accessories2.SeasonID);
     return(View(accessories2));
 }
 public ActionResult Edit([Bind(Include = "Accessory2ID,Accessory2Name,Accessory2Photo,Accessory2TypeID,Accessory2ColorID,Accessory2SeasonID,Accessory2OccassionID")] Accessories2 accessories2)
 {
     if (ModelState.IsValid)
     {
         db.Entry(accessories2).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Accessory2ColorID     = new SelectList(db.Accessory2Colors, "Accessory2ColorID", "Accessory2ColorName", accessories2.Accessory2ColorID);
     ViewBag.Accessory2OccassionID = new SelectList(db.Accessory2Occassions, "Accessory2OccassionID", "Accessory2OccassionName", accessories2.Accessory2OccassionID);
     ViewBag.Accessory2SeasonID    = new SelectList(db.Accessory2Seasons, "Accessory2SeasonID", "Accessory2SeasonName", accessories2.Accessory2SeasonID);
     ViewBag.Accessory2TypeID      = new SelectList(db.Accessory2Types, "Accessory2TypeID", "Accessory2TypeName", accessories2.Accessory2TypeID);
     return(View(accessories2));
 }
        // GET: Accessories2/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Accessories2 accessories2 = db.Accessories2.Find(id);

            if (accessories2 == null)
            {
                return(HttpNotFound());
            }
            return(View(accessories2));
        }
Exemplo n.º 5
0
        // GET: Accessories2/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Accessories2 accessories2 = db.Accessories2.Find(id);

            if (accessories2 == null)
            {
                return(HttpNotFound());
            }
            ViewBag.OccassionID = new SelectList(db.Occassions, "OccassionID", "OccassionName", accessories2.OccassionID);
            ViewBag.SeasonID    = new SelectList(db.Seasons, "SeasonID", "SeasonName", accessories2.SeasonID);
            return(View(accessories2));
        }