示例#1
0
        /// <summary>
        /// Retrieves and displays daily stats for a specific past date in a view component
        /// </summary>
        /// <param name="targetDate"></param>
        /// <returns>The PastDayCalStats ViewComponent</returns>
        public IActionResult GetSpecificDayCalStats(string targetDate)
        {
            UserStatsHandler ush = new UserStatsHandler(_userManager, _context);

            MacroNewtUser user = _userManager.GetUserAsync(HttpContext.User).Result;

            return(ViewComponent("PastDayCalStats", ush.GetPastMacroTargets(user, targetDate)));
        }
示例#2
0
        /// <summary>
        /// Retrieves and displays user's current daily stats in a view component
        /// </summary>
        /// <returns>The CurrentDayCalStats ViewComponent</returns>
        public IActionResult GetCurrentDayCalStats()
        {
            UserStatsHandler ush = new UserStatsHandler(_userManager, _context);

            MacroNewtUser user = _userManager.GetUserAsync(HttpContext.User).Result;

            return(ViewComponent("CurrentDayCalStats", ush.GetCurrentMacroTargets(user)));
        }