当前位置: 首页>>代码示例>>C#>>正文


C# SageFrameConfig.GetPageModules_Superuser方法代码示例

本文整理汇总了C#中SageFrame.Web.SageFrameConfig.GetPageModules_Superuser方法的典型用法代码示例。如果您正苦于以下问题:C# SageFrameConfig.GetPageModules_Superuser方法的具体用法?C# SageFrameConfig.GetPageModules_Superuser怎么用?C# SageFrameConfig.GetPageModules_Superuser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SageFrame.Web.SageFrameConfig的用法示例。


在下文中一共展示了SageFrameConfig.GetPageModules_Superuser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BindModuleControls

        private void BindModuleControls()
        {
            string preFix = string.Empty;
            string paneName = string.Empty;
            string ControlSrc = string.Empty;
            string phdContainer = string.Empty;
            string PageSEOName = string.Empty;
            SageUserControl suc = new SageUserControl();
            if (PagePath != null)
            {
                suc.PagePath = PagePath;
            }
            else
            {
                SageFrameConfig sfConfig = new SageFrameConfig();
                suc.PagePath = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage);
            }
            if (PagePath != null)
            {
                PageSEOName = GetPageSEOName(PagePath);
            }
            else
            {
                SageFrameConfig sfConfig = new SageFrameConfig();
                PageSEOName = GetPageSEOName(sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage));
            }
            PageSEOName = PageSEOName.Replace("-and-", "&").Replace(" ", "-");

            //:TODO: Need to get controlType and pageID from the selected page from routing path
            //string controlType = "0";
            //string pageID = "2";
            StringBuilder redirecPath = new StringBuilder();
            if (PageSEOName != string.Empty)
            {
                SageFrameConfig sfConfig = new SageFrameConfig();
                string SEOName = sfConfig.GetSettingsByKey(SageFrameSettingKeys.PortalDefaultPage).Replace(" ", "-");
                List<UserModuleInfo> lstUserModules = new List<UserModuleInfo>();
                bool SuperRole = false;
                if (Session[SessionKeys.SageRoles] != string.Empty && Session[SessionKeys.SageRoles] != null)
                {
                    string[] objRole = Session[SessionKeys.SageRoles].ToString().Split(',');
                    foreach (string role in objRole)
                    {
                        if (role.Replace(" ", string.Empty).ToLower().Equals(ApplicationKeys.Super_User.ToLower().Replace("-", string.Empty)))
                        {
                            SuperRole = true;
                        }
                    }

                }
                if (GetUsername.Equals(ApplicationKeys.anonymousUser))
                {
                    lstUserModules = sfConfig.GetPageModules_Anonymous("1", PageSEOName, GetUsername,GetCurrentCulture());
                }
                else if (SuperRole)
                {
                    lstUserModules = sfConfig.GetPageModules_Superuser("1", PageSEOName, GetUsername,GetCurrentCulture());
                }
                else
                {
                    lstUserModules = sfConfig.GetPageModules("1", PageSEOName, GetUsername,GetCurrentCulture());
                }
                Uri url = HttpContext.Current.Request.Url;
                if (lstUserModules[0].IsPageAvailable)
                {

                    if (lstUserModules[0].IsPageAccessible)
                    {
                        #region "Load Controls"

                        if (lstUserModules.Count > 0)
                        {
                            OverridePageInfo(lstUserModules[0]);
                            int i = 0;
                            foreach (UserModuleInfo usermodule in lstUserModules)
                            {
                                bool handheld_status = bool.Parse(usermodule.IsHandHeld.ToString());
                                if (IsHandheld() == handheld_status)
                                {
                                    paneName = usermodule.PaneName;
                                    paneName = "pch_" + paneName;
                                    if (string.IsNullOrEmpty(paneName))
                                        paneName = "ContentPane";
                                    string UserModuleTitle = usermodule.UserModuleTitle != string.Empty ? usermodule.UserModuleTitle.ToString() : string.Empty;

                                    ControlSrc = usermodule.ControlSrc;
                                    string SupportsPartialRendering = usermodule.SupportsPartialRendering.ToString();

                                    string SuffixClass = usermodule.SuffixClass.ToString();
                                    string HeaderText = usermodule.ShowHeaderText ? usermodule.HeaderText : "";
                                    bool ContainsEdit = usermodule.IsEdit;
                                    int ControlCount = usermodule.ControlsCount;
                                    UserControl uc = pchWhole.FindControl("lytA") as UserControl;
                                    PlaceHolder phdPlaceHolder = uc.FindControl(paneName) as PlaceHolder;
                                    SuffixClass = IsUserLoggedIn() && ContainsEdit ? string.Format("sfLogged sfModule{0}", SuffixClass) : string.Format("sfModule{0}", SuffixClass);
                                    if (phdPlaceHolder != null)
                                    {
                                        string TemplateControls = Server.MapPath(string.Format("~/Templates/{0}/modules/{1}", activeTemplate, ControlSrc.Substring(ControlSrc.IndexOf('/'), ControlSrc.Length - ControlSrc.IndexOf('/'))));
                                        ControlSrc = File.Exists(TemplateControls) ? string.Format("/Templates/{0}/modules/{1}", activeTemplate, ControlSrc.Substring(ControlSrc.IndexOf('/'), ControlSrc.Length - ControlSrc.IndexOf('/'))) : string.Format("/{0}", ControlSrc);
                                        phdPlaceHolder = LoadControl(i.ToString(), bool.Parse(SupportsPartialRendering), phdPlaceHolder, ControlSrc, paneName, usermodule.UserModuleID.ToString(), SuffixClass, HeaderText, IsUserLoggedIn(), GetModuleControls(usermodule.UserModuleID, ContainsEdit, ControlCount), GetPaneNameContainer(UserModuleTitle), ContainsEdit);
//.........这里部分代码省略.........
开发者ID:RexSystemsbd,项目名称:SageFrameV2.1Source,代码行数:101,代码来源:Default.aspx.cs


注:本文中的SageFrame.Web.SageFrameConfig.GetPageModules_Superuser方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。