// GET: ProgramScheduleDetails/Create
        public ActionResult Create(DateTime?date)
        {
            if (!date.HasValue)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ViewBag.VideoCategories = _videoCategoryRepository.GetMany(cat => cat.Children.Count == 0, cat => cat.Name);
            //Lấy thông tin từ khung chương trình
            var dayOfWeek = date.Value.DayOfWeek;

            var detailList = _scheduleRepository.GetMany(s => s.DayOfWeek == dayOfWeek, s => s.Time)
                             .Select(s => new ProgramScheduleDetail
            {
                VideoCategoryId = s.VideoCategoryId,
                DateTime        = date.Value.Date.Add(s.Time),
                VideoCategory   = s.VideoCategory,
                IsNew           = s.IsNew
            }).ToList();

            var model = new DowScheduleDetailModel()
            {
                Date    = date.Value,
                Details = detailList
            };

            return(View(model));
        }
 // GET: ProgramSchedules/Create
 public PartialViewResult Create(DayOfWeek dayOfWeek)
 {
     ViewBag.VideoCategoryId = new SelectList(
         _videoCategoryRepository.GetMany(cat => cat.Children.Count == 0, cat => cat.Name),
         "Id",
         "Name");
     return(PartialView(new ProgramSchedule {
         DayOfWeek = dayOfWeek
     }));
 }
Beispiel #3
0
        public IEnumerable <VideoCategoryEntity> GetVideoCategoryByGroupId(int id)
        {
            var lstvideo         = _videocategoryRepository.GetMany(v => v.GroupId == id, v => v.Order);
            var lstvideocategory = Mapper.Map <List <VideoCategoryEntity> >(lstvideo);

            return(lstvideocategory);
        }
Beispiel #4
0
        public IEnumerable <VideoCategoryEntity> GetVideoCategoryByGroupId(string id)
        {
            int catid            = Convert.ToInt32(id);
            var lstvideo         = _videocategoryRepository.GetMany(v => v.GroupId == catid, v => v.Order);
            var lstvideocategory = Mapper.Map <List <VideoCategoryEntity> >(lstvideo);

            return(lstvideocategory);
        }
Beispiel #5
0
        public PartialViewResult GetVideoCategories()
        {
            var model = _videoCategoryRepository.GetMany(vc => vc.PageGroupId == (int)PageType.Startup, vc => vc.Order);

            return(PartialView(model));
        }
Beispiel #6
0
 //
 // GET: /VideoCategory/
 public ViewResult Index()
 {
     ViewBag.CatGroups = _catGroupRepository.All.ToList();
     return(View(_videocategoryRepository.GetMany(vc => vc.TypeId != null, vc => vc.Order)));
 }