Exemplo n.º 1
0
        public ActionResult getPage(int page_id)
        {
            hypster_tv.ViewModels.HomePageViewModel model = new ViewModels.HomePageViewModel();


            int _start = ((page_id * CLIPS_NUM_PAGING) - CLIPS_NUM_PAGING);
            int _end   = _start + CLIPS_NUM_PAGING;

            ViewBag.CurrPage       = page_id;
            ViewBag.CurrPage_Start = _start;
            ViewBag.CurrPage_End   = _end;



            hypster_tv_DAL.videoClipManager videoManager = new hypster_tv_DAL.videoClipManager();
            model.TopVideos = videoManager.getTopRatedVideos_cache();
            model.NewVideos = videoManager.getNewVideos_cache();



            model.NumOfVideos = model.TopVideos.Count;
            double tmp_numPages = (double)model.NumOfVideos / (double)CLIPS_NUM_PAGING;

            if ((tmp_numPages - (int)tmp_numPages) > 0)
            {
                tmp_numPages++;
            }
            model.NumOfPages = (int)tmp_numPages;



            return(View(model));
        }
Exemplo n.º 2
0
        public ActionResult _getVideoBottomLinks()
        {
            hypster_tv.ViewModels.getVideoBottomLinksViewModel model = new ViewModels.getVideoBottomLinksViewModel();



            hypster_tv_DAL.videoClipManager videoManager = new hypster_tv_DAL.videoClipManager();
            int numberOfClips = 0;

            numberOfClips     = videoManager.getNumberOfVideoClips();
            model.NumOfVideos = 0;

            model.TopVideos = videoManager.getTopRatedVideos_cache(12);
            model.NewVideos = videoManager.getNewVideos_cache(12);


            return(View(model));
        }
Exemplo n.º 3
0
        public ActionResult Index()
        {
            hypster_tv.ViewModels.HomePageViewModel model = new ViewModels.HomePageViewModel();



            hypster_tv_DAL.videoClipManager videoManager = new hypster_tv_DAL.videoClipManager();
            model.TopVideos = videoManager.getTopRatedVideos_cache(CLIPS_NUM_PAGE);
            model.NewVideos = videoManager.getNewVideos_cache(CLIPS_NUM_PAGE);



            model.NumOfVideos = model.TopVideos.Count;
            double tmp_numPages = (double)model.NumOfVideos / (double)CLIPS_NUM_PAGE;

            if ((tmp_numPages - (int)tmp_numPages) > 0)
            {
                tmp_numPages++;
            }
            model.NumOfPages = (int)tmp_numPages;


            return(View(model));
        }