コード例 #1
0
 public ChannelPage(Channel channel)
 {
     InitializeComponent();
     ViewModel = new ChannelPageViewModel(channel);
     ViewModel.SetView(this);
     BindingContext = ViewModel;
     ViewModel.PostConstruct();
 }
コード例 #2
0
        public ActionResult AddProgram(ChannelProgram model)
        {
            DateTime start = model.StartTime;
            var      id    = Url.RequestContext.RouteData.Values["id"].ToString();

            _channelProgramService.AddProgram(id, start);

            IEnumerable <ChannelProgram> channelPrograms = _channelProgramService.GetAll().OrderBy(x => x.StartTime);
            IEnumerable <VideoContent>   videoContents   = _contentService.GetAll();

            ChannelPageViewModel channelPageViewModel = new ChannelPageViewModel
            {
                ChannelPrograms = channelPrograms,
                VideoContents   = videoContents
            };

            return(RedirectToAction("Index", channelPageViewModel));
        }
コード例 #3
0
        // GET: Admin/Channel
        public ActionResult Index(string tag, DateTime?startDate)
        {
            IEnumerable <ChannelProgram> channelPrograms = _channelProgramService.GetAll().OrderBy(x => x.StartTime);
            IEnumerable <VideoContent>   videoContents   = _contentService.GetAll();

            if (!string.IsNullOrEmpty(tag))
            {
                videoContents = videoContents.Where(x => x.Tag.ToLower().Contains(tag.ToLower()));
            }

            if (startDate != null)
            {
                channelPrograms = channelPrograms.Where(x => x.StartTime.Date == startDate.Value.Date);
            }

            ChannelPageViewModel channelPageViewModel = new ChannelPageViewModel
            {
                ChannelPrograms = channelPrograms,
                VideoContents   = videoContents
            };

            return(View(channelPageViewModel));
        }
コード例 #4
0
        public ChannelPage()
        {
            this.InitializeComponent();

            vm = DataContext as ChannelPageViewModel;
        }