/// <summary> /// Raises the validation message. /// </summary> /// <param name="learner">The learner.</param> /// <param name="dAndP">The destination and progression.</param> public void RaiseValidationMessage(ILearner learner, ILearnerDestinationAndProgression dAndP) { var parameters = Collection.Empty <IErrorMessageParameter>(); parameters.Add(_messageHandler.BuildErrorMessageParameter(nameof(learner.ULN), learner.ULN)); parameters.Add(_messageHandler.BuildErrorMessageParameter(PropertyNameConstants.LearningDestinationAndProgressionULN, dAndP.ULN)); parameters.Add(_messageHandler.BuildErrorMessageParameter(PropertyNameConstants.LearningDestinationAndProgressionLearnRefNumber, dAndP.LearnRefNumber)); _messageHandler.Handle(RuleName, learner.LearnRefNumber, null, parameters); }
public bool HasULNForLearnRefNumber(string learnRefNumber, long uln, ILearnerDestinationAndProgression learnerDestinationAndProgression) { if (learnerDestinationAndProgression == null) { return(false); } return(learnerDestinationAndProgression.LearnRefNumber == learnRefNumber && learnerDestinationAndProgression.ULN == uln); }
public DPOutcome BuildDPOutcome(int ukprn, ILearnerDestinationAndProgression destinationAndProgression, IDPOutcome dpOutcome) { return(new DPOutcome { LearnRefNumber = destinationAndProgression.LearnRefNumber, OutCode = dpOutcome.OutCode, UKPRN = ukprn, OutCollDate = dpOutcome.OutCollDate, OutEndDate = dpOutcome.OutEndDateNullable, OutStartDate = dpOutcome.OutStartDate, OutType = dpOutcome.OutType }); }
public LearnerDestinationandProgression BuildLearnerDestinationAndProgression(int ukprn, ILearnerDestinationAndProgression destinationAndProgression) { return(new LearnerDestinationandProgression { UKPRN = ukprn, LearnRefNumber = destinationAndProgression.LearnRefNumber, ULN = destinationAndProgression.ULN }); }
public bool IsNotValid(ILearnerDestinationAndProgression dAndP, ILearner learner) => HasMatchingReferenceNumber(dAndP, learner) && IsNotMatchingLearnerNumber(dAndP, learner);
public bool HasMatchingReferenceNumber(ILearnerDestinationAndProgression dAndP, ILearner learner) => dAndP.LearnRefNumber == learner.LearnRefNumber;
public bool IsNotMatchingLearnerNumber(ILearnerDestinationAndProgression dAndP, ILearner learner) => dAndP.ULN != learner.ULN;