Ejemplo n.º 1
0
        protected override decimal CalculateSalary(DateTime salaryDate, SalaryBuilder builder)
        {
            int periodInMonthes = DateTimeHelper.GetDifferenceInMonthes(jobStartDate, salaryDate);
            int numYears        = periodInMonthes / 12;

            builder.ApplyYearsRate(numYears, 0.03m, 0.3m);
            return(periodInMonthes * builder.Salary);
        }
Ejemplo n.º 2
0
        protected override decimal CalculateSalary(DateTime salaryDate, SalaryBuilder builder)
        {
            int periodInMonthes = DateTimeHelper.GetDifferenceInMonthes(jobStartDate, salaryDate);
            int numYears        = periodInMonthes / 12;
            IEnumerable <Worker> subordinates = Subordinates.Select(s => s.Worker);

            builder.ApplyYearsRate(numYears, 0.01m, 0.35m);
            builder.ApplySubordinatorsRate(salaryDate, 0.03m, subordinates);
            return(periodInMonthes * builder.Salary);
        }