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

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

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