// GET: Review public ActionResult Index(int? page) { ViewBag.HomeStatus = "inactive"; ViewBag.VideoStatus = "inactive"; ViewBag.ReviewStatus = "active"; ViewBag.ContactStatus = "inactive"; if (page == null) { if (TempData["currentPage"] != null) { page = Int32.Parse(TempData["currentPage"].ToString()); //Chuyển hướng từ action delete } else { page = 1; TempData["currentPage"] = page; } } else TempData["currentPage"] = page; if (TempData["strSort"] == null) TempData["strSort"] = "ID"; FilmService phimService = new FilmService(); ViewBag.maxPage = phimService.countPage(); ViewBag.maxIndexPage = phimService.getMaxIndexPage(); return View(phimService.getAllFilms(page, (String)TempData["strSort"], false)); }
public ActionResult getStatisticPhimForCountry() { FilmService filmService = new FilmService(); Dictionary<string, int> result = filmService.getStatisticPhimForCountry(); string temp = "["; int i = 0; foreach (string key in result.Keys) { string t = ""; t += "['" + key + "', " + result[key] + "]"; if (i < result.Count - 1) { t += ","; } temp += t; i++; } temp += "]"; temp = temp.Replace("\'", "\""); return Content(temp); }
public ActionResult AdvanceSearch(int? page, String actor, String directer, String country, String type) { ViewBag.actor = actor; ViewBag.directer = directer; ViewBag.country = country; ViewBag.type = type; if (TempData["strSort"] == null) TempData["strSort"] = "ID"; if (TempData["sortDirection"] == null) TempData["sortDirection"] = "true"; FilmService phimService = new FilmService(); List<PhimViewModels> searchResult = phimService.searchFilm4(actor, directer, country, type); return View(searchResult); }
// GET: ReviewDetail public ActionResult Index(String IDPhim, String IDReview = "-1") { FilmService filmS = new FilmService(); TempData["MaSoReview"] = IDReview; return View(filmS.getFilmByID(IDPhim)); }
public ActionResult filmNew(int? page) { FilmService phimService = new FilmService(); List<PhimViewModels> result = phimService.findFilmNew(); int pageNumber = page ?? 1; int pageSize = 5; return PartialView(result.ToPagedList(pageNumber, pageSize)); }
public ActionResult getStatisticReview() { FilmService filmService = new FilmService(); int [] result = filmService.getStatisticReview(); var jsonSerialiser = new JavaScriptSerializer(); var json = jsonSerialiser.Serialize(result); return Content(json); }
public ActionResult SimpleSearch(int? page, String filmName) { ViewBag.filmName = filmName; if (TempData["strSort"] == null) TempData["strSort"] = "ID"; if (TempData["sortDirection"] == null) TempData["sortDirection"] = "true"; FilmService phimService = new FilmService(); List<PhimViewModels> searchResult = phimService.searchFilm(filmName); return View(searchResult); }
public ActionResult PagingSimpleSearch(int? page, String filmName) { ViewBag.filmName = filmName; if (TempData["strSort"] == null) TempData["strSort"] = "ID"; if (TempData["sortDirection"] == null) TempData["sortDirection"] = "true"; FilmService phimService = new FilmService(); ViewBag.maxIndexPage = phimService.getMaxIndexPage(); List<PhimViewModels> searchResult = phimService.searchFilm(filmName); return PartialView(searchResult.ToPagedList(page ?? 1,10)); }
public ActionResult Index(bool? homepage) { if (Request.IsAuthenticated) { if (User.IsInRole("Admin") && (!(homepage ?? false))) return RedirectToAction("Index", "AdminMain"); } ViewBag.HomeStatus = "active"; ViewBag.VideoStatus = "inactive"; ViewBag.ReviewStatus = "inactive"; ViewBag.ContactStatus = "inactive"; FilmService phimService = new FilmService(); ViewBag.maxIndexPage = phimService.getMaxIndexPage(); List<PhimViewModels> result = phimService.filmMax(); return View(result[0]); }
// GET: AdminMovies public ActionResult Index(int? page) { if (page == null) { if (TempData["currentPage"] != null) { page = Int32.Parse(TempData["currentPage"].ToString()); //Chuyển hướng từ action delete } else { page = 1; TempData["currentPage"] = page; } } else TempData["currentPage"] = page; if (TempData["strSort"] == null) TempData["strSort"] = "ID"; if (TempData["sortDirection"] == null) TempData["sortDirection"] = "false"; FilmService phimService = new FilmService(); ViewBag.maxPage = phimService.countPage(); ViewBag.maxIndexPage = phimService.getMaxIndexPage(); ViewBag.maxProductOnEachPage = phimService.getMaxProductOnEachPage(); return View(phimService.getAllFilms(page, (String)TempData["strSort"], Boolean.Parse(TempData["sortDirection"].ToString()))); }
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 EditFilm(HttpPostedFileBase file, HttpPostedFileBase banner, String reissue, String genre, String country, String content, String codeFilm, PhimViewModels fvm) { String fileName = ""; if (file != null && file.ContentLength > 0) { fileName = Path.GetFileName(file.FileName); var path = Path.Combine(Server.MapPath("~/Images/"), fileName); file.SaveAs(path); } String fileNameBanner = ""; if (banner != null && banner.ContentLength > 0) { fileNameBanner = Path.GetFileName(banner.FileName); var path = Path.Combine(Server.MapPath("~/Images/"), fileNameBanner); banner.SaveAs(path); } Phim p = new Phim(); p.MaSo = Int32.Parse(codeFilm); p.DiemDanhGia = fvm.DiemDanhGia; p.NoiDung = content; p.NgayPhatHanh = DateTime.ParseExact(reissue, "MM/dd/yyyy", null); ; p.TenPhim = fvm.TenPhim; p.TinhTrang = true; p.ThoiLuong = fvm.ThoiLuong; p.DaoDien = fvm.DaoDien; p.DienVien = fvm.DienVien; if (genre != "") p.MS_TheLoai = Int32.Parse(genre); if (country != "") p.MS_NuocSX = Int32.Parse(country); p.URL_Trailer = fvm.URL_Trailer; //Nếu người dùng không upload ảnh mới thì sẽ lấy lại ảnh cũ if (fileName != "") p.HinhAnh = "/Images/" + fileName; else p.HinhAnh = (String)TempData["currentAvatar"]; if (fileNameBanner != "") p.AnhBanner = "/Images/" + fileNameBanner; else p.AnhBanner = (String)TempData["currentBanner"]; FilmService filmsv = new FilmService(); filmsv.EditFilm(p); return RedirectToAction("Index"); }
public ActionResult ChangeMaxProductOnEachPage(string maxProductOnEachPage) { ViewBag.maxProductOnEachPage = maxProductOnEachPage; FilmService filmService = new FilmService(); filmService.changeMaxProdcuctOnEachPage(Int32.Parse(maxProductOnEachPage)); return RedirectToAction("Index"); }
public ActionResult AddNewFilm(HttpPostedFileBase file, HttpPostedFileBase banner, String reissue, String genre, String country, String content, PhimViewModels fvm)//String name, String rank, String actor, // String director, String duration, String reissue, String genre, String country, String content, String trailer) { String fileName = ""; if (file != null && file.ContentLength > 0) { fileName = Path.GetFileName(file.FileName); var path = Path.Combine(Server.MapPath("~/Images/"), fileName); file.SaveAs(path); } else { fileName = "defaultAvatar.jpg"; } String fileNameBanner = ""; if (banner != null && banner.ContentLength > 0) { fileNameBanner = Path.GetFileName(banner.FileName); var path = Path.Combine(Server.MapPath("~/Images/"), fileNameBanner); banner.SaveAs(path); } else { fileNameBanner = "defaultBanner.jpg"; } Phim p = new Phim(); p.DiemDanhGia = fvm.DiemDanhGia; p.NoiDung = content; p.NgayPhatHanh = DateTime.ParseExact(reissue, "MM/dd/yyyy", null); ; p.TenPhim = fvm.TenPhim; p.TinhTrang = true; p.ThoiLuong = fvm.ThoiLuong; p.DaoDien = fvm.DaoDien; p.DienVien = fvm.DienVien; if(genre != "") p.MS_TheLoai = Int32.Parse(genre); if(country != "") p.MS_NuocSX = Int32.Parse(country); p.URL_Trailer = fvm.URL_Trailer; p.HinhAnh = "/Images/" + fileName; p.AnhBanner = "/Images/" + fileNameBanner; FilmService filmsv = new FilmService(); TempData["CreateFilmResult"] = filmsv.addNewFilmd(p); return RedirectToAction("CreateFilmResult"); }
public ActionResult Edit(String codeFilm) { FilmService fsv = new FilmService(); return View(fsv.getFilmByID(codeFilm)); }
public ActionResult Delete(String codeFilm) { FilmService fsv = new FilmService(); fsv.deletePhim(codeFilm); getInfo(); return RedirectToAction("Index"); }
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)); }
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 ViewForCountry(String countryID, int? page, String strSort) { TempData["strSort"] = strSort; if (countryID == null) //Nếu không xem them thể loại thì xem tất cả các phim { return RedirectToAction("Index"); } ViewBag.ViewForCountry = true; ViewBag.countryID = countryID; ViewBag.HomeStatus = "inactive"; ViewBag.VideoStatus = "inactive"; ViewBag.ReviewStatus = "active"; ViewBag.ContactStatus = "inactive"; if (page == null) { if (TempData["currentPage"] != null) { page = Int32.Parse(TempData["currentPage"].ToString()); //Chuyển hướng từ action delete } else { page = 1; TempData["currentPage"] = page; } } else TempData["currentPage"] = page; if (TempData["strSort"] == null) TempData["strSort"] = "ID"; FilmService phimService = new FilmService(); ViewBag.maxIndexPage = phimService.getMaxIndexPage(); List<PhimViewModels> lstPhim = phimService.findByCountry(countryID, page, TempData["strSort"].ToString(), false); List<Phim> lstPhimSearch = phimService.findAllByCountry(countryID); ViewBag.maxPage = phimService.countPageSearch(lstPhimSearch); return View("Index", lstPhim); }
public ActionResult NhungBoPhimNoiBat() { FilmService filmS = new FilmService(); List<PhimViewModels> result = filmS.getNhungBoPhimNoiBat(); return View(result); }
public ActionResult CreatePost(String IDPhim) { FilmService bus = new FilmService(); return View(bus.getFilmByID(IDPhim)); }
public ActionResult PagingIndex(int? page) { FilmService filmService = new FilmService(); return PartialView(filmService.getNewFilms().ToPagedList(page ?? 1 , 8)); }