public void Validate(ILearner objectToValidate)
        {
            if (objectToValidate.LearningDeliveries == null)
            {
                return;
            }

            foreach (var learningDelivery in objectToValidate.LearningDeliveries)
            {
                var overlappingLearningDeliveryFAMs =
                    _learningDeliveryFAMQueryService
                    .GetOverLappingLearningDeliveryFAMsForType(learningDelivery.LearningDeliveryFAMs, _famTypeLSF);

                foreach (var learningDeliveryFAM in overlappingLearningDeliveryFAMs)
                {
                    HandleValidationError(
                        objectToValidate.LearnRefNumber,
                        learningDelivery.AimSeqNumber,
                        errorMessageParameters: BuildErrorMessageParameters(
                            _famTypeLSF,
                            learningDeliveryFAM.LearnDelFAMDateFromNullable,
                            learningDeliveryFAM.LearnDelFAMDateToNullable));
                }
            }
        }
예제 #2
0
        public void Validate(ILearner objectToValidate)
        {
            var learningDeliveryFAMs = GetApplicableLearningDeliveryFAMs(objectToValidate);

            var overlappingLearningDeliveryFAMs = _learningDeliveryFAMQueryService.GetOverLappingLearningDeliveryFAMsForType(learningDeliveryFAMs, _famTypeLSF);

            if (overlappingLearningDeliveryFAMs.Any())
            {
                HandleValidationError(objectToValidate.LearnRefNumber, errorMessageParameters: BuildErrorMessageParameters(_famTypeLSF));
            }
        }