Ejemplo n.º 1
0
 private void SavePageState(PlayerPageState pagestate)
 {
     Session["PlayerPageState"] = pagestate;
 }
Ejemplo n.º 2
0
        private PlayerPageState GetPageState()
        {
            try
            {
                PlayerPageState pagestate = new PlayerPageState();

                // Initialize the session values if they don't exist - need to do this the first time controller is hit
                if (Session["PlayerPageState"] == null)
                {
                    int accountid = 0;
                    if (Session["UserAccountID"] != null)
                        accountid = Convert.ToInt32(Session["UserAccountID"]);

                    pagestate.AccountID = accountid;
                    pagestate.PlayerGroupID = 0;
                    pagestate.PlayerName = String.Empty;
                    pagestate.IncludeInactive = false;
                    pagestate.SortBy = "PlayerName";
                    pagestate.AscDesc = "Ascending";
                    pagestate.PageNumber = 1;
                    Session["PlayerPageState"] = pagestate;
                }
                else
                {
                    pagestate = (PlayerPageState)Session["PlayerPageState"];
                }
                return pagestate;
            }
            catch { return new PlayerPageState(); }
        }