示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AmazingFeatures amazingFeatures = db.AmazingFeatures.Find(id);

            db.AmazingFeatures.Remove(amazingFeatures);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Id,Icon,Name")] AmazingFeatures amazingFeatures)
 {
     if (ModelState.IsValid)
     {
         db.Entry(amazingFeatures).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(amazingFeatures));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "Id,Icon,Name")] AmazingFeatures amazingFeatures)
        {
            if (ModelState.IsValid)
            {
                db.AmazingFeatures.Add(amazingFeatures);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(amazingFeatures));
        }
示例#4
0
        // GET: Admin/AmazingFeature/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AmazingFeatures amazingFeatures = db.AmazingFeatures.Find(id);

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