Beispiel #1
0
 /// <summary>
 /// Creates an instance of Target Metric Validator and returns
 /// </summary>
 /// <returns></returns>
 protected virtual TargetMetricValidator CreateTargetMetricValidator(
     IBaseRepository <Target> targetRepository,
     IBaseRepository <Scorecard> scorecardRepository,
     IBaseRepository <Metric> metricRepository)
 {
     if (targetMetricValidator == null)
     {
         targetMetricValidator = new TargetMetricValidator(targetRepository,
                                                           scorecardRepository, metricRepository);
     }
     return(targetMetricValidator);
 }
Beispiel #2
0
 /// <summary>
 /// Parameterized constructor
 /// </summary>
 /// <param name="targetRepository">Target Repository</param>
 /// <param name="dailyActualRepository">Daily Actual Repository</param>
 /// <param name="yearRepository">Year Repository</param>
 /// <param name="scorecardRepository">Scorecard Repository</param>
 /// <param name="metricRepository">Metric Repository</param>
 public TargetValidator(IBaseRepository <Target> targetRepository,
                        IBaseRepository <DailyActual> dailyActualRepository,
                        IBaseRepository <MonthlyActual> monthlyActualRepository,
                        IBaseRepository <Year> yearRepository,
                        IBaseRepository <Scorecard> scorecardRepository,
                        IBaseRepository <Metric> metricRepository)
 {
     if (targetRepository == null || dailyActualRepository == null ||
         monthlyActualRepository == null || yearRepository == null ||
         scorecardRepository == null || metricRepository == null)
     {
         throw new ArgumentNullException("Repository",
                                         "The given parameter cannot be null.");
     }
     this.targetRepository        = targetRepository;
     this.dailyActualRepository   = dailyActualRepository;
     this.monthlyActualRepository = monthlyActualRepository;
     this.yearRepository          = yearRepository;
     this.scorecardRepository     = scorecardRepository;
     this.metricRepository        = metricRepository;
     this.targetMetricValidator   = CreateTargetMetricValidator(targetRepository,
                                                                scorecardRepository, metricRepository);
 }