Beispiel #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);
 }
 /// <summary>
 /// Creates an instance of ScorecardGoalCalculator and returns
 /// </summary>
 /// <returns></returns>
 protected virtual ScorecardGoalCalculator CreateScorecardGoalCalculator(
     IBaseRepository <Target> targetRepository,
     IBaseRepository <DailyActual> dailyActualRepository,
     IBaseRepository <ScorecardWorkdayPattern> scorecardWorkdayPatternRepository,
     IBaseRepository <ScorecardHolidayPattern> scorecardHolidayPatternRepository,
     IBaseRepository <ScorecardWorkdayTracker> scorecardWorkdayTrackerRepository)
 {
     if (goalCalculator == null)
     {
         goalCalculator = new ScorecardGoalCalculator(targetRepository, dailyActualRepository,
                                                      scorecardWorkdayPatternRepository, scorecardHolidayPatternRepository, scorecardWorkdayTrackerRepository);
     }
     return(goalCalculator);
 }
Beispiel #3
0
        /// <summary>
        /// Parametrized constructor
        /// </summary>
        /// <param name="dailyTargetRepository">The daily target repository.</param>
        /// <param name="monthlyTargetRepository">The monthly target repository.</param>
        /// <exception cref="System.ArgumentNullException">Repository - The given parameter cannot be null.</exception>
        public TargetModifier(IBaseRepository <DailyTarget> dailyTargetRepository,
                              IBaseRepository <MonthlyTarget> monthlyTargetRepository,
                              IBaseRepository <User> userRepository,
                              IBaseRepository <Metric> metricRepository,
                              ScorecardGoalCalculator goalCalculator,
                              HolidayCalculator holidayCalculator)
        {
            if (dailyTargetRepository == null || monthlyTargetRepository == null || userRepository == null || metricRepository == null)
            {
                throw new ArgumentNullException("Repository",
                                                "The given parameter cannot be null.");
            }

            this.dailyTargetRepository   = dailyTargetRepository;
            this.monthlyTargetRepository = monthlyTargetRepository;
            this.userRepository          = userRepository;
            this.metricRepository        = metricRepository;
            this.goalCalculator          = goalCalculator;
            this.holidayCalculator       = holidayCalculator;
        }
        /// <summary>
        /// Parameterized constructor
        /// </summary>
        /// <param name="scorecardRepository">Scorecard Repository</param>
        /// <param name="targetRepository">Target repository</param>
        /// <param name="yearRepository">Year Repository</param>
        /// <param name="dailyActualRepository">Daily Actual Repository</param>
        /// <param name="monthlyActualRepository">Monthly Actual Repository</param>
        /// <param name="monthlyTargetRepository">Monthly target repository</param>
        /// <param name="holidayRepository">Holiday repository</param>
        /// <param name="counterMeasureManager">Counter measure manager</param>
        public MTDPerformanceCalculator(IBaseRepository <Target> targetRepository,
                                        IBaseRepository <DailyActual> dailyActualRepository,
                                        IBaseRepository <MonthlyActual> monthlyActualRepository,
                                        IBaseRepository <ScorecardHolidayPattern> scorecardHolidayPatternRepository,
                                        IBaseRepository <ScorecardWorkdayTracker> scorecardWorkdayTrackerRepository,
                                        IBaseRepository <ScorecardWorkdayPattern> scorecardWorkdayPatternRepository
                                        )
        {
            if (targetRepository == null || dailyActualRepository == null ||
                scorecardWorkdayTrackerRepository == null || scorecardHolidayPatternRepository == null ||
                scorecardWorkdayPatternRepository == null || monthlyActualRepository == null)
            {
                throw new ArgumentNullException("Repository",
                                                "The given parameter cannot be null.");
            }

            this.dailyActualRepository   = dailyActualRepository;
            this.monthlyActualRepository = monthlyActualRepository;
            this.holidayCalculator       = CreateHolidayCalculator(dailyActualRepository, scorecardHolidayPatternRepository
                                                                   , scorecardWorkdayTrackerRepository, scorecardWorkdayPatternRepository);
            this.goalCalculator = CreateScorecardGoalCalculator(targetRepository,
                                                                dailyActualRepository, scorecardWorkdayPatternRepository, scorecardHolidayPatternRepository, scorecardWorkdayTrackerRepository);
        }