Exemplo n.º 1
0
 public decimal CalculateBeneficiaryDiscountPaycheckValue(BeneficiaryContract beneficiary, IEnumerable <IDiscount> potentialDiscounts, int numberOfPaychecks)
 {
     return(decimal.Round(
                potentialDiscounts.Where(x => x.CheckIfApplicable(beneficiary))
                .Select(x => decimal.Round(x.CalculateValue(beneficiary) / numberOfPaychecks, 2, MidpointRounding.AwayFromZero)
                        ).Sum(), 2, MidpointRounding.AwayFromZero));
 }
Exemplo n.º 2
0
 public decimal CalculateValue(BeneficiaryContract beneficiary)
 {
     return(decimal.Round(beneficiary.AnnualElectedBenefitsCost * NAME_DISCOUNT_PERCENTAGE, 2, MidpointRounding.AwayFromZero));
 }
Exemplo n.º 3
0
 public bool CheckIfApplicable(BeneficiaryContract beneficiary)
 {
     return(beneficiary.FirstName.ToLower().StartsWith("a"));
 }