public PartialViewResult HomeList_byLatest2(string Page) { AgfMembershipProvider membership = new AgfMembershipProvider(); MovieAccess movieAccess = new MovieAccess(); bool check; if (check = System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { var user = User.Identity.Name.ToString(); Guid?userId = membership.GetUserIdByEmail(user); var res = movieAccess.GetHomeList(userId).OrderBy(s => s.DateAdded); var count = Math.Ceiling(res.Count() / 6.0); ViewBag.Pages = count; int page = int.Parse(Page == null ? "1" : Page); ViewBag.Page = page; res = res.Skip((page - 1) * 6).ToList().Take(6).OrderBy(s => s.DateAdded); return(PartialView("_GetCardss", res)); } else { var res = movieAccess.GetHomeList().OrderBy(s => s.DateAdded); return(PartialView("_GetCardss", res)); } }
// GET: Home public ActionResult Index() { MovieAccess ma = new MovieAccess(); List <homeList_vm> cards = new List <homeList_vm>(); cards = ma.GetHomeList(); return(View(cards)); }
// GET: Common/HomeList public ActionResult HomeList() { MovieAccess movieAccess = new MovieAccess(); var user = User.Identity.Name.ToString(); var res = movieAccess.GetHomeList().OrderBy(s => s.DateAdded); return(View(res)); }
public ActionResult GetCards() { MovieAccess ma = new MovieAccess(); List <homeList_vm> cards = new List <homeList_vm>(); cards = ma.GetHomeList(); return(PartialView("MovieCards", cards)); }
public PartialViewResult HomeList_byLatest() { MovieAccess movieAccess = new MovieAccess(); var res = movieAccess.GetHomeList().OrderBy(s => s.DateAdded); var count = Math.Ceiling(res.Count() / 6.0); ViewBag.Pages = count; return(PartialView("_GetCardss", res)); }
// GET: Users/AGF100 public ActionResult AGF100() { AgfMembershipProvider membership = new AgfMembershipProvider(); MovieAccess movieAccess = new MovieAccess(); bool check; if (check = System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { var user = User.Identity.Name.ToString(); Guid?userId = membership.GetUserIdByEmail(user); var res = movieAccess.GetHomeList(userId).OrderByDescending(s => s.GreatnessRating); return(View(res)); } else { var res = movieAccess.GetHomeList().OrderByDescending(s => s.GreatnessRating); return(View(res)); } }
public PartialViewResult _fav() { AgfMembershipProvider membership = new AgfMembershipProvider(); MovieAccess movieAccess = new MovieAccess(); bool check; if (check = System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { var user = User.Identity.Name.ToString(); Guid?userId = membership.GetUserIdByEmail(user); var res = movieAccess.GetUserFavMovies(userId).OrderByDescending(s => s.DateAdded); ViewBag.ListTitle = "Favorite"; var Tcount = res.Count(); ViewBag.Fcount = Tcount; return(PartialView("_UserListContainer", res)); } else { var res = movieAccess.GetHomeList().OrderByDescending(s => s.DateAdded); return(PartialView("_UserListContainer", res)); } }
// GET: Users/UserProfile public ActionResult UserProfile() { AgfMembershipProvider membership = new AgfMembershipProvider(); MovieAccess movieAccess = new MovieAccess(); bool check; if (check = System.Web.HttpContext.Current.User.Identity.IsAuthenticated) { var user = User.Identity.Name.ToString(); Guid?userId = membership.GetUserIdByEmail(user); var res = movieAccess.GetUserToWatchMovies(userId).OrderByDescending(s => s.DateAdded); var resWatched = movieAccess.GetUserWatchedMovies(userId).OrderByDescending(s => s.DateAdded); var resFav = movieAccess.GetUserFavMovies(userId).OrderByDescending(s => s.DateAdded); var Tcount = res.Count(); var Wcount = resWatched.Count(); var Fcount = resFav.Count(); ViewBag.count = Tcount; ViewBag.Wcount = Wcount; ViewBag.Fcount = Fcount; ViewBag.ListTitle = "To-Watch"; return(View(res)); } else { var res = movieAccess.GetHomeList().OrderByDescending(s => s.DateAdded); return(View(res)); } }