protected void Page_Load(object sender, EventArgs e) { Model = Session[theModel] as Model; if (Model == null) { this.Response.Redirect("~/login.aspx"); } object value = Session["od4"]; bool bod4 = false; if (value != null) { bod4 = (bool)value; } Model.Controller.IsOD4 = bod4; ThisDate = DateTime.Today; SetMessage(String.Empty); AvailableReports = new List <string>(); AvailableReportsDescr = new List <string>(); AddRepors(AvailableReports); AddReporDescriptions(AvailableReportsDescr); ValidOptionsNH = AddOptions(false); ValidOptionsH = AddOptions(true); Session[ValidH] = ValidOptionsH; Session[ValidNH] = ValidOptionsNH; // build {"EDM":' EDM = "{" + Model.Controller.AddQuotes("EDM") + ":"; Content = "," + Model.Controller.AddQuotes("CONTENT") + ":"; if (!this.IsPostBack) { SetMode("*"); Calendar1.TodaysDate = DateTime.Today; Calendar1.SelectedDate = Calendar1.TodaysDate; SetDemo(); Session[ParmsAltered] = new List <string>(); MyVisibilities = new Visibilities(); MyVisibilities.SetOperations(Visibilities.Operations.gurnist); } else { if (Session.Count > 0) { foreach (var k in Session.Keys) { switch (k.ToString()) { case SesShowRep: { ReportsShown = (bool)Session[SesShowRep]; break; } case SesHasParm: { HasParmChose = (bool)Session[SesHasParm]; break; } case ShowAgenda: { showAgenda = (bool)Session[ShowAgenda]; break; } default: break; } } } } }