Exemple #1
0
        private void ValidateTrainingProvider()
        {
            var trainingProviderValidator = new TrainingProviderValidator((long)VacancyRuleSet.TrainingProvider, _trainingProviderSummaryProvider, _blockedOrganisationRepo);

            RuleFor(x => x.TrainingProvider)
            .NotNull()
            .WithMessage("You must enter a training provider")
            .WithErrorCode(ErrorCodes.TrainingProviderUkprnNotEmpty)
            .SetValidator(trainingProviderValidator)
            .RunCondition(VacancyRuleSet.TrainingProvider)
            .WithRuleId(VacancyRuleSet.TrainingProvider);
        }
Exemple #2
0
        private void ValidateTrainingProvider()
        {
            var trainingProviderValidator = new TrainingProviderValidator((long)VacancyRuleSet.TrainingProvider, _trainingProviderSummaryProvider, _blockedOrganisationRepo);

            RuleFor(x => x.TrainingProvider)
            .NotNull()
            .WithMessage("You must enter a training provider or UKPRN to continue")
            .WithErrorCode(ErrorCodes.TrainingProviderUkprnNotEmpty)
            .SetValidator(trainingProviderValidator)
            .RunCondition(VacancyRuleSet.TrainingProvider)
            .WithRuleId(VacancyRuleSet.TrainingProvider);

            RuleFor(x => x)
            .TrainingProviderVacancyMustHaveEmployerPermission(_providerRelationshipService)
            .RunCondition(VacancyRuleSet.TrainingProvider)
            .WithRuleId(VacancyRuleSet.TrainingProvider);
        }