Esempio n. 1
0
        // GET: Statistics/All
        public async Task <ActionResult> All()
        {
            var user = await userManager.FindByIdAsync(User.Identity.GetUserId());

            AllStatisticsViewModel statisticsVM = new AllStatisticsViewModel();

            statisticsVM.TotalStatistics.WorkoutsNum  = statisticsService.CountWorkouts(user.Id);
            statisticsVM.TotalStatistics.ExercisesNum = statisticsService.CountExercises(user.Id);
            statisticsVM.TotalStatistics.SetsNum      = statisticsService.CountSets(user.Id);
            statisticsVM.TotalStatistics.TotalWeight  = statisticsService.CountTotalWeight(user.Id);
            statisticsVM.FavoriteExerciseTypes        = statisticsService.GetFavoriteExerciseTypes(user.Id, 5);
            return(View(statisticsVM));
        }