Esempio n. 1
0
        /**
         * Method returns bookings per staff member per date
         *
         * @param date
         * @return dictionary linking bookings with staff members
         */
        private Dictionary <int, List <TimeRange> > getListOfBookingsPerStaffMemberPerDate(string date)
        {
            Dictionary <int, List <TimeRange> > bookingsPerMember = new Dictionary <int, List <TimeRange> >();

            List <IModel> bookedAppointments = bookingRepo.getBookedAppointmentsPerDate(date);

            if (bookedAppointments.Count > 0 || bookedAppointments != null)
            {
                foreach (BookingModel appointment in bookedAppointments)
                {
                    int staffId = appointment.getStaffModel().getStaffId();
                    if (!bookingsPerMember.ContainsKey(staffId))
                    {
                        bookingsPerMember.Add(staffId, new List <TimeRange>());
                    }
                    bookingsPerMember[staffId].Add(new TimeRange(appointment.getStartTime(), appointment.getEndTime()));
                }
                return(bookingsPerMember);
            }
            return(null);
        }
 /**
  * Method returns booked appointments per day
  *
  * @param date
  * @return list of appointments per date
  */
 public List <IModel> getBookedAppointmentsPerDate(string date)
 {
     return(repo.getBookedAppointmentsPerDate(date));
 }