protected void Page_Load(object sender, EventArgs e)
        {
            contest = ServiceFactory.ContestService.Get(GetContestId());
            var currentUserId = HttpContext.Current.User.Identity.GetUserId();

            judge = contest.Judges.FirstOrDefault(j => j.UserId == currentUserId);
        }
Beispiel #2
0
        private void Init(int id, Contestant contestant, Judge judge, ICollection <ScorableCriterion> scorableCriteria)
        {
            ValidateConstructorArgs(id, contestant, judge, scorableCriteria);

            Id               = id;
            Contestant       = contestant;
            Judge            = judge;
            ScorableCriteria = scorableCriteria;
        }
Beispiel #3
0
 private static void ValidateConstructorArgs(int id, Contestant contestant, Judge judge, ICollection <ScorableCriterion> scorableCriteria)
 {
     if (contestant == null)
     {
         throw new ApplicationException("A score card cannot be created without a contestant. Score Card Id: " + id);
     }
     if (judge == null)
     {
         throw new ApplicationException("A score card cannot be created without a judge. Score Card Id: " + id);
     }
     if (scorableCriteria.IsNullOrEmpty())
     {
         throw new ApplicationException("A score card cannot be created without scorable score criteria. Score Card Id: " + id);
     }
 }
Beispiel #4
0
        public ScoreCard GetBlankScoreCard(Contestant contestant, Judge judge)
        {
            if (!Judges.Any(j => j.Id == judge.Id))
            {
                throw new ApplicationException("Only judges belonging to the contest can get a blank score card.");
            }

            var scorableCriteria = new List <ScorableCriterion>();

            foreach (ScoreCriterion scoreCriterion in ScoreCriteria)
            {
                scorableCriteria.Add(new ScorableCriterion(scoreCriterion));
            }

            return(new ScoreCard(contestant, judge, scorableCriteria));
        }
Beispiel #5
0
 public ScoreCard(Contestant contestant, Judge judge, ICollection <ScorableCriterion> scorableCriteria)
 {
     Init(0, contestant, judge, scorableCriteria);
 }
 private string GetJudgeDescriptionText(TalentShow.Judge judge)
 {
     return("");
 }
 private string GetJudgeHeadingText(TalentShow.Judge judge)
 {
     return(new AccountUtil(Context).GetUser(judge.UserId).UserName);
 }