Пример #1
0
 public IActionResult OnGet()
 {
     IsUserAbleToStart = surveyData.CheckIfUserHaveDoneSurveyThisWeek(userManager.GetUserId(HttpContext.User));
     if (!IsUserAbleToStart)
     {
         return(RedirectToPage("./SurveyCompleted"));
     }
     return(Page());
 }
Пример #2
0
        public IActionResult OnGet()
        {
            string userId = userManager.GetUserId(HttpContext.User);

            IsSurveyNotCompleted = surveyData.CheckIfUserHaveDoneSurveyThisWeek(userId);
            if (IsSurveyNotCompleted)
            {
                return(RedirectToPage("./Survey"));
            }
            Teams = teamData.GetUserTeams(userId);
            foreach (var team in Teams)
            {
                var averages = averagesCalculate.GetSurveysAverages(team);
                AverageWeeks.Add(team.Name, averages);
                if (team.OpinionsVisible == true)
                {
                    var opinions = averagesCalculate.GetOpinionsFromCurrentWeek(team, AveragesCalculate.GetCurrentWeek());
                    TeamsOpinions.Add(team.Name, opinions);
                }
            }
            return(Page());
        }
Пример #3
0
 public void OnGet()
 {
     WeekNumber        = AveragesCalculate.GetCurrentWeek();
     IsUserAbleToStart = surveyData.CheckIfUserHaveDoneSurveyThisWeek(userManager.GetUserId(HttpContext.User));
 }