protected void PeriodList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ClinicList.SelectedIndex != 0 && DateTime.TryParseExact(datepicker.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out datetime))
     {
         AppointmentDAO dao   = new AppointmentDAO();
         string         shift = "Morning";
         if (PeriodList.SelectedIndex == 1)
         {
             shift = "Evening";
         }
         string        did   = getDoctorID();
         List <string> times = dao.getTimes(did, datepicker.Text, shift);
         if (times.Count == 1 && times[0].Length != 5)
         {
             Response.Write(times[0]);
         }
         else
         {
             TimeList.Items.Clear();
             for (int i = 0; i < times.Count; i++)
             {
                 TimeList.Items.Add(new ListItem(times[i]));
             }
         }
     }
 }
        protected void ClinicList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (ClinicList.SelectedIndex != 0)
            {
                finalPrice = (int)(Clinics[ClinicList.SelectedIndex - 1].getPrice() * Convert.ToDouble(Session["fraction"]));

                finalPriceBox.Text = Clinics[ClinicList.SelectedIndex - 1].getPrice() + " * " + Session["fraction"] + " = " + Clinics[ClinicList.SelectedIndex - 1].getPrice() * Convert.ToDouble(Session["fraction"]) + " L.E";
            }
            if (ClinicList.SelectedIndex != 0 && DateTime.TryParseExact(datepicker.Text, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out datetime))
            {
                AppointmentDAO dao = new AppointmentDAO();

                string did   = getDoctorID();
                string shift = "Morning";
                if (PeriodList.SelectedIndex == 1)
                {
                    shift = "Evening";
                }
                List <string> times = dao.getTimes(did, datepicker.Text, shift);
                if (times.Count == 1 && times[0].Length != 5)
                {
                    Response.Write(times[0]);
                }
                else
                {
                    TimeList.Items.Clear();
                    for (int i = 0; i < times.Count; i++)
                    {
                        TimeList.Items.Add(new ListItem(times[i]));
                    }
                }
            }
        }