Пример #1
0
        public TopReviewModels BaiNhanXet2BaiNhanXetViewModels(BaiNhanXet topReview)
        {
            AccountBus     acBus = new AccountBus();
            ReviewFilmsBus bus   = new ReviewFilmsBus();
            ThanhVien      temp  = acBus.getMemberByUserId(topReview.MS_TaiKhoan);

            TopReviewModels result = new TopReviewModels();

            result.UserName = temp.HoTen;
            result.postDate = (DateTime)topReview.NgayDang;

            result.content   = topReview.NoiDung;
            result.totalRank = bus.getTotalRank(topReview.MaSo);

            result.title     = topReview.TieuDe;
            result.MS_Phim   = (int)topReview.MS_Phim;
            result.MS_ReView = (int)topReview.MaSo;

            FilmBus filmBus = new FilmBus();

            Phim p = filmBus.getFilmByID(result.MS_Phim.ToString());

            result.ulr_HinhAnh = p.HinhAnh;
            result.TenPhim     = p.TenPhim;
            return(result);
        }
Пример #2
0
        private List <TopReviewModels> BaiNhanXet2TopReviewModel(List <BaiNhanXet> lstBaiNhanXet)
        {
            List <TopReviewModels> result = new List <TopReviewModels>();

            AccountBus acBus = new AccountBus();

            foreach (BaiNhanXet baiNhanXet in lstBaiNhanXet)
            {
                TopReviewModels temp = new TopReviewModels();


                temp.MS_Phim     = (int)baiNhanXet.MS_Phim;
                temp.MS_ReView   = baiNhanXet.MaSo;
                temp.MS_TaiKhoan = baiNhanXet.MS_TaiKhoan;
                ThanhVien thanhVien = acBus.getMemberByUserId(temp.MS_TaiKhoan);
                temp.UserName    = thanhVien.HoTen;
                temp.postDate    = (DateTime)baiNhanXet.NgayDang;
                temp.TenPhim     = baiNhanXet.Phim.TenPhim;
                temp.title       = baiNhanXet.TieuDe;
                temp.content     = baiNhanXet.NoiDung;
                temp.ulr_HinhAnh = baiNhanXet.Phim.HinhAnh;
                result.Add(temp);
            }
            return(result);
        }
Пример #3
0
        public ActionResult CommentsOfTopReview(int?page, String IDPhim, String IDReview = "-1")
        {
            List <CommentViewModels> result  = new List <CommentViewModels>();
            ReviewFilmService        reviewS = new ReviewFilmService();
            TopReviewModels          top     = null;

            ViewBag.IDPhim   = IDPhim;
            ViewBag.IDReview = IDReview;
            if (IDReview.Equals("-1")) // Bài Review nổi bật nhất
            {
                top = reviewS.getTopReview(IDPhim);
            }
            else
            {
                top = reviewS.getReview(IDReview);
            }

            if (top != null)
            {
                result = reviewS.getComment(top.MS_ReView.ToString());

                TempData["IDPost"] = top.MS_ReView;
            }

            int pageNumber = page ?? 1;
            int pageSize   = 10;

            return(PartialView(result.ToPagedList(pageNumber, pageSize)));
        }
Пример #4
0
        public List <TopReviewModels> showReview()
        {
            List <TopReviewModels> result = new List <TopReviewModels>();

            List <BaiNhanXet> lst = filmBus.findThink();

            foreach (BaiNhanXet p in lst)
            {
                TopReviewModels pvm = BaiNhanXet2BaiNhanXetViewModels(p);
                result.Add(pvm);
            }

            return(result);
        }
Пример #5
0
        public ActionResult TopReview(String IDPhim, String IDReview = "-1")
        {
            TopReviewModels   result  = null;
            ReviewFilmService reviewS = new ReviewFilmService();

            if (IDReview.Equals("-1"))
            {
                result = reviewS.getTopReview(IDPhim);
            }
            else
            {
                result = reviewS.getReview(IDReview);
            }



            return(View(result));
        }
Пример #6
0
        public ActionResult EditPost(String IDReview)
        {
            ReviewFilmService reviewS = new ReviewFilmService();

            TopReviewModels baiNhanXet = reviewS.getReview(IDReview);


            FilmService    filmSV = new FilmService();
            PhimViewModels temp   = filmSV.getFilmByID(baiNhanXet.MS_Phim.ToString());

            temp.contentPost    = baiNhanXet.content;
            temp.title          = baiNhanXet.title;
            temp.MaSoBaiNhanXet = baiNhanXet.MS_ReView;



            return(View(temp));
        }
Пример #7
0
        internal List <TopReviewModels> getTop10Review(string IDPhim)
        {
            ReviewFilmsBus    bus       = new ReviewFilmsBus();
            List <BaiNhanXet> topReview = bus.getTop10Review(Int32.Parse(IDPhim));

            if (topReview != null)
            {
                List <TopReviewModels> result = new List <TopReviewModels>();
                foreach (BaiNhanXet bai in topReview)
                {
                    TopReviewModels temp = BaiNhanXet2BaiNhanXetViewModels(bai);
                    result.Add(temp);
                }



                return(result);
            }
            else
            {
                return(null);
            }
        }