Beispiel #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);
        }
Beispiel #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);
 }
Beispiel #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();
     }
 }
Beispiel #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();
     }
 }
Beispiel #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();
     }
 }
Beispiel #6
0
 public static bool Equals(string typeStr, ENavigationType type)
 {
     return(Equals(type, typeStr));
 }
Beispiel #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);
        }