Esempio n. 1
0
        private FIT_RESULT addToRoster(WeekRoster roster, Child currentChild, AttendanceRequest bringWish)
        {
            List<Child> children = roster.getChildren(bringWish.Dayparts);
            List<Caregiver> caregivers = roster.getCaregivers(bringWish.Dayparts);
            if (children.Count >= 13) // TODO: remove magic numbers
                return FIT_RESULT.FULL;
            if (children.Count + 1 - caregivers.Count * 5 > 0) // TODO: remove magic numbers
                return FIT_RESULT.INSUFFICIENT_CAREGIVERS;
            // TODO: max 3 babies

            roster.addChild(bringWish.Dayparts, currentChild);
            return FIT_RESULT.SUCCESS;
        }
Esempio n. 2
0
 private bool addCaregiver(WeekRoster roster, List<Caregiver> caregivers, AttendanceRequest bringWish)
 {
     List<Caregiver> rosteredCaregivers = roster.getCaregivers();            
     // first see if we can add a new parent before shifting            
     Caregiver availableCaregiver = getAvailableCaregiver(caregivers.Except(rosteredCaregivers).ToList(), bringWish);
     if (availableCaregiver != null)
     {
         roster.addCaregiver(bringWish.Dayparts, availableCaregiver);
         return true;
     }
     else
     {
         return shiftCaregiver(roster, caregivers, rosteredCaregivers, bringWish);
     }
 }