public IActionResult Index()
        {
            List <TicketsVM> model = _repo.GetAll().OrderByDescending(p => p.Tier).Select(p => new TicketsVM
            {
                Id          = p.ID,
                Name        = p.Name,
                Price       = p.Price,
                Description = p.Description,
                Tier        = p.Tier
            }).ToList();

            return(View(model));
        }
        public IActionResult List()
        {
            List <TicketTypeListVM> Model = _repo.GetAll().Select(p => new TicketTypeListVM
            {
                Id            = p.ID,
                Name          = p.Name,
                Price         = p.Price,
                TicketsBought = _repo.GetNumberOfTicketsBought(p.ID),
                Description   = p.Description
            }).ToList();

            return(View(Model));
        }
Ejemplo n.º 3
0
        public async Task <ActionResult> GetAll()
        {
            try
            {
                var ticketTypes = await _ticketTypeRepository.GetAll();

                if (ticketTypes != null)
                {
                    return(Ok(ticketTypes));
                }
                else
                {
                    return(NoContent());
                }
            }
            catch (Exception ex)
            {
                return(Problem(ex.Message));
            }
        }
Ejemplo n.º 4
0
 public IEnumerable <TicketTypeViewModel> GetAll()
 {
     return(_mapper.Map <IEnumerable <TicketTypeViewModel> >(_ticketTypeRepository.GetAll()));
 }
Ejemplo n.º 5
0
 public IQueryable <TicketType> GetAllTicketType(Expression <Func <TicketType, bool> > where, params Expression <Func <TicketType, object> >[] includes)
 {
     return(_iRespository.GetAll(where, includes));
 }
Ejemplo n.º 6
0
 private SelectList GetTicketTypesAsSelectList()
 {
     return(new SelectList(_ticketTypeRepository.GetAll(),
                           nameof(TicketType.id),
                           nameof(TicketType.Naam)));
 }
Ejemplo n.º 7
0
 public IEnumerable <TicketType> GetAllTicketTypes()
 {
     return(ticketTypeRepository.GetAll());
 }