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)); }
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)); }
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 }); }
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"]}); }
public ActionResult Top10Review(String IDPhim) { ReviewFilmService reviewS = new ReviewFilmService(); List<TopReviewModels> result = reviewS.getTop10Review(IDPhim); return View(result); }
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); }
public String DeletePost(String IDPost) { ReviewFilmService reviewS = new ReviewFilmService(); bool result = reviewS.deletePost(IDPost); if (result) return "success"; else return "failed"; }
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 }); }
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); }
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)); }
public string DeletePost(string codeReview) { ReviewFilmService reviewS = new ReviewFilmService(); reviewS.deletePost(codeReview); return ""; }
public ActionResult PagingIndex(int? page) { ReviewFilmService reviewS = new ReviewFilmService(); return PartialView(reviewS.getAllReviewFilm().ToPagedList(page ?? 1, 10)); }