Beispiel #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));
        }
        public ActionResult Index()
        {
            using (var db = new BeerWeb.Models.BeerModel())
            {
                var viewModel = new ViewModels.HomePageViewModel();
                viewModel.CategoryList.AddRange(db.Categories);

                return(View(viewModel));
            }
        }
Beispiel #3
0
        public HomePage()
        {
            this.InitializeComponent();

            this.currentViewModel = new ViewModels.HomePageViewModel();

            this.DataContext = this.currentViewModel;
            this.roamingSetting = Windows.Storage.ApplicationData.Current.RoamingSettings;

            if (!isPrivacySet)
            {
                isPrivacySet = true;
                SettingsPane.GetForCurrentView().CommandsRequested += ShowPrivacyPolicy;
            }
        }
Beispiel #4
0
        public HomePage()
        {
            this.InitializeComponent();

            this.currentViewModel = new ViewModels.HomePageViewModel();

            this.DataContext    = this.currentViewModel;
            this.roamingSetting = Windows.Storage.ApplicationData.Current.RoamingSettings;

            if (!isPrivacySet)
            {
                isPrivacySet = true;
                SettingsPane.GetForCurrentView().CommandsRequested += ShowPrivacyPolicy;
            }
        }
Beispiel #5
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));
        }
 public HomePage()
 {
     InitializeComponent();
     BindingContext = new ViewModels.HomePageViewModel();
 }