Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            NeckAccessory neckAccessory = db.NeckAccessories.Find(id);

            db.NeckAccessories.Remove(neckAccessory);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "NeckAccessoryID,Name,Photo,Type,Color,Season,Occasion")] NeckAccessory neckAccessory)
 {
     if (ModelState.IsValid)
     {
         db.Entry(neckAccessory).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(neckAccessory));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "NeckAccessoryID,Name,Photo,Type,Color,Season,Occasion")] NeckAccessory neckAccessory)
        {
            if (ModelState.IsValid)
            {
                db.NeckAccessories.Add(neckAccessory);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(neckAccessory));
        }
Esempio n. 4
0
        // GET: NeckAccessories/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            NeckAccessory neckAccessory = db.NeckAccessories.Find(id);

            if (neckAccessory == null)
            {
                return(HttpNotFound());
            }
            return(View(neckAccessory));
        }