Exemplo n.º 1
0
        public static int FundingCapOn(this ITrainingProgramme course, DateTime date)
        {
            if (!course.IsActiveOn(date))
            {
                return(0);
            }

            var applicableFundingPeriod = course.FundingPeriods.FirstOrDefault(x => GetStatusOn(x.EffectiveFrom, x.EffectiveTo, date) == TrainingProgrammeStatus.Active);

            return(applicableFundingPeriod?.FundingCap ?? 0);
        }
Exemplo n.º 2
0
 public static bool IsActiveOn(this ITrainingProgramme course, DateTime date)
 {
     return(GetStatusOn(course.EffectiveFrom, course.EffectiveTo, date) == TrainingProgrammeStatus.Active);
 }
Exemplo n.º 3
0
 public static TrainingProgrammeStatus GetStatusOn(this ITrainingProgramme course, DateTime date)
 {
     return(GetStatusOn(course.EffectiveFrom, course.EffectiveTo, date));
 }