Exemple #1
0
        public virtual Booking[] GetTicketsForUser(string username)
        {
            var userRepository = new TicketMasterUserRepository(new UnitOfWork.UnitOfWork());
            var user           = userRepository.GetUserByName(username);

            return(DBContextFactory.GetDbContextInstance().Bookings.Where(p => p.UserId == user.UserId).ToArray());
        }
Exemple #2
0
        public virtual BookingTicketInfo[] GetTicketsForUserVerified()
        {
            var DBContext      = DBContextFactory.GetDbContextInstance();
            var userRepository = new TicketMasterUserRepository(new UnitOfWork.UnitOfWork());
            var tickets        = from t in DBContext.Tickets
                                 from b in DBContext.Bookings
                                 from u in DBContext.TicketMasterUsers
                                 where t.TicketId == b.TicketId && b.IsVerifiedPayment == true && u.UserId == b.UserId
                                 select new BookingTicketInfo
            {
                BookingId         = b.BookingId,
                EventName         = b.Ticket.Event.EventName,
                IsVerifiedPayment = true,
                NumberOfTickets   = (int)b.NumberOfTickets,
                Username          = u.UserName
            };

            return(tickets.ToArray());
        }