public ActionResult Requests() { ViewBag.Message = "Here you can request subtitles."; SubtitlesVM vm = new SubtitlesVM(); vm.NewestMovies = (from item in repo.GetAllSubtitles() where item.state == State.Request orderby item.ID descending select item); return(View(vm)); }
/// Show all the Subtitles as well as orginized in to alphabetical order /// public ActionResult AllSubtitles() { ViewBag.Message = "Listi yfir alla skjátexta."; SubtitlesVM vm2 = new SubtitlesVM(); vm2.allFiles = (from item in repo.GetAllSubtitles() where item.state == State.Edit orderby item.name ascending select item); vm2.stuff = (from item in repo.GetAllSubtitles() where item.state == State.Edit orderby item.ID ascending group item by item.name[0]); return(View(vm2)); }
public ActionResult Index() { // Data for the category drop-down menu. var categoryList = new List <string>(); var categoryQry = from d in repo.GetAllSubtitles() orderby d.category select d.category; categoryList.AddRange(categoryQry.Distinct()); ViewBag.movieGenre = new SelectList(categoryList); // Drop-down data completed // Categorize the dota to fit the description (Top rated,Newest) SubtitlesVM vm = new SubtitlesVM(); vm.NewestMovies = (from item in repo.GetAllSubtitles() where item.state == State.Edit && item.category != "Þættir" orderby item.ID descending select item).Take(10); vm.NewestTV = (from item in repo.GetAllSubtitles() where item.state == State.Edit && item.category == "Þættir" orderby item.ID descending select item).Take(10); vm.PopularMovies = (from item in repo.GetAllSubtitles() where item.state == State.Edit && item.category != "Þættir" orderby item.upvote descending select item).Take(10); vm.PopularTV = (from item in repo.GetAllSubtitles() where item.state == State.Edit && item.category == "Þættir" orderby item.upvote descending select item).Take(10); return(View(vm)); }