public ActionResult DeleteConfirmed(int id) { Excersises excersises = db.Excersises.Find(id); db.Excersises.Remove(excersises); db.SaveChanges(); return(RedirectToAction("Index")); }
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)); }
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)); }
// 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)); }
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)); }