示例#1
0
 // GET: RentalAdmin
 public ActionResult Index(int?page)
 {
     return(userTypeService.Authorize(() =>
     {
         IQueryable <Reservation> reservationsQuery = reservationRepository.GetAll(nameof(Reservation.User), nameof(Reservation.ReservationStatus), nameof(Reservation.BoardGame));
         return View(reservationsQuery.OrderBy(r => r.RentalEndDate).ToPagedList(page ?? 1, 10));
     }, UserType.Administrator, UserType.Employee));
 }
 public ActionResult Rental(DateTime rentalStartDate, DateTime rentalEndDate, int boardGameId, string boardGameName, int count, string discountCode, string rentalCostPerDay)
 {
     return(userTypeService.Authorize(() =>
     {
         return RedirectToAction("Index", "Rental", new { rentalStartDate, rentalEndDate, boardGameId, boardGameName, count, discountCode, rentalCostPerDay });
     }, UserType.Regular));
 }
示例#3
0
        // GET: BoardGamesCollection
        public ActionResult BoardGamesCollection(int?page)
        {
            IQueryable <DAL.Models.BoardGame> boardGamesQuery = boardGamesService.GetAll();

            return(userTypeService.Authorize(() => View(boardGameSortService.SortBy(boardGamesQuery, BLL.Enums.BoardGameSortOption.SortAscendingByName).Select(bg => new BoardGame()
            {
                BoardGameId = bg.BoardGameId,
                Name = bg.Name,
                Description = bg.Description,
                Content = bg.Content,
                Image = bg.Image,
                GameTimeInMinutes = bg.GameTimeInMinutes,
                MinPlayerCount = bg.MinPlayerCount,
                MaxPlayerCount = bg.MaxPlayerCount,
                MinimumAge = bg.MinimumAge,
                BoardGameStateName = bg.BoardGameState.Name,
                BoardGamePublisherName = bg.BoardGamePublisher.Name,
                BoardGameCategoryName = bg.BoardGameCategory.Name,
                ImagePath = bg.ImagePath,
                DetailsImagePath = bg.DetailsImagePath
            }).ToPagedList(page ?? 1, 5)), UserType.Administrator, UserType.Employee));
        }
 // GET: DiscountAdmin
 public ActionResult Index()
 {
     return(userTypeService.Authorize(() => View(discountCodeRepository.GetAll(nameof(BoardGame), nameof(DiscountCodeStatus))), UserType.Administrator, UserType.Employee));
 }
 public ActionResult Index()
 {
     return(userTypeService.Authorize(ListCategories, UserType.Administrator, UserType.Employee));
 }
示例#6
0
 // GET: BoardGamePublisher
 public ActionResult Index()
 {
     return(userTypeService.Authorize(() => View(boardGamePublishersService.GetAll().ToList()), UserType.Administrator, UserType.Employee));
 }