Esempio n. 1
0
        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));
        }