Пример #1
0
 private void SavePageState(PlayerGroupPageState pagestate)
 {
     Session["PlayerGroupPageState"] = pagestate;
 }
Пример #2
0
        private PlayerGroupPageState GetPageState()
        {
            try
            {
                PlayerGroupPageState pagestate = new PlayerGroupPageState();

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

                    pagestate.AccountID = accountid;
                    pagestate.PlayerGroupName = String.Empty;
                    pagestate.Description = String.Empty;
                    pagestate.IncludeInactive = false;
                    pagestate.SortBy = "PlayerGroupName";
                    pagestate.AscDesc = "Ascending";
                    pagestate.PageNumber = 1;
                    Session["PlayerGroupPageState"] = pagestate;
                }
                else
                {
                    pagestate = (PlayerGroupPageState)Session["PlayerGroupPageState"];
                }
                return pagestate;
            }
            catch { return new PlayerGroupPageState(); }
        }