コード例 #1
0
        // GET: Channel
        public ActionResult Index(string channel)
        {
            HttpCookie cookie = HttpContext.Request.Cookies.Get("date");

            var         result = jsUnitOfWork.ProgramRepository.ListOfJsonProgram(cookie.Value, channel);
            IndexHomeVM model  = new IndexHomeVM(channel)
            {
                ProgramJsonList = result
            };

            return(View(model));
        }
コード例 #2
0
        public IndexHomeVM PrepareForHomeIndex()
        {
            IndexHomeVM IndexVM = new IndexHomeVM()
            {
                ListPopularMenuItem    = _unitOfWork.MenuItemRepository.FilterMostPopularMenuItems(),
                ListNewMenuItem        = _unitOfWork.MenuItemRepository.FilterMostBestSellerMenuItems(),
                ListBestSellerMenuItem = _unitOfWork.MenuItemRepository.FilterMostBestSellerMenuItems(),
                ListNews = _unitOfWork.NewsRepository.ReadAllCouponOrNews().Take(2)
            };

            return(IndexVM);
        }
コード例 #3
0
        public ActionResult Shows(string channel, string date)
        {
            // Cookie
            HttpCookie cookie = new HttpCookie("date");

            cookie.Value   = date;
            cookie.Expires = DateTime.Now.AddMinutes(60.0);
            HttpContext.Response.SetCookie(cookie);


            var         result = jsUnitOfWork.ProgramRepository.ListOfJsonProgram(date, channel);
            IndexHomeVM model  = new IndexHomeVM(channel)
            {
                ProgramJsonList = result,
            };

            return(PartialView("Shows", model));
        }
コード例 #4
0
        public IActionResult Index()
        {
            IndexHomeVM IndexVM = this._homeService.PrepareForHomeIndex();

            return(View(IndexVM));
        }