예제 #1
0
 public ActionResult <Models.Ticket> GetTicketById(int ticketId)
 {
     try
     {
         return(Ok(new OkResponse <Models.Ticket>(_ticket.GetTicketById(ticketId))));
     }
     catch (TicketNotFoundException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(BadRequest(new ErrorResponse(e.Message, new List <string>()
         {
             "ticketId"
         })));
     }
 }
예제 #2
0
        private Models.TicketPurchase TransformDaoToBusinessLogicTicketPurchase(TicketPurchaseDao ticketPurchaseDao)
        {
            var person       = _person.GetPersonById(ticketPurchaseDao.PersonId);
            var ticket       = _ticket.GetTicketById(ticketPurchaseDao.TicketId);
            var sellingPoint = _sellingPoint.GetSellingPointById(ticketPurchaseDao.SellingPointId);

            return(new Models.TicketPurchase()
            {
                Id = ticketPurchaseDao.Id,
                Ticket = ticket,
                Person = person,
                SellingPoint = sellingPoint,
                Date = ticketPurchaseDao.Date
            });
        }