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

            db.Excersises.Remove(excersises);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,ExcersiseName,Description,ShortDescript")] Excersises excersises)
 {
     if (ModelState.IsValid)
     {
         db.Entry(excersises).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(excersises));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "Id,ExcersiseName,Description,ShortDescript")] Excersises excersises)
        {
            if (ModelState.IsValid)
            {
                db.Excersises.Add(excersises);
                db.SaveChanges();
                int excersiseId = excersises.Id;
                return(RedirectToAction("Details", "Excersises", new { Id = excersiseId }));
            }

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

            if (excersises == null)
            {
                return(HttpNotFound());
            }
            return(View(excersises));
        }
Exemplo n.º 5
0
        public PartialViewResult DetailsModal(int?id)
        {
            if (id == null)
            {
                //return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
            }
            Excersises excersises = db.Excersises.Find(id);

            if (excersises == null)
            {
                //return HttpNotFound();
            }
            return(PartialView(excersises));
        }