Exemple #1
0
        public ActionResult FilterTournament(TournamentFillterViewModel tournamentFilterVM)
        {
            var filter = new TournamentFilter();

            filter.ConvertToTournametFilter(tournamentFilterVM);

            var result      = _tournamentService.FindTournament(filter);
            var tournaments = Mapper.Map <IEnumerable <Tournament>, IEnumerable <TournamentViewModel> >(result);

            return(PartialView(tournaments));
        }
Exemple #2
0
        public ActionResult FilterTournament(TournamentFillterViewModel tournamentFilterVM, int?page)
        {
            var filter = new TournamentFilter();

            filter.ConvertToTournametFilter(tournamentFilterVM);
            ViewBag.CurrentFilter = filter;

            var result      = _tournamentService.FindTournament(filter);
            var tournaments = Mapper.Map <IEnumerable <Tournament>, IEnumerable <TournamentViewModel> >(result);

            int pageSize   = 20;
            int pageNumber = (page ?? 1);

            return(PartialView(tournaments.ToPagedList(pageNumber, pageSize)));
        }