Example #1
0
        public static DataSet GetDataSource(PageInfo pageInfo, ContextInfo contextInfo, ListInfo listInfo)
        {
            var channelId = StlDataUtility.GetChannelIdByLevel(pageInfo.SiteId, contextInfo.ChannelId, listInfo.UpLevel, listInfo.TopLevel);

            channelId = StlDataUtility.GetChannelIdByChannelIdOrChannelIndexOrChannelName(pageInfo.SiteId, channelId, listInfo.ChannelIndex, listInfo.ChannelName);

            var isTotal = TranslateUtils.ToBool(listInfo.Others.Get(AttributeIsTotal));

            if (TranslateUtils.ToBool(listInfo.Others.Get(AttributeIsAllChildren)))
            {
                listInfo.Scope = EScopeType.Descendant;
            }

            return(StlDataUtility.GetChannelsDataSource(pageInfo.SiteId, channelId, listInfo.GroupChannel, listInfo.GroupChannelNot, listInfo.IsImageExists, listInfo.IsImage, listInfo.StartNum, listInfo.TotalNum, listInfo.OrderByString, listInfo.Scope, isTotal, listInfo.Where));
        }
Example #2
0
        public static IEnumerable GetDataSource(PageInfo pageInfo, ContextInfo contextInfo, ContentsDisplayInfo displayInfo)
        {
            var channelId = StlDataUtility.GetNodeIdByLevel(pageInfo.PublishmentSystemId, contextInfo.ChannelID, displayInfo.UpLevel, displayInfo.TopLevel);

            channelId = StlCacheManager.NodeId.GetNodeIdByChannelIdOrChannelIndexOrChannelName(pageInfo.PublishmentSystemId, channelId, displayInfo.ChannelIndex, displayInfo.ChannelName);

            var isTotal = TranslateUtils.ToBool(displayInfo.OtherAttributes[AttributeIsTotal]);

            if (TranslateUtils.ToBool(displayInfo.OtherAttributes[AttributeIsAllChildren]))
            {
                displayInfo.Scope = EScopeType.Descendant;
            }

            return(StlDataUtility.GetChannelsDataSource(pageInfo.PublishmentSystemId, channelId, displayInfo.GroupChannel, displayInfo.GroupChannelNot, displayInfo.IsImageExists, displayInfo.IsImage, displayInfo.StartNum, displayInfo.TotalNum, displayInfo.OrderByString, displayInfo.Scope, isTotal, displayInfo.Where));
        }