public ActionResult Credits() { Account acc = _accountRepository.GetAccountById(_auth.Decrypt()); CreditsViewmodel vm = new CreditsViewmodel(); vm.Account = acc; return(View(vm)); }
public ActionResult Credits(Account acc) { TicketAuthenticator auth = new TicketAuthenticator(); Account a = _accountRepository.GetAccountById(auth.Decrypt()); _accountRepository.AddCredits(a, 10); a = _accountRepository.GetAccountById(auth.Decrypt()); return(View(a)); }
public ActionResult Index() { int accId = _auth.Decrypt(); List <Film> listFilms = _winkelmandRepository.GetFilmsInWinkelmand(_winkelmandRepository.GetWinkelmandId(accId)); AccountWinkelmandGenreViewmodel viewmodel = new AccountWinkelmandGenreViewmodel { Winkelmand = new Winkelmand(listFilms, _winkelmandRepository.GetPrijs(listFilms)), Genres = _genreRepository.GetAllGenres(), Account = _accountRepository.GetAccountById(accId) }; return(View(viewmodel)); }
public ActionResult Index(string gekozenGenre) { if (gekozenGenre == "Alles") { return(RedirectToAction("Index")); } TicketAuthenticator auth = new TicketAuthenticator(); Account acc = _accountRepository.GetAccountById(auth.Decrypt()); acc.Films = _filmRepository.GetBoughtFilms(acc.Id); acc.Winkelmand = new Winkelmand { Films = _winkelmandRepository.GetFilmsInWinkelmand(_winkelmandRepository.GetWinkelmandId(acc.Id)) }; FilmIndexViewmodel viewmodel = new FilmIndexViewmodel { ListGenres = _genreRepository.GetAllGenres(), ListFilm = new List <Film>(), Account = acc, AllFilmsCount = _filmRepository.GetAllFilms().Count }; List <int> filmIds = _genreRepository.GetFilmsWithGenre(gekozenGenre); foreach (int id in filmIds) { viewmodel.ListFilm.Add(_filmRepository.GetById(id)); } return(View(viewmodel)); }
public ActionResult Films(string gekozenGenre) { if (gekozenGenre == "Alles") { return(RedirectToAction("Films")); } int accId = _auth.Decrypt(); Account acc = _accountRepository.GetAccountById(accId); acc.Films = _filmRepository.GetBoughtFilms(accId).Where(x => x.ListGenres.Exists(y => y.Naam == gekozenGenre)).ToList(); AccountFilmsViewmodel viewmodel = new AccountFilmsViewmodel { Genres = _genreRepository.GetAllGenres(), Account = acc, AllFilmsCount = _filmRepository.GetBoughtFilms(accId).Count }; return(View(viewmodel)); }
public ActionResult Index() { int accId = _auth.Decrypt(); int winkelmandId = _winkelmandRepository.GetWinkelmandId(accId); List <Film> listFilms = _winkelmandRepository.GetFilmsInWinkelmand(winkelmandId); AccountWinkelmandGenreViewmodel viewmodel = new AccountWinkelmandGenreViewmodel { Winkelmand = new Winkelmand(listFilms, _winkelmandRepository.GetPrijs(listFilms)), Genres = _genreRepository.GetAllGenres(), Account = _accountRepository.GetAccountById(accId), AllFilmsCount = _winkelmandRepository.GetFilmsInWinkelmand(winkelmandId).Count }; if (_teWeinig) { ViewBag.teWeinig = "Te weinig credits"; } return(View(viewmodel)); }
public ActionResult Films() { TicketAuthenticator auth = new TicketAuthenticator(); int accId = auth.Decrypt(); Account acc = _accountRepository.GetAccountById(accId); acc.Films = _filmRepository.GetBoughtFilms(accId); AccountFilmsViewmodel viewmodel = new AccountFilmsViewmodel { Genres = _genreRepository.GetAllGenres(), Account = acc }; return(View(viewmodel)); }
public ActionResult Index() { TicketAuthenticator auth = new TicketAuthenticator(); List <Film> films = new List <Film>(); Account acc = _accountRepository.GetAccountById(auth.Decrypt()); acc.Winkelmand = new Winkelmand(); acc.Winkelmand.Films = _winkelmandRepository.GetFilmsInWinkelmand(_winkelmandRepository.GetWinkelmandId(acc.Id));; FilmIndexViewmodel viewmodel = new FilmIndexViewmodel { ListFilm = _filmRepository.GetAllFilms(), ListGenres = _genreRepository.GetAllGenres(), Account = acc }; return(View(viewmodel)); }