Ejemplo n.º 1
0
 public IActionResult OnGet()
 {
     IsUserAbleToStart = surveyData.CheckIfUserHaveDoneSurveyThisWeek(userManager.GetUserId(HttpContext.User));
     if (!IsUserAbleToStart)
     {
         return(RedirectToPage("./SurveyCompleted"));
     }
     return(Page());
 }
Ejemplo n.º 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());
        }
Ejemplo n.º 3
0
 public void OnGet()
 {
     WeekNumber        = AveragesCalculate.GetCurrentWeek();
     IsUserAbleToStart = surveyData.CheckIfUserHaveDoneSurveyThisWeek(userManager.GetUserId(HttpContext.User));
 }