コード例 #1
0
        public ActionResult MaxAttemptInput(MaxAttempt maxAttempt)
        {
            if (ModelState.IsValid)
            {
                double dweight = System.Convert.ToDouble(maxAttempt.Weight);
                double dreps = System.Convert.ToDouble(maxAttempt.Reps);
                maxAttempt.CalculatedMax = System.Convert.ToInt16(.0333 * dweight * dreps + dweight);
                db.MaxAttempts.Add(maxAttempt);
                db.SaveChanges();
                return RedirectToAction("MaxAttemptList", "Fitness");
            }

            return View(maxAttempt);
        }
コード例 #2
0
 public ActionResult MaxAttemptInput()
 {
     MaxAttempt maxAttempt = new MaxAttempt();
     ViewBag.exerciseList = new SelectList(ExerciseList(), "Value", "Text");
     return View(maxAttempt);
 }