Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            ExcersiseCategories excersiseCategories = db.ExcersiseCategories.Find(id);

            db.ExcersiseCategories.Remove(excersiseCategories);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,ExcersiseCategoryName")] ExcersiseCategories excersiseCategories)
 {
     if (ModelState.IsValid)
     {
         db.Entry(excersiseCategories).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(excersiseCategories));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,ExcersiseCategoryName")] ExcersiseCategories excersiseCategories)
        {
            if (ModelState.IsValid)
            {
                db.ExcersiseCategories.Add(excersiseCategories);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

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

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