예제 #1
0
        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));
        }
예제 #2
0
        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));
        }