/** * Method checks if there are any afternoon appointments in given dayBox * * @param box dayOfWeekBox object * @return indicates if the afternoon appointments were requested and available */ private bool areAfternoonAppointmentsRequestedAndAvailable(dayOfaWeekBox box) { if (afternoonAppointmentsCheckbox.Checked) { return(box.morningAppointments > 0); } return(true); }
/** * Method filters results to days containing appointments for selected staff member * * @param box dayOfaWeekBox object * @param selectedStaffMember object representing selected staff member * @return indicates if staff member is available */ private bool isStaffMemberAvailable(dayOfaWeekBox box, ListItem selectedStaffMember) { if (selectedStaffMember.id != 0) { foreach (KeyValuePair <int, string> entry in box.staffMembersPerDate) { if (entry.Key == selectedStaffMember.id) { return(true); } } return(false); } return(true); }
/** Method generates boxes containing number of appointments and day */ private void generateDayBoxes() { AbsenceRepo absenceRepo = new AbsenceRepo(); monthLabel.Text = date.ToString("MMMM").ToUpper(); yearLabel.Text = date.ToString("yyyy").ToUpper(); appointmentDaysPanel.Visible = false; foreach (int dayNo in this.getWorkingDays(this.date.Year, this.date.Month)) { string dateToBeAdded = new DateTime(this.date.Year, this.date.Month, dayNo).ToString("yyyy-MM-dd"); List <IModel> absences = absenceRepo.getSurgeryAbsencesPerDate(dateToBeAdded); if (absences == null) { dayOfaWeekBox dayBox = new dayOfaWeekBox(new DateTime(this.date.Year, this.date.Month, dayNo)); appointmentDaysPanel.Controls.Add(dayBox); this.dayBoxes.Add(dayBox); } } appointmentDaysPanel.Visible = true; }