public Boolean IsProgramFullyEnrolled() { List <EnrollmentModel> enrollmentList = new EnrollmentTable().readAll(); var enrollmentForProgramList = enrollmentList.Where(enrollment => enrollment.programId == (cbxProgram.SelectedItem as dynamic).Value); var enrollmentCountForProgram = enrollmentForProgramList.Count(); var programIndex = new ForeignKeyHelper().findIndexOfProgramID(programList, (cbxProgram.SelectedItem as dynamic).Value); var programVarietyId = programList[programIndex].programVarietyId; var programVarietyIndex = new ForeignKeyHelper().findIndexOfProgramVarietyID(programVarietyList, programVarietyId); var dogSpacesMaximum = programVarietyList[programVarietyIndex].dogSpacesMaximum; if (enrollmentCountForProgram == dogSpacesMaximum) { return(true); } else { return(false); } }