コード例 #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", 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));
        }
コード例 #2
0
        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.GetUsersPageUrl(), "Users", IsActive: true),
            });

            var items = new List <HyperlinkListPanelItem>();

            var divisionService = ServiceFactory.DivisionService;

            var accountUtil = new AccountUtil(Context);

            foreach (var user in new AccountUtil(Context).GetAllUsers().OrderBy(u => u.UserName))
            {
                string role = (accountUtil.IsUserAnAdmin(user.Id) ? "Administrator" : "");
                role = (accountUtil.IsUserASuperuser(user.Id) ? "Superuser" : role);

                items.Add(new HyperlinkListPanelItem(
                              URL: NavUtil.GetUpdateUserPageUrl(user.Id),
                              Heading: user.UserName + (!String.IsNullOrWhiteSpace(role) ? " (" + role + ")" : ""),
                              Text: user.Email));
            }

            HyperlinkListPanelRenderer.Render(usersList, new HyperlinkListPanelConfig("Users", items));
        }
コード例 #3
0
        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.GetShowReportPageUrl(GetShowId()), "Judge Sheet Report", IsActive: true),
            });

            var showId = GetShowId();
            var show   = ServiceFactory.ShowService.Get(showId);

            labelPageTitle.Text       = show.Name;
            labelPageDescription.Text = show.Description;

            int contestId = Convert.ToInt32(Request.QueryString["contestId"]);

            if (contestId > 0)
            {
                contests = ServiceFactory.ContestService.GetShowContests(showId).Where(c => c.Id == contestId);
            }
            else
            {
                contests = ServiceFactory.ContestService.GetShowContests(showId);
            }
        }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     BreadCrumbUtil.DataBind(Page, new List <BreadCrumb>()
     {
         new BreadCrumb(NavUtil.GetHomePageUrl(), "Home", IsActive: true)
     });
 }
コード例 #5
0
        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.GetUsersPageUrl(), "System Info", IsActive: true),
            });
        }
コード例 #6
0
        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.GetOrganizationsPageUrl(), "Organizations"),
                new BreadCrumb(NavUtil.GetUpdateOrganizationPageUrl(GetOrganizationId()), "Update Organization", IsActive: true),
            });

            labelPageTitle.Text       = "Update the Organization";
            labelPageDescription.Text = "Use the form below to update the organization.";

            organizationForm.GetSubmitButton().Click += new EventHandler(btnUpdateOrganization_Click);
            organizationForm.GetCancelButton().Click += new EventHandler(btnCancel_Click);
        }
コード例 #7
0
        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.GetAddShowPageUrl(), "Add Show", IsActive: true),
            });

            labelPageTitle.Text       = "Add a Show";
            labelPageDescription.Text = "Use the form below to create a new show.";

            showForm.GetSubmitButton().Click += new EventHandler(btnAddShow_Click);
            showForm.GetCancelButton().Click += new EventHandler(btnCancel_Click);
        }
コード例 #8
0
        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.GetUpdateContestPageUrl(GetShowId(), GetContestId()), "Update Contest", IsActive: true),
            });

            labelPageTitle.Text       = "Update the Contest";
            labelPageDescription.Text = "Use the form below to update the contest.";

            contestForm.GetSubmitButton().Click += new EventHandler(btnUpdateContest_Click);
            contestForm.GetCancelButton().Click += new EventHandler(btnCancel_Click);
        }
コード例 #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            BreadCrumbUtil.DataBind(Page, new List <BreadCrumb>()
            {
                new BreadCrumb(NavUtil.GetHomePageUrl(), "Home"),
                new BreadCrumb(NavUtil.GetLoginPageUrl(), "Login", IsActive: true),
            });

            RegisterHyperLink.NavigateUrl = "Register";
            ForgotHyperLink.NavigateUrl   = "Forgot";
            // Enable this once you have account confirmation enabled for password reset functionality
            //ForgotPasswordHyperLink.NavigateUrl = "Forgot";
            //OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"];
            var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);

            if (!String.IsNullOrEmpty(returnUrl))
            {
                RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
            }
        }
コード例 #10
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));
        }
コード例 #11
0
        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.GetShowReportPageUrl(GetShowId()), "Report", IsActive: true),
            });

            var showId = GetShowId();
            var show   = ServiceFactory.ShowService.Get(showId);

            labelPageTitle.Text       = show.Name;
            labelPageDescription.Text = show.Description;

            this.contests = ServiceFactory.ContestService.GetShowContests(showId).Where(c => c.Status == "Complete");
        }
コード例 #12
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", IsActive: true),
            });

            var items = new List <HyperlinkListPanelItem>();

            var showService = ServiceFactory.ShowService;

            foreach (var show in showService.GetAll().OrderByDescending(s => s.Id))
            {
                items.Add(new HyperlinkListPanelItem(URL: NavUtil.GetShowPageUrl(show.Id), Heading: show.Name, Text: show.Description));
            }

            HyperlinkListPanelRenderer.Render(showsList, new HyperlinkListPanelConfig("Talent Shows", items, ButtonAddShowClick));
        }
コード例 #13
0
        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.GetShowReportPageUrl(GetShowId()), "Report", IsActive: true),
            });

            if (Page.IsPostBack)
            {
                var refreshRate = (Convert.ToInt32(dropDownListRefreshRate.SelectedValue) * 60) * 1000;
                refreshTimer.Interval = refreshRate;
            }
            else
            {
                dropDownListRefreshRate.SelectedValue = "5";
                refreshTimer.Interval            = 300000;
                dropDownListStatus.SelectedValue = "In Progress";
            }

            var showId = GetShowId();
            var show   = ServiceFactory.ShowService.Get(showId);

            labelPageTitle.Text       = show.Name;
            labelPageDescription.Text = show.Description;

            this.contests = ServiceFactory.ContestService.GetShowContests(showId);

            var status = dropDownListStatus.SelectedValue;

            if (status != "Any")
            {
                this.contests = this.contests.Where(c => c.Status == status);
            }
        }
コード例 #14
0
        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.GetUsersPageUrl(), "Users"),
                new BreadCrumb(NavUtil.GetUpdateUserPageUrl(GetUserId()), "Update User", IsActive: true),
            });

            this.accountUtil = new AccountUtil(Context);

            labelCannotDeleteUser.Visible = false;

            labelPageTitle.Text       = "Update the User";
            labelPageDescription.Text = "Use the form below to update the user.";

            userForm.GetSubmitButton().Click += new EventHandler(btnUpdateUser_Click);
            userForm.GetCancelButton().Click += new EventHandler(btnCancel_Click);
        }
コード例 #15
0
        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.GetOrganizationsPageUrl(), "Organizations", IsActive: true),
            });

            var items = new List <HyperlinkListPanelItem>();

            var organizationService = ServiceFactory.OrganizationService;

            foreach (var organization in organizationService.GetAll())
            {
                items.Add(new HyperlinkListPanelItem(URL: NavUtil.GetUpdateOrganizationPageUrl(organization.Id), Heading: organization.Name, Text: ""));
            }

            HyperlinkListPanelRenderer.Render(organizationsList, new HyperlinkListPanelConfig("Talent Organizations", items, ButtonAddOrganizationClick));
        }
コード例 #16
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", 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));
        }