}//end UpdateInstallationObject(x6) public void PopulateDateAndTimeUserControl(EmployeeBLL employee, DateTime selectedDate) { try { //get staff agenda SerializableDictionary<DateTime, DaySchedule> staffCalendar = employee.agenda.staffCalendar; //CHECK STAFF BUSY DAYS // Use var keyword to enumerate dictionary. The same as: foreach (KeyValuePair<string, int> pair in calendar) //R bool? isEmployeeBusy = AgendaBLL.IsStaffBusy(ref staffCalendar, selectedDate, selectedTime);//time is irrelevant here as this method is called to create this date on staff's calendar DaySchedule employeeDaySchedule = AgendaBLL.GetDaySchedule(ref staffCalendar, selectedDate); if (employeeDaySchedule != null) { //loop through day's time. ie: each hr and 1/h of the staff agenda foreach (var pair in employeeDaySchedule.daySchedule) { int tempTime; string tempTimeStatus; tempTime = pair.Key; tempTimeStatus = pair.Value; System.Diagnostics.Debug.Print("Key: {0}, Value: {1}", tempTime, tempTimeStatus); //check if staff is busy if (pair.Value == DaySchedule.GetDayStatusEnumString(DayStatusEnum.BUSY)) //set these on date&time usercontrol this.DateSelectionUserControl.DisableShowTimeCell(tempTime); }//endforloop }//endif else //staff daySchedule is empty so enable all buttons this.DateSelectionUserControl.EnableAllShowTimeCells(); //update LabelServProvider this.LabelServProvider.Text = employee.firstName; //employee.title + " " + employee.firstName; }//endtry catch (Exception ex) { System.Diagnostics.Debug.Print("<h2>BookAppt.aspx, PopulateDateAndTimeUserControl(x6)</h2>\n" + ex.ToString() + "\n" + ex.InnerException + "\n" + ex.Message); // Log the exception and notify system operators ExceptionUtility.LogException(ex, "BookAppt.aspx, PopulateDateAndTimeUserControl(x6)"); ExceptionUtility.NotifySystemOps(ex); } }