// // GET: /Health/Create public ActionResult Create(int Day, int Time) { var Ex = new Exercises(); Ex.Day = Day; Ex.Time = Time; Ex.DayName = new DatePretty().Prettify(Day); return View(Ex); }
public ActionResult Create(Exercises exercises) { if (ModelState.IsValid) { db.Exercises.Add(exercises); db.SaveChanges(); return RedirectToAction("Index"); } return View(exercises); }
public ActionResult Edit(Exercises exercises) { if (ModelState.IsValid) { db.Entry(exercises).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(exercises); }