private void SetAdminParts()
 {
     SecurityPolicy objSecurity = new SecurityPolicy();
     HttpCookie authCookie = Request.Cookies[objSecurity.FormsCookieName(GetPortalID)];
     if (authCookie != null)
     {
         RoleController _role = new RoleController();
         bool isDashboardAccessible = _role.IsDashboardAccesible(GetUsername, GetPortalID);
         if (isDashboardAccessible)
         {
             divAdminControlPanel.Visible = true;
             ApplicationController objAppController = new ApplicationController();
             // objAppController.ChangeCss(Page, "pchWhole", "lytA", "sfOuterWrapper", "style", "margin-top:30px");
         }
     }
     else
     {
         divAdminControlPanel.Visible = false;
     }
     if (IsHandheld())
     {
         divAdminControlPanel.Visible = false;
     }
 }
        private void SagePageLoadPart()
        {
            if (!IsPostBack)
            {
                string sageNavigateUrl = string.Empty;
                SageFrameConfig sfConfig = new SageFrameConfig();

                if (!IsParent)
                {
                    sageNavigateUrl = GetParentURL + "/portal/" + GetPortalSEOName + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension;
                }
                else
                {
                    sageNavigateUrl = GetParentURL + "/" + sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-") + SageFrameSettingKeys.PageExtension;
                }
                hypHome.NavigateUrl = sageNavigateUrl;//GetHostURL + "/Admin/Admin" + Extension;
                // hypHome.Text = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage);
                //hypHome.ImageUrl = GetAdminImageUrl("home.png", true);
                hypPreview.NavigateUrl = sageNavigateUrl;
                lnkAccount.NavigateUrl = GetProfileLink(sfConfig);
                Image imgProgress = (Image)UpdateProgress1.FindControl("imgPrgress");
                if (imgProgress != null)
                {
                    imgProgress.ImageUrl = GetAdminImageUrl("ajax-loader.gif", true);
                }
                // bool IsAdmin = false;
                SecurityPolicy objSecurity = new SecurityPolicy();
                FormsAuthenticationTicket ticket = objSecurity.GetUserTicket(GetPortalID);
                if (ticket != null)
                {
                    int LoggedInPortalID = int.Parse(ticket.UserData.ToString());
                    if (ticket.Name != ApplicationKeys.anonymousUser)
                    {
                        string[] sysRoles = SystemSetting.SYSTEM_SUPER_ROLES;
                        this.hypUpgrade.Visible = IsParent ? (Roles.IsUserInRole(ticket.Name, sysRoles[1]) ? true : false) : false;

                        if (GetPortalID == LoggedInPortalID || Roles.IsUserInRole(ticket.Name, sysRoles[0]))
                        {
                            RoleController _role = new RoleController();
                            string userinroles = _role.GetRoleNames(GetUsername, LoggedInPortalID);
                            if (userinroles != "" || userinroles != null)
                            {
                                bool isDashboardAccessible = _role.IsDashboardAccesible(GetUsername, GetPortalID);
                                foreach (string role in sysRoles)
                                {
                                    if (userinroles.ToLower() == role)
                                    {
                                        isDashboardAccessible = true;
                                    }
                                }
                                if (!isDashboardAccessible)
                                {
                                    divAdminControlPanel.Visible = false;
                                }
                            }
                            else
                            {
                                divAdminControlPanel.Visible = false;
                            }
                        }
                        else
                        {
                            divAdminControlPanel.Visible = false;
                        }
                    }
                    else
                    {
                        divAdminControlPanel.Visible = false;
                    }

                }
                if (IsHandheld())
                {
                    divAdminControlPanel.Visible = false;
                }
            }
            //SessionTrackerController sTracController = new SessionTrackerController();
            //sTracController.SetSessionTrackerValues(GetPortalID.ToString(), GetUsername);
        }