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

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

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