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

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

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