Exemple #1
0
 /// <summary>
 /// Parameterized constructor
 /// </summary>
 /// <param name="targetRepository">Target Repository</param>
 /// <param name="dailyActualRepository">Daily Actual Repository</param>
 /// <param name="monthlyActualRepository">Monthly Actual Repository</param>
 /// <param name="userRepository">User Repository</param>
 /// <param name="scorecardWorkdayPatternRepository">The scorecard workday pattern repository.</param>
 /// <param name="scorecardHolidayPatternRepository">The scorecard holiday pattern repository.</param>
 /// <param name="scorecardWorkdayTrackerRepository">The scorecard workday tracker repository.</param>
 /// <exception cref="System.ArgumentNullException">Repository - The given parameter cannot be null.</exception>
 public ActualsModifier(IBaseRepository <Target> targetRepository,
                        IBaseRepository <DailyActual> dailyActualRepository,
                        IBaseRepository <MonthlyActual> monthlyActualRepository,
                        IBaseRepository <User> userRepository,
                        IBaseRepository <ScorecardWorkdayPattern> scorecardWorkdayPatternRepository,
                        IBaseRepository <ScorecardHolidayPattern> scorecardHolidayPatternRepository,
                        IBaseRepository <ScorecardWorkdayTracker> scorecardWorkdayTrackerRepository,
                        IBaseRepository <MonthlyTarget> monthlyTargetRepository,
                        IBaseRepository <DailyTarget> dailyTargetRepository,
                        IBaseRepository <DailyTargetHistory> dailyTargetHistoryRepository)
 {
     if (targetRepository == null || dailyActualRepository == null ||
         monthlyActualRepository == null || userRepository == null || monthlyTargetRepository == null ||
         dailyTargetRepository == null || dailyTargetHistoryRepository == null)
     {
         throw new ArgumentNullException("Repository",
                                         "The given parameter cannot be null.");
     }
     this.targetRepository             = targetRepository;
     this.dailyActualRepository        = dailyActualRepository;
     this.monthlyActualRepository      = monthlyActualRepository;
     this.userRepository               = userRepository;
     this.monthlyTargetRepository      = monthlyTargetRepository;
     this.dailyTargetRepository        = dailyTargetRepository;
     this.dailyTargetHistoryRepository = dailyTargetHistoryRepository;
     this.actualCalculator             = CreateScorecardActualCalculator(dailyActualRepository);
     this.goalCalculator               = CreateScorecardGoalCalculator(targetRepository, dailyActualRepository, scorecardWorkdayPatternRepository,
                                                                       scorecardHolidayPatternRepository, scorecardWorkdayTrackerRepository);
 }
Exemple #2
0
 /// <summary>
 /// Creates an instance of ScorecardActualCalculator and returns
 /// </summary>
 /// <returns></returns>
 protected virtual ScorecardActualCalculator CreateScorecardActualCalculator(
     IBaseRepository <DailyActual> dailyActualRepository)
 {
     if (actualCalculator == null)
     {
         actualCalculator = new ScorecardActualCalculator(dailyActualRepository);
     }
     return(actualCalculator);
 }