Ejemplo n.º 1
0
        /*
         *
         * Loads the booking slots based on the availability
         *
         *
         */
        private void bookingDateTXT_ValueChanged(object sender, EventArgs e)
        {
            bookingSlotTXT.Items.Clear();
            bookingSlotTXT.Text = "";
            List <string> bookingSlots = AppointmentHelper.getEmergencySlots(bookingDateTXT.Value);
            List <string> bookedSlots  = new List <string>();

            if (bookingSlots.Count != 0)
            {
                bookedSlots = AppointmentHelper.
                              bookedCheckupSlots(new DateTime(bookingDate.Year, bookingDate.Month, bookingDate.Day));
            }

            List <string> availableSlots = bookingSlots.Except(bookedSlots).ToList();

            if (availableSlots.Count == 0)
            {
                NoteTXT.Text = "Note: Slots not available for this day. Please select next day";
            }



            bookingSlotTXT.Items.AddRange(availableSlots.ToArray());
        }