Ejemplo n.º 1
0
        public ActionResult Insert_Film_Like(int MS_Phim)
        {
            AccountBus ac = new AccountBus();
            ThanhVien result = ac.getMemberByUserId(User.Identity.GetUserId());
            FilmLikeService film = new FilmLikeService();

            
            // true đã có
            // false chưa có;
            if (film.addFilmLike(result.MS_TaiKhoan, MS_Phim))
                return Content("success");
            else
                return Content("failure");
        }
Ejemplo n.º 2
0
 public double getRating(string p, int ms_phim)
  {
      FilmLikeService sv = new FilmLikeService();
      return sv.getRating(p, ms_phim);
  }
Ejemplo n.º 3
0
 public bool IsLikedByUser(string p, int ms_phim)
 {
     FilmLikeService sv = new FilmLikeService();
     return sv.checkList(p, ms_phim);
 }
Ejemplo n.º 4
0
        public ActionResult IsLiked(int MS_Phim)
        {

            // o tren nay se kiem tra no dang nhap hay chua
            if (User == null)
            {
                return Content("");
            }
            else
            {
                // doan nay la no ra dang nhap roi
                AccountBus ac = new AccountBus();
                ThanhVien result = ac.getMemberByUserId(User.Identity.GetUserId());
                FilmLikeService film = new FilmLikeService();

                if (film.checkList(result.MS_TaiKhoan, MS_Phim))
                    return Content("btn-success");
                else
                    return Content("");
            }
        }
Ejemplo n.º 5
0
        public String DeleteFilm(String IDFilm)
        {
            FilmLikeService filmS = new FilmLikeService();
            bool result = filmS.deleteFilm(User.Identity.GetUserId(), IDFilm);

            if (result)
                return "success";
            else
                return "failed";
        }
Ejemplo n.º 6
0
        public ActionResult PagingMyListFilmLike(int? page)
        {
            FilmLikeService film = new FilmLikeService();
            List<FilmLikeModels> lstFilmLike = film.getMyListFilmLike(User.Identity.GetUserId());

            List<PhimViewModels> result = new List<PhimViewModels>();
       
            PhimViewModels temp = new PhimViewModels();
            FilmService a = new FilmService();
            foreach (FilmLikeModels i in lstFilmLike)
            {
                temp = a.getFilmByMaso(i.ms_phim);
                result.Add(temp);
            }



            int PageSize = 2;
            int pageNumber = page ?? 1;
            return PartialView(result.ToPagedList(pageNumber, PageSize));
        }