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); }
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; }
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); } }
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)); }
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); }