Exemple #1
0
        public ViewAllController()
        {
            _workoutBAL  = new WorkoutBAL();
            _categoryBAL = new CategoryBAL();

            _workouts   = _workoutBAL.GetAllWorkouts();
            _categories = _categoryBAL.GetAllCategories();

            _workoutViewModel = new WorkoutViewModel()
            {
                Workouts   = _workouts,
                Categories = _categories
            };
        }
Exemple #2
0
        public ActionResult DeleteWorkout(int id)
        {
            var isWorkoutDeleted = _workoutBAL.DeleteWorkout(id);

            if (isWorkoutDeleted)
            {
                var workouts = _workoutBAL.GetAllWorkouts();
                _workoutViewModel = new WorkoutViewModel()
                {
                    Workouts = workouts
                };
            }

            return(View("ViewAll", _workoutViewModel));
        }
Exemple #3
0
        public IHttpActionResult Get()
        {
            var result = _workoutBAL.GetAllWorkouts();

            return(Ok(result));
        }