Exemplo n.º 1
0
        public ActionResult AddStrength(string name)
        {
            int            id            = (int)TempData["WorkoutID"];
            int            newExerciseId = _dal.AddExercise(id, name);
            ExerciseObject model         = _dal.GetCompleteExercise(newExerciseId);

            return(RedirectToAction("EditStrength", new { id = model.Id }));
        }
Exemplo n.º 2
0
        public void AddWorkoutTest()
        {
            AddWorkout workout = new AddWorkout();

            workout.UserId      = testID;
            workout.WorkoutName = "test workout";
            int worked = _db.AddWorkout(workout); //tests AddWorkout method

            Assert.IsNotNull(worked);

            int testWorkout_Exervise = _db.AddExercise(worked, "Test Exercise"); // tests AddExercise method, returns WE_Id

            Assert.IsNotNull(testWorkout_Exervise);
        }
Exemplo n.º 3
0
        public ActionResult SubmitExercise(Exercise addExercise)
        {
            string[] splitLink = addExercise.VideoLink.Split('=');
            addExercise.VideoLink = "https://www.youtube.com/embed/" + splitLink[1];
            addExercise.TrainerID = ((int)Session[SessionKeys.Trainer_ID]);
            bool AddExercise = _workoutDal.AddExercise(addExercise);

            if (AddExercise)
            {
                TempData["AddExercise"] = true;
            }
            else
            {
                TempData["AddExercise"] = false;
            }

            return(Redirect(Request.UrlReferrer.ToString()));
        }