Exemplo n.º 1
0
      //   GET: Review
        public ActionResult Index(int? page)
        {
            ViewBag.HomeStatus = "inactive";
            ViewBag.VideoStatus = "inactive";
            ViewBag.ReviewStatus = "active";
            ViewBag.ContactStatus = "inactive";

            if (page == null)
            {
                if (TempData["currentPage"] != null)
                {
                    page = Int32.Parse(TempData["currentPage"].ToString()); //Chuyển hướng từ action delete
                }
                else
                {
                    page = 1;
                    TempData["currentPage"] = page;
                }
            }
            else
                TempData["currentPage"] = page;

            if (TempData["strSort"] == null)
                TempData["strSort"] = "ID";           

            FilmService phimService = new FilmService();

            ViewBag.maxPage = phimService.countPage();
            ViewBag.maxIndexPage = phimService.getMaxIndexPage();

            return View(phimService.getAllFilms(page, (String)TempData["strSort"], false));
        }
Exemplo n.º 2
0
        public ActionResult PagingSimpleSearch(int? page, String filmName)
        {
            ViewBag.filmName = filmName;
            
            if (TempData["strSort"] == null)
                TempData["strSort"] = "ID";

            if (TempData["sortDirection"] == null)
                TempData["sortDirection"] = "true";

            FilmService phimService = new FilmService();

            ViewBag.maxIndexPage = phimService.getMaxIndexPage();

            List<PhimViewModels> searchResult = phimService.searchFilm(filmName);

            return PartialView(searchResult.ToPagedList(page ?? 1,10));
        }
Exemplo n.º 3
0
        public ActionResult Index(bool? homepage)
        {
            if (Request.IsAuthenticated)
            {
                if (User.IsInRole("Admin") && (!(homepage ?? false)))
                    return RedirectToAction("Index", "AdminMain");             
            }
            ViewBag.HomeStatus = "active";
            ViewBag.VideoStatus = "inactive";
            ViewBag.ReviewStatus = "inactive";
            ViewBag.ContactStatus = "inactive";
           FilmService phimService = new FilmService();

        


            ViewBag.maxIndexPage = phimService.getMaxIndexPage();

            List<PhimViewModels> result = phimService.filmMax();

            return View(result[0]);
        }
Exemplo n.º 4
0
        // GET: AdminMovies
        public ActionResult Index(int? page)
        {

            if (page == null)
            {
                if (TempData["currentPage"] != null)
                {
                    page = Int32.Parse(TempData["currentPage"].ToString()); //Chuyển hướng từ action delete
                }
                else
                {
                    page = 1;
                    TempData["currentPage"] = page;
                }
            }
            else
                TempData["currentPage"] = page;



            if (TempData["strSort"] == null)
                TempData["strSort"] = "ID";
            if (TempData["sortDirection"] == null)
                TempData["sortDirection"] = "false";
          


            FilmService phimService = new FilmService();


            ViewBag.maxPage = phimService.countPage();
            ViewBag.maxIndexPage = phimService.getMaxIndexPage();
            ViewBag.maxProductOnEachPage = phimService.getMaxProductOnEachPage();

            return View(phimService.getAllFilms(page, (String)TempData["strSort"], Boolean.Parse(TempData["sortDirection"].ToString())));
        }
Exemplo n.º 5
0
        public ActionResult ViewForCountry(String countryID, int? page, String strSort)
        {
            TempData["strSort"] = strSort;
            if (countryID == null) //Nếu không xem them thể loại thì xem tất cả các phim
            {
                return RedirectToAction("Index");
            }


            ViewBag.ViewForCountry = true;
            ViewBag.countryID = countryID;


            ViewBag.HomeStatus = "inactive";
            ViewBag.VideoStatus = "inactive";
            ViewBag.ReviewStatus = "active";
            ViewBag.ContactStatus = "inactive";



            if (page == null)
            {
                if (TempData["currentPage"] != null)
                {
                    page = Int32.Parse(TempData["currentPage"].ToString()); //Chuyển hướng từ action delete
                }
                else
                {
                    page = 1;
                    TempData["currentPage"] = page;
                }
            }
            else
                TempData["currentPage"] = page;

            if (TempData["strSort"] == null)
                TempData["strSort"] = "ID";

            FilmService phimService = new FilmService();
            ViewBag.maxIndexPage = phimService.getMaxIndexPage();



            List<PhimViewModels> lstPhim = phimService.findByCountry(countryID, page, TempData["strSort"].ToString(), false);

            List<Phim> lstPhimSearch = phimService.findAllByCountry(countryID);

            ViewBag.maxPage = phimService.countPageSearch(lstPhimSearch);



            return View("Index", lstPhim);
        }