public TicketSummary PlaceOrder(Guid eventId, string userId)
        {
            var parentEvent = _ctx.Events.Single(e => e.Id == eventId);

            var ticket = new Ticket()
            {
                AccessCode  = Ticket.GenerateRandomAccessCode(),
                Attendee    = userId,
                TotalPrice  = parentEvent.TicketPrice,
                Status      = TicketStatus.Pending,
                Id          = Guid.NewGuid(),
                ParentEvent = parentEvent
            };

            _ctx.Tickets.Add(ticket);
            _ctx.SaveChanges();

            var ticketSummary = new TicketSummary()
            {
                TicketId          = ticket.Id,
                TicketDescription = "Ticket for " + parentEvent.Name,
                TicketPrice       = ticket.TotalPrice
            };

            return(ticketSummary);
        }
示例#2
0
        public void StartQuickEdit()
        {
            //_oskProcess = Process.Start(@"C:\Program Files\Common Files\Microsoft Shared\ink\TabTip.exe");

            TicketSummary.Visibility = Visibility.Visible;
            AddIconLabel.Visibility  = Visibility.Collapsed;

            TicketSummary.Focus();
        }
        //TODO : 04 - Agrego metodo que consulta el ticketsummary
        public async Task <TicketSummary> GetTicketSummary(Guid ticketId, string userId)
        {
            var ticket = await _cloudContext.GetTicket(userId, ticketId);

            if (ticket != null)
            {
                var ticketSummary = new TicketSummary()
                {
                    TicketId          = ticket.Id,
                    TicketDescription = "Ticket for " + ticket.ParentEvent.Name,
                    TicketPrice       = ticket.TotalPrice,
                    IsPending         = ticket.Status == TicketStatus.Pending
                };
                return(ticketSummary);
            }
            return(new TicketSummary());
        }
示例#4
0
 public async Task <IEnumerable <CustomField> > GetCustomFields(TicketSummary ticket)
 {
     return(await GetCustomFields(ticket.IssueID));
 }