Ejemplo n.º 1
0
 /**
  * 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);
 }
Ejemplo n.º 2
0
 /**
  * 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);
 }
Ejemplo n.º 3
0
        /** 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;
        }