Ejemplo n.º 1
0
        public ReservationDateRange(IEnumerable <ReservationDateRangeItem> reservations, DateRange range)
        {
            DateRange = range;

            int size = Convert.ToInt32(DateRange.Span.TotalSeconds);

            _buffer = new int[size];

            _reservations = reservations.ToList();
        }
Ejemplo n.º 2
0
 public ReservationDateRange(DateRange range) : this(0, range)
 {
 }
Ejemplo n.º 3
0
 public ReservationDateRange(int resourceId, DateRange range) : this(GetReservations(resourceId, range), range)
 {
 }
Ejemplo n.º 4
0
        private static IEnumerable <ReservationDateRangeItem> GetReservations(int resourceId, DateRange range)
        {
            var costs = ServiceProvider.Current.Data.Cost.FindToolCosts(resourceId, range.EndDate);

            var reservations = ServiceProvider.Current.Scheduler.Reservation.GetReservations(range.StartDate, range.EndDate, resourceId: resourceId);

            var result = reservations.ToList().Select(x => CreateReservation(x, costs)).ToList();

            return(result);
        }