Beispiel #1
0
        /// <summary>
        /// If the learning aim is not part of an apprenticeship or traineeship, then the Learning start date must not be after the current teaching year
        /// </summary>
        /// <param name="ld"></param>
        /// <returns></returns>
        internal void ValidateLearnStartDate03(MessageLearnerLearningDelivery ld, MessageLearner learner)
        {
            var dd07Result    = _dd07IsYRule.Evaluate(ld);
            var academicStart = DateTime.Parse(_referenceData.Get("AcademicYearStart"));

            var result = dd07Result == DDO7_RULE_NO &&
                         ld.ProgType != 24 &&
                         (ld.LearnStartDate - academicStart.AddDays(364)).TotalDays > 0;

            if (result)
            {
                _validationErrorHandler.Handle(learner, "Error - ValidateLearnStartDate03");
            }
        }
Beispiel #2
0
        public void Validate(MessageLearner objectToValidate)
        {
            if (!LearnerConditionMet(objectToValidate.DateOfBirthNullable))
            {
                return;
            }

            var sixteenthBirthday = objectToValidate.DateOfBirth.AddYears(16);
            var lastFridayJuneAcademicYearLearnerSixteen = _dateHelper.GetLastFridayInJuneOfAcademicYear(sixteenthBirthday);

            foreach (var learningDelivery in objectToValidate.LearningDelivery.Where(ld => !Exclude(ld.ProgType)))
            {
                if (DD07ConditionMet(_dd07Rule.Evaluate(learningDelivery)) &&
                    DD04ConditionMet(DD04(objectToValidate, learningDelivery), _validationData.ApprencticeProgAllowedStartDate, lastFridayJuneAcademicYearLearnerSixteen))
                {
                    _validationErrorHandler.Handle(objectToValidate, RuleNameConstants.DateOfBirth_48);
                }
            }
        }
 public void Validate(MessageLearner objectToValidate)
 {
     foreach (var learningDelivery in objectToValidate.LearningDelivery)
     {
         if (ConditionMet(learningDelivery.LearnStartDate, _validationData.AcademicYearEnd, _dd07Rule.Evaluate(learningDelivery)))
         {
             _validationErrorHandler.Handle(objectToValidate, RuleNameConstants.LearnStartDate_12);
         }
     }
 }
Beispiel #4
0
 public bool Evaluate(MessageLearnerLearningDelivery ObjectToValidate)
 {
     return(_dd07Rule.Evaluate(ObjectToValidate) != "Y");
 }
Beispiel #5
0
 public bool Evaluate(MessageLearner objectToValidate)
 {
     return(objectToValidate.LearningDelivery.Any(ld => _dd07Rule.Evaluate(ld) == "Y"));
 }