Пример #1
0
 public WebCount GetRadioChannelCount(int groupId)
 {
     return(new WebCount()
     {
         Count = _tvBusiness.GetRadioGuideChannelsForGroup(groupId).Count
     });
 }
Пример #2
0
 public override bool GetProgramsGroup(IChannelGroup channelGroup, DateTime from, DateTime to, out IList <IProgram> programs)
 {
     programs = new List <IProgram>();
     if (channelGroup.ChannelGroupId < 0)
     {
         foreach (var channel in _tvBusiness.GetRadioGuideChannelsForGroup(-channelGroup.ChannelGroupId))
         {
             CollectionUtils.AddAll(programs, _tvBusiness.GetPrograms(TvDatabase.Channel.Retrieve(channel.IdChannel), from, to).Select(p => p.ToProgram()));
         }
     }
     else
     {
         foreach (var channel in _tvBusiness.GetTVGuideChannelsForGroup(channelGroup.ChannelGroupId))
         {
             CollectionUtils.AddAll(programs, _tvBusiness.GetPrograms(TvDatabase.Channel.Retrieve(channel.IdChannel), from, to).Select(p => p.ToProgram()));
         }
     }
     return(programs.Count > 0);
 }
Пример #3
0
        public override async Task <AsyncResult <IList <IProgram> > > GetProgramsGroupAsync(IChannelGroup channelGroup, DateTime from, DateTime to)
        {
            await _initComplete.Task;

            var programs = new List <IProgram>();

            if (channelGroup.ChannelGroupId < 0)
            {
                foreach (var channel in _tvBusiness.GetRadioGuideChannelsForGroup(-channelGroup.ChannelGroupId))
                {
                    CollectionUtils.AddAll(programs, _tvBusiness.GetPrograms(TvDatabase.Channel.Retrieve(channel.IdChannel), from, to).Select(p => GetProgram(p)));
                }
            }
            else
            {
                foreach (var channel in _tvBusiness.GetTVGuideChannelsForGroup(channelGroup.ChannelGroupId))
                {
                    CollectionUtils.AddAll(programs, _tvBusiness.GetPrograms(TvDatabase.Channel.Retrieve(channel.IdChannel), from, to).Select(p => GetProgram(p)));
                }
            }
            var success = programs.Count > 0;

            return(new AsyncResult <IList <IProgram> >(success, programs));
        }
Пример #4
0
 private IEnumerable <Channel> GetRadioChannels(int?groupId, WebSortField?sort, WebSortOrder?order)
 {
     return(groupId == null ?
            (IEnumerable <Channel>)Channel.ListAll().Where(ch => ch.IsRadio).OrderBy(ch => sort == WebSortField.User ? ch.SortOrder : 1, order) :
            (IEnumerable <Channel>)_tvBusiness.GetRadioGuideChannelsForGroup(groupId.Value));
 }