Example #1
0
        public static ListItem GetListItem(ENavigationType type, bool selected)
        {
            var item = new ListItem(GetText(type), GetValue(type));

            if (selected)
            {
                item.Selected = true;
            }
            return(item);
        }
Example #2
0
 public static bool Equals(ENavigationType type, string typeStr)
 {
     if (string.IsNullOrEmpty(typeStr))
     {
         return(false);
     }
     if (string.Equals(GetValue(type).ToLower(), typeStr.ToLower()))
     {
         return(true);
     }
     return(false);
 }
Example #3
0
 public static string GetText(ENavigationType type)
 {
     if (type == ENavigationType.Url)
     {
         return("指定网址");
     }
     else if (type == ENavigationType.Site)
     {
         return("微网站页面");
     }
     else if (type == ENavigationType.Function)
     {
         return("微功能页面");
     }
     else
     {
         throw new Exception();
     }
 }
Example #4
0
 public static string GetValue(ENavigationType type)
 {
     if (type == ENavigationType.Url)
     {
         return("Url");
     }
     else if (type == ENavigationType.Site)
     {
         return("Site");
     }
     else if (type == ENavigationType.Function)
     {
         return("Function");
     }
     else
     {
         throw new Exception();
     }
 }
Example #5
0
 public static string GetText(ENavigationType type)
 {
     if (type == ENavigationType.Url)
     {
         return("Ö¸¶¨ÍøÖ·");
     }
     else if (type == ENavigationType.Site)
     {
         return("΢ÍøÕ¾Ò³Ãæ");
     }
     else if (type == ENavigationType.Function)
     {
         return("΢¹¦ÄÜÒ³Ãæ");
     }
     else
     {
         throw new Exception();
     }
 }
Example #6
0
 public static bool Equals(string typeStr, ENavigationType type)
 {
     return(Equals(type, typeStr));
 }
Example #7
0
        public static string GetNavigationUrl(PublishmentSystemInfo publishmentSystemInfo, ENavigationType navigationType, EKeywordType keywordType, int functionID, int channelID, int contentID, string url)
        {
            var navigationUrl = string.Empty;

            if (navigationType == ENavigationType.Url)
            {
                navigationUrl = url;
            }
            else if (navigationType == ENavigationType.Function)
            {
                navigationUrl = KeywordManager.GetFunctionUrl(publishmentSystemInfo, keywordType, functionID);
            }
            else if (navigationType == ENavigationType.Site)
            {
                if (contentID > 0)
                {
                    var tableStyle = NodeManager.GetTableStyle(publishmentSystemInfo, channelID);
                    var tableName  = NodeManager.GetTableName(publishmentSystemInfo, channelID);

                    var contentInfo = DataProvider.ContentDao.GetContentInfo(tableStyle, tableName, contentID);

                    navigationUrl = PageUtilityWX.GetContentUrl(publishmentSystemInfo, contentInfo);
                }
                else if (channelID > 0)
                {
                    var nodeNames = NodeManager.GetNodeNameNavigation(publishmentSystemInfo.PublishmentSystemId, channelID);
                    navigationUrl = PageUtilityWX.GetChannelUrl(publishmentSystemInfo, NodeManager.GetNodeInfo(publishmentSystemInfo.PublishmentSystemId, channelID));
                }
            }

            return(navigationUrl);
        }