private void LoadPage() { ContestBLL contest = new ContestBLL(int.Parse(ConfigurationManager.AppSettings["ContestID"])); //Allow to vote only if deadline has not passed if (ValidateDeadlineDate(contest.VotingDeadline)) { ContestJudgeBLL judge = (ContestJudgeBLL)Session["ContestJudge"]; int contestEntryId = judge.VoteContestEntryID != null ? (int)judge.VoteContestEntryID : 0; repContestEntries.DataSource = ContestEntryBLL.List(int.Parse(ConfigurationManager.AppSettings["ContestID"]), contestEntryId); repContestEntries.DataBind(); LoadNotificationSettingsModal(contest.VotingDeadline, judge.FirstName); } else { //Load message notifying of voting deadline primaryHeader.InnerHtml = " "; secondaryHeader.Attributes.Add("style", "display:none;"); infoMessage.InnerHtml = "Thank you for signing up as a judge. Unfortunately, the voting deadline for this contest has passed. Look out for future contests you can participate in. Thanks again!"; infoMessage.Attributes.Add("style", "display:block"); //Kill user session and delete cookie to prevent user from voting from another page KillSession(); } }
private void LoadPage() { ContestJudgeBLL judge = (ContestJudgeBLL)Session["ContestJudge"]; int contestEntryId = judge.VoteContestEntryID != null ? (int)judge.VoteContestEntryID : 0; repContestEntries.DataSource = ContestEntryBLL.List(int.Parse(ConfigurationManager.AppSettings["ContestID"]), contestEntryId); repContestEntries.DataBind(); }
private void LoadPage() { //If judge is logged in, set the judge's selected entry //as the contestEntryId variable. int contestEntryId = 0; if (LoadUserFromCookie()) { ContestJudgeBLL judge = (ContestJudgeBLL)Session["ContestJudge"]; contestEntryId = (int)judge.VoteContestEntryID; //If user is logged in, hide button that redirect to register and login page voteButtons.Attributes.Add("style", "display:none"); } repContestEntries.DataSource = ContestEntryBLL.List(int.Parse(ConfigurationManager.AppSettings["ContestID"]), contestEntryId); repContestEntries.DataBind(); }