コード例 #1
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));
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: uynguyen/TurboFilm
        public ActionResult showReview(int? page)
        {
            ReviewFilmService review = new ReviewFilmService();

            List<TopReviewModels> result = review.showReview();
            int pageNumber = page ?? 1;
            int pageSize = 5;
            return PartialView(result.ToPagedList(pageNumber, pageSize));
        }
コード例 #3
0
        public ActionResult CreateNewPost(PhimViewModels phim)
        {
            BaiNhanXet baiNhanXet = new BaiNhanXet();
            baiNhanXet.TinhTrang = true;
            baiNhanXet.MS_Phim = phim.MaSo;
            baiNhanXet.TieuDe = phim.title;
            baiNhanXet.NgayDang = System.DateTime.Now;
            if (phim.contentPost == null)
                phim.contentPost = "";
            baiNhanXet.NoiDung = phim.contentPost;
            baiNhanXet.MS_TaiKhoan = User.Identity.GetUserId();

            ReviewFilmService reviewS = new ReviewFilmService();

            int result = reviewS.addPost(baiNhanXet);


            return RedirectToAction("Index", new {IDPhim =  baiNhanXet.MS_Phim , IDReview= result });
        }
コード例 #4
0
        public ActionResult AddComment(String CommentContent , String IDPost)
        {
            ReviewFilmService reviewS = new ReviewFilmService();

            string IDUser = User.Identity.GetUserId();
            CommentViewModels result = reviewS.addComment(CommentContent, IDPost, IDUser);

            return RedirectToAction("CommentsOfTopReview", new { page = 1, IDPhim = TempData["IDPhim"], IDReview=TempData["IDReview"]});
        }
コード例 #5
0
        public ActionResult Top10Review(String IDPhim)
        {
            ReviewFilmService reviewS = new ReviewFilmService();
            List<TopReviewModels> result = reviewS.getTop10Review(IDPhim);


            return View(result);
        }
コード例 #6
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);
        }
コード例 #7
0
        public String DeletePost(String IDPost)
        {
            ReviewFilmService reviewS = new ReviewFilmService();
            bool result = reviewS.deletePost(IDPost);

            if (result)
                return "success";
            else
                return "failed";
        }
コード例 #8
0
        public ActionResult EditedPost(PhimViewModels phim)
        {

            FilmService bus = new FilmService();

            BaiNhanXet baiNhanXet = new BaiNhanXet();
            baiNhanXet.MaSo = phim.MaSoBaiNhanXet;
            baiNhanXet.TinhTrang = true;
            baiNhanXet.MS_Phim = phim.MaSo;
            baiNhanXet.TieuDe = phim.title;
            baiNhanXet.NgayDang = System.DateTime.Now;
            baiNhanXet.NoiDung = phim.contentPost;
            baiNhanXet.MS_TaiKhoan = User.Identity.GetUserId();

            ReviewFilmService reviewS = new ReviewFilmService();

            bool result = reviewS.editPost(baiNhanXet);

            return RedirectToAction("Index", new { IDPhim = baiNhanXet.MS_Phim, IDReview = phim.MaSoBaiNhanXet });
         
        }
コード例 #9
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);
        }
コード例 #10
0
 public ActionResult PagingMyListReview(int? page)
 {
     ReviewFilmService reviewS = new ReviewFilmService();
     List<TopReviewModels> result = reviewS.getMyListReview(User.Identity.GetUserId());
     int PageSize = 2;
     int pageNumber = page ?? 1;
     return PartialView(result.ToPagedList(pageNumber, PageSize));
 }
コード例 #11
0
 public string DeletePost(string codeReview)
 {
     ReviewFilmService reviewS = new ReviewFilmService();
     reviewS.deletePost(codeReview);
     return "";
 }
コード例 #12
0
        public ActionResult PagingIndex(int? page)
        {
            ReviewFilmService reviewS = new ReviewFilmService();

            return PartialView(reviewS.getAllReviewFilm().ToPagedList(page ?? 1, 10));
        }