Exemple #1
0
        public ActionResult HomePage()
        {
            var result = SampleData.GenerateSeatState();
            //get Film banner site + banner + event topic
            var filmSlider = _filmService.GetAll();
            var resultVm   = Mapper.Map <IEnumerable <FilmViewModel> >(filmSlider);

            var filmBanner     = _adsBannerService.GetAll();
            var resultBannerVm = Mapper.Map <IEnumerable <AdsBannerViewModel> >(filmBanner);

            ViewData["AdsBanner"] = resultBannerVm;

            //get list theater + dropdownlist

            //get list film pending, plan, and special
            var filmDangChieu = resultVm.Where(n => n.FilmStatus == "PEN");

            ViewData["FilmDangChieu"] = (filmDangChieu.Count() > 5)
                ? (filmDangChieu.Reverse().Take(5).Reverse())
                : (filmDangChieu);

            var filmSapChieu = resultVm.Where(n => n.FilmStatus == "REL");

            ViewData["FilmSapChieu"] = (filmSapChieu.Count() > 5)
                ? (filmSapChieu.Reverse().Take(5).Reverse())
                : (filmSapChieu);

            var filmSuatChieuDacBiet = resultVm.Where(n => n.FilmStatus == "REW");

            ViewData["FilmSuatChieuDacBiet"] = (filmSuatChieuDacBiet.Count() > 5)
                ? (filmSuatChieuDacBiet.Reverse().Take(5).Reverse())
                : (filmSuatChieuDacBiet);

            //get list events ??? chưa có
            var eventTopic   = _eventTopicService.GetAll();
            var eventTopicVm = Mapper.Map <IEnumerable <EventTopicViewModel> >(eventTopic);

            ViewData["EventTopic"] = eventTopicVm;

            //get list promotion
            var promotion   = _promotionService.GetAll(ParametersContrants.CONTENT_GET);
            var promotionVm = Mapper.Map <IEnumerable <PromotionViewModel> >(promotion);

            ViewData["PromotionBanner"] = promotionVm;

            //cinema
            var cinemas   = _cinemaService.GetAll();
            var cinemasVm = Mapper.Map <IEnumerable <CinemaViewModel> >(cinemas);

            ViewData["CinemaID"] = cinemasVm;
            return(View(resultVm));
        }
Exemple #2
0
        public IActionResult Get()
        {
            var objs   = cinemaService.GetAll().ToList();
            var result = mapper.Map <List <CinemaResource> >(objs);

            return(new ObjectResult(result));
        }
Exemple #3
0
        public ActionResult CreateRoomDetail()
        {
            //Load danh sách các rạp chiếu phim
            var result   = _cinemaService.GetAll();
            var resultVm = Mapper.Map <IEnumerable <Cinema>, IEnumerable <CinemaViewModel> >(result);

            ViewBag.CinemaID = new SelectList(resultVm, "CinemaID", "CinemaFullName");

            //Load trạng thái của một phòng chiếu
            var listStatus = new List <SelectListItem>
            {
                new SelectListItem {
                    Text = "Đang hoạt động", Value = "AC"
                },
                new SelectListItem {
                    Text = "Không hoạt động", Value = "NOT"
                },
            };

            ViewBag.CinemaStatusID = new SelectList(listStatus, "Value", "Text");
            return(View());
        }
Exemple #4
0
        // GET: AdminDashboard/Cinema
        public ActionResult Index(int page = 0)
        {   //Show List Cinema in Database
            int pageSize = CommonConstrants.PAGE_SIZE;
            int totalRow = 0;

            int count = _cinemaService.GetAll().OfType <Cinema>().Count();

            var result   = _cinemaService.GetCinemaPaging(page, pageSize, out totalRow);
            var resultVm = Mapper.Map <IEnumerable <Cinema>, IEnumerable <CinemaViewModel> >(result);

            int totalPage     = (int)Math.Ceiling((double)totalRow / pageSize);
            var paginationSet = new PaginationSet <CinemaViewModel>()
            {
                Items      = resultVm,
                MaxPage    = CommonConstrants.PAGE_SIZE,
                Page       = page,
                TotalCount = totalRow,
                TotalPages = totalPage,
                Count      = resultVm.Count(),
            };

            return(View(paginationSet));
        }
Exemple #5
0
 public IEnumerable <CinemaDTO> Get()
 {
     return(cinemaService.GetAll());
 }