protected void Page_Load(object sender, EventArgs e) { RedirectUtil.RedirectUnauthenticatedUserToLoginPage(); BreadCrumbUtil.DataBind(Page, new List <BreadCrumb>() { new BreadCrumb(NavUtil.GetHomePageUrl(), "Home"), new BreadCrumb(NavUtil.GetShowsPageUrl(), "Shows"), new BreadCrumb(NavUtil.GetShowPageUrl(GetShowId()), "Show", IsActive: true), }); var items = new List <HyperlinkListPanelItem>(); var showId = GetShowId(); var show = ServiceFactory.ShowService.Get(showId); labelPageTitle.Text = show.Name; labelPageDescription.Text = show.Description; this.contests = ServiceFactory.ContestService.GetShowContests(showId); if (!IsUserAnAdmin()) { var currentUserId = Context.User.Identity.GetUserId(); contests = contests.Where(c => (c.Judges.Any(j => j.UserId == currentUserId) || c.TimeKeeperId == currentUserId) && c.Status == "In Progress").ToList(); } foreach (var contest in contests) { items.Add(new HyperlinkListPanelItem(URL: NavUtil.GetContestPageUrl(showId, contest.Id), Heading: contest.Name + " (" + contest.Status + ")", Text: contest.Description)); } HyperlinkListPanelRenderer.Render(contestsList, new HyperlinkListPanelConfig("Contests", items, ButtonAddContestClick)); }
protected void Page_Load(object sender, EventArgs e) { RedirectUtil.RedirectUnauthenticatedUserToLoginPage(); RedirectUtil.RedirectNonAdminUserToHomePage(); BreadCrumbUtil.DataBind(Page, new List <BreadCrumb>() { new BreadCrumb(NavUtil.GetHomePageUrl(), "Home"), new BreadCrumb(NavUtil.GetShowsPageUrl(), "Shows"), new BreadCrumb(NavUtil.GetShowPageUrl(GetShowId()), "Show"), new BreadCrumb(NavUtil.GetContestPageUrl(GetShowId(), GetContestId()), "Contest"), new BreadCrumb(NavUtil.GetAddScoreCriterionPageUrl(GetShowId(), GetContestId()), "Add Score Criterion", IsActive: true), }); labelPageTitle.Text = "Add a Score Criterion"; labelPageDescription.Text = "Use the form below to create a new score criterion."; scoreCriterionForm.GetSubmitButton().Click += new EventHandler(btnAddScoreCriterion_Click); scoreCriterionForm.GetCancelButton().Click += new EventHandler(btnCancel_Click); }
protected void Page_Load(object sender, EventArgs e) { RedirectUtil.RedirectUnauthenticatedUserToLoginPage(); RedirectUtil.RedirectNonAdminUserToHomePage(); BreadCrumbUtil.DataBind(Page, new List <BreadCrumb>() { new BreadCrumb(NavUtil.GetHomePageUrl(), "Home"), new BreadCrumb(NavUtil.GetShowsPageUrl(), "Shows"), new BreadCrumb(NavUtil.GetShowPageUrl(GetShowId()), "Show"), new BreadCrumb(NavUtil.GetContestPageUrl(GetShowId(), GetContestId()), "Contest"), new BreadCrumb(NavUtil.GetUpdateJudgePageUrl(GetShowId(), GetContestId(), GetJudgeId()), "Update Judge", IsActive: true), }); labelPageTitle.Text = "Update the Judge"; labelPageDescription.Text = "Use the form below to update the judge."; judgeForm.GetSubmitButton().Click += new EventHandler(btnUpdateJudge_Click); judgeForm.GetCancelButton().Click += new EventHandler(btnCancel_Click); }
protected void Page_Load(object sender, EventArgs e) { RedirectUtil.RedirectUnauthenticatedUserToLoginPage(); BreadCrumbUtil.DataBind(Page, new List <BreadCrumb>() { new BreadCrumb(NavUtil.GetHomePageUrl(), "Home"), new BreadCrumb(NavUtil.GetShowsPageUrl(), "Shows"), new BreadCrumb(NavUtil.GetShowPageUrl(GetShowId()), "Show"), new BreadCrumb(NavUtil.GetContestPageUrl(GetShowId(), GetContestId()), "Contest"), new BreadCrumb(NavUtil.GetContestantPageUrl(GetShowId(), GetContestId(), GetContestantId()), "Contestant", IsActive: true), }); var contestantId = GetContestantId(); this.contestant = ServiceFactory.ContestantService.Get(contestantId); this.contest = ServiceFactory.ContestService.Get(GetContestId()); this.scoreCards = ServiceFactory.ScoreCardService.GetContestantScoreCards(contestantId); var performers = ServiceFactory.PerformerService.GetContestantPerformers(contestantId); labelPageTitle.Text = GetContestantHeadingText(performers); labelPageDescription.Text = GetContestantDescriptionText(contestant); if (!IsUserAnAdmin()) { return; } var performerItems = new List <HyperlinkListPanelItem>(); foreach (var performer in performers) { var url = NavUtil.GetUpdatePerformerPageUrl(GetShowId(), GetContestId(), GetContestantId(), performer.Id); var heading = GetPerformerHeadingText(performer); var text = GetPerformerDescriptionText(performer); performerItems.Add(new HyperlinkListPanelItem(url, heading, text)); } HyperlinkListPanelRenderer.Render(performersList, new HyperlinkListPanelConfig("Performers", performerItems, ButtonAddPerformerClick)); }
protected void Page_Load(object sender, EventArgs e) { RedirectUtil.RedirectUnauthenticatedUserToLoginPage(); BreadCrumbUtil.DataBind(Page, new List <BreadCrumb>() { new BreadCrumb(NavUtil.GetHomePageUrl(), "Home"), new BreadCrumb(NavUtil.GetShowsPageUrl(), "Shows"), new BreadCrumb(NavUtil.GetShowPageUrl(GetShowId()), "Show"), new BreadCrumb(NavUtil.GetContestPageUrl(GetShowId(), GetContestId()), "Contest", IsActive: true), }); var showId = GetShowId(); var show = ServiceFactory.ShowService.Get(showId); var contestId = GetContestId(); this.contest = ServiceFactory.ContestService.Get(contestId); labelPageTitle.Text = contest.Name + " (" + contest.Status + ")"; labelPageDescription.Text = contest.Description; if (IsAllowedToViewContestantsList()) { var contestantItems = new List <HyperlinkListPanelItem>(); foreach (var contestant in contest.Contestants) { var url = NavUtil.GetContestantPageUrl(showId, contestId, contestant.Id); var heading = GetContestantHeadingText(contestant); var text = GetContestantDescriptionText(contestant); contestantItems.Add(new HyperlinkListPanelItem(url, heading, text)); } HyperlinkListPanelRenderer.Render(contestantsList, new HyperlinkListPanelConfig("Contestants", contestantItems, ButtonAddContestantClick)); } if (!IsUserAnAdmin()) { return; } var judgeItems = new List <HyperlinkListPanelItem>(); foreach (var judge in contest.Judges) { var url = NavUtil.GetUpdateJudgePageUrl(showId, contestId, judge.Id); var heading = GetJudgeHeadingText(judge); var text = GetJudgeDescriptionText(judge); judgeItems.Add(new HyperlinkListPanelItem(url, heading, text)); } HyperlinkListPanelRenderer.Render(judgesList, new HyperlinkListPanelConfig("Judges", judgeItems, ButtonAddJudgeClick)); var scoreCriterionItems = new List <HyperlinkListPanelItem>(); foreach (var scoreCriterion in contest.ScoreCriteria) { var url = NavUtil.GetUpdateScoreCriterionPageUrl(showId, contestId, scoreCriterion.Id); var heading = GetScoreCriterionHeadingText(scoreCriterion); var text = GetScoreCriterionDescriptionText(scoreCriterion); scoreCriterionItems.Add(new HyperlinkListPanelItem(url, heading, text)); } HyperlinkListPanelRenderer.Render(scoreCriteriaList, new HyperlinkListPanelConfig("Score Criteria", scoreCriterionItems, ButtonAddScoreCriterionClick)); }