protected new void Page_Init(object sender, EventArgs e)
        {
            base.Page_Init(sender, e);

            if (Tile == null) return;

            _level = (Thinkgate.Base.Enums.EntityTypes)Tile.TileParms.GetParm("level");
            _levelID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("levelID"));
            ctlRotator = (Interfaces.IRotatorControl)Tile.TileParms.GetParm("ctlDoublePanel");

            studentsearch_hiddenLevel.Value = _level.ToString();
            studentsearch_hiddenLevelID.Value = Standpoint.Core.Classes.Encryption.EncryptInt(_levelID);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            /****************************************************************
             * if user does not have Tab_Search_Staff permissions, then hide
             * the search tab and the radPageView associated with it.
             * *************************************************************/
            if (!UserHasPermission(Permission.Tab_Search_Staff))
            {
                radPageViewTeacherSearch.Visible = false;
                foreach (Telerik.Web.UI.RadTab tab in RadTabStrip2.Tabs)
                {
                    if (tab.Text == "Search")
                    {
                        tab.Visible = false;
                        break;
                    }
                }
            }

            /*******************************************************************
             * If user does not have Icon_Expanded_Staff permissions, then hide
             * the "Advanced Search" link via its surrounding div tag.
             * ****************************************************************/
            TeacherSearch_DivAdvancedSearch.Visible = (UserHasPermission(Permission.Icon_ExpandedSearch_Staff));

            _level = (Thinkgate.Base.Enums.EntityTypes)Tile.TileParms.GetParm("level");
            _levelID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("levelID"));
            _levelType = Tile.TileParms.GetParm("levelType") != null ? Tile.TileParms.GetParm("levelType").ToString() : String.Empty;

            teacherSearch_HiddenLevel.Value = _level.ToString();
            teacherSearch_HiddenLevelID.Value = Standpoint.Core.Classes.Encryption.EncryptInt(_levelID);
            teacherPieChartXmlHttpPanel.Value = string.Empty;

            List<AsyncPageTask> taskList = new List<AsyncPageTask>();
            taskList.Add(new AsyncPageTask(LoadTeacherCounts));
            taskList.Add(new AsyncPageTask(LoadDistrictParmsForPie));

            foreach (AsyncPageTask page in taskList)
            {
                PageAsyncTask newTask = new PageAsyncTask(page.OnBegin, page.OnEnd, page.OnTimeout, "TeacherSearch", true);
                Page.RegisterAsyncTask(newTask);
            }
            taskList = null;
            Page.ExecuteRegisteredAsyncTasks();

            LoadPieChart();

            if (IsPostBack)
            {
                // Reloads previous search results if session object search text has a value
                if (teachersSearchText_smallTile.Value == "Search by last name..." && !string.IsNullOrEmpty(SessionObject.TeacherSearchTxtPostBack_smallTile)
                        && SessionObject.TeacherSearchTxtPostBack_smallTile.Length > 0)
                {
                    SearchTeachersByLastName_Click(null, null);
                }

                return;
            }

            teacherSearchMoreLink.Visible = false;
            teachersSearchTileGrid.Visible = false;
            addNewStaff.Visible = UserHasPermission(Base.Enums.Permission.Create_Staff);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            /****************************************************************
             * if user does not have Tab_Search_Staff permissions, then hide
             * the search tab and the radPageView associated with it.
             * *************************************************************/
            if (!UserHasPermission(Permission.Tab_Search_Staff))
            {
                radPageViewStaffSearch.Visible = false;
                foreach (Telerik.Web.UI.RadTab tab in RadTabStrip2.Tabs)
                {
                    if (tab.Text == "Search")
                    {
                        tab.Visible = false;
                        break;
                    }
                }
            }

            /*******************************************************************
             * If user does not have Icon_Expanded_Staff permissions, then hide
             * the "Advanced Search" link via its surrounding div tag.
             * ****************************************************************/
            StaffSearch_DivAdvancedSearch.Visible = (UserHasPermission(Permission.Icon_ExpandedSearch_Staff));

            _level = SessionObject.LCOrole;
            _levelID = DataIntegrity.ConvertToInt(Tile.TileParms.GetParm("levelID"));

            staffSearch_HiddenLevel.Value = _level.ToString();
            staffSearch_HiddenLevelID.Value = Standpoint.Core.Classes.Encryption.EncryptInt(_levelID);
            staffPieChartXmlHttpPanel.Value = string.Empty;

            DataTable countData;
            string chartSeriesItemName = string.Empty;
            switch (_level)
            {
                case Base.Enums.EntityTypes.LCOAdministrator:
                    countData = Base.Classes.LCO.GetStaffCounts();
                    chartSeriesItemName = "PortalName";
                    break;
                case Base.Enums.EntityTypes.District:
                    countData = Base.Classes.Staff.GetStateStaffCounts();
                    chartSeriesItemName = "loweredrolename";
                    break;
                default:
                    return;
            }

            staffCountChart.DataSource = countData;
            staffCountChart.ChartTitle.Visible = false;
            staffCountChart.DataBind();

            // Handle Legend Labels
            staffCountChart.Series.Clear();
            var nSeries = new ChartSeries();
            nSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;

            foreach (DataRow dr in countData.Rows)
            {
                var value = DataIntegrity.ConvertToDouble(dr["StaffCount"]);
                var myItem = new ChartSeriesItem(value) { Name = dr[chartSeriesItemName].ToString() };
                if (value <= 0) myItem.Label.Visible = false;
                nSeries.Type = ChartSeriesType.Pie;
                nSeries.AddItem(myItem);
            }

            staffCountChart.Series.Add(nSeries);

            if (IsPostBack)
            {
                // Reloads previous search results if session object search text has a value
                if (staffSearchText_smallTile.Value == "Search by last name..." && SessionObject.TeacherSearchTxtPostBack_smallTile != null
                        && SessionObject.TeacherSearchTxtPostBack_smallTile.Length > 0)
                {
                    SearchStaffByLastName_Click(null, null);
                }

                return;
            }

            staffSearchMoreLink.Visible = false;
            staffSearchTileGrid.Visible = false;
            addNewStaff.Visible = UserHasPermission(Base.Enums.Permission.Create_Staff);
        }