示例#1
0
        public Booking GetBookingBy(int id)
        {
            var booking = new DbBookingDao().GetBy(id);

            booking.Event = new DbEventDao().GetBy(booking.EventId.Value);

            return(booking);
        }
示例#2
0
        public Booking GetNewestActiveBooking()
        {
            var booking = new DbBookingDao().GetNewestActive();

            if (booking != null)
            {
                booking.Event = new DbEventDao().GetBy(booking.EventId.Value);
            }

            return(booking);
        }
示例#3
0
        public IList <Booking> GetBookings(DateTime from, DateTime to)
        {
            var bookings = new DbBookingDao().GetBookings(from, to);
            var eventDao = new DbEventDao();

            foreach (var booking in bookings)
            {
                booking.Event = eventDao.GetBy(booking.EventId.Value);
            }

            return(bookings);
        }
示例#4
0
        public IList <Booking> GetUpcomingBookingsFor(DateTime date)
        {
            var bookings = new DbBookingDao().GetUpcomingBookings(date);
            var eventDao = new DbEventDao();

            foreach (var booking in bookings)
            {
                booking.Event = eventDao.GetBy(booking.EventId.Value);
            }

            return(bookings);
        }