Beispiel #1
0
        protected void ButtonNextRound_Click(object sender, EventArgs e)
        {
            //Get scores from each end game uc and validate
            List <TableHockeyContestRound> m_enteredRounds = (List <TableHockeyContestRound>)Session["pgEditContestTableEndGame.m_rounds"];

            if (m_enteredRounds != null)
            {
                if (m_currentContest == null)
                {
                    m_currentContest = (TableHockeyContest)Session["pgEditContestTableEndGame.m_currentContest"];
                }
                Dictionary <int, int> m_dictPlayersToNextRound;
                if (ValidateEnteredEndGames(m_enteredRounds, out m_dictPlayersToNextRound))
                {
                    SaveEnteredGameResults();
                    //Increment round number.
                    m_nCurrentRoundNumber++;
                    //Generate games for next round.
                    if (Session["pgEditContestTableEndGame.queueHandler"] != null)
                    {
                        TableHockeyEndGameQueueHandler m_queueHandler = (TableHockeyEndGameQueueHandler)Session["pgEditContestTableEndGame.queueHandler"];
                        m_queueHandler.nextRound(m_dictPlayersToNextRound);

                        //Clear round session.
                        Session["pgEditContestTableEndGame.m_rounds"] = null;
                        Session["ucEndGameSeries.m_round"]            = null;
                        Session["pgEditContestTableEndGame.m_nCurrentRoundNumber"] = m_nCurrentRoundNumber;
                        Session["pgEditContestTableEndGame.queueHandler"]          = m_queueHandler;
                        //Navigate to next round.
                        Response.Redirect("~/pgEditContestTableEndGame.aspx?ContestId=" + m_currentContest.ContestId);
                    }
                }
            }
        }
Beispiel #2
0
        private void initEndGameQueueHandler(List <TableHockeyContestPlayer> i_contestPlayers, int i_nGamesPerRound)
        {
            EndGamePlayerViewModelList m_lstEndGamePlayerViewModel = new EndGamePlayerViewModelList(i_contestPlayers);

            if (Session["pgEditContestTableEndGame.queueHandler"] == null)
            {
                m_queueHandler = new TableHockeyEndGameQueueHandler(m_lstEndGamePlayerViewModel.m_lstContestRankedPlayerId, i_nGamesPerRound, m_nNumberOfRounds);
                Session["pgEditContestTableEndGame.queueHandler"] = m_queueHandler;
            }
            else
            {
                m_queueHandler = (TableHockeyEndGameQueueHandler)Session["pgEditContestTableEndGame.queueHandler"];
            }
            //m_queueHandler.m_nCurrentRoundNumber = m_nCurrentRoundNumber;
        }
Beispiel #3
0
        protected void ButtonPreviousRound_Click(object sender, EventArgs e)
        {
            //Generate games for next round.
            if (Session["pgEditContestTableEndGame.queueHandler"] != null)
            {
                //Decrement round number.
                m_nCurrentRoundNumber--;

                TableHockeyEndGameQueueHandler m_queueHandler = (TableHockeyEndGameQueueHandler)Session["pgEditContestTableEndGame.queueHandler"];
                m_queueHandler.previousRound();

                //Clear round session.
                Session["pgEditContestTableEndGame.m_rounds"] = null;
                Session["ucEndGameSeries.m_round"]            = null;
                Session["pgEditContestTableEndGame.m_nCurrentRoundNumber"] = m_nCurrentRoundNumber;
                Session["pgEditContestTableEndGame.queueHandler"]          = m_queueHandler;
                //Navigate to previous round.
                Response.Redirect("~/pgEditContestTableEndGame.aspx?ContestId=" + m_nContestId);
            }
        }