public static IPaymentCalculator GetRuleCalculator(UserResultVM user, UserResult initialUserResult, long ruleTypeId)
        {
            IPaymentCalculator calculator = null;

            switch ((RuleType)ruleTypeId)
            {
            case RuleType.Annual:
            {
                calculator = new AnnualRuleCalculator();
                break;
            }

            case RuleType.Month:
            {
                calculator = new MonthlyRuleCalculator();
                break;
            }

            case RuleType.Weekend:
            {
                calculator = new WeekendRuleCalculator();
                break;
            }
            }

            calculator.Configure(user, initialUserResult);

            return(calculator);
        }
        public static IPaymentCalculator GetBaseRateCalculator(UserResultVM user, UserResult initialUserResult, int rateTypeId)
        {
            IPaymentCalculator calculator = null;

            switch ((RateType)rateTypeId)
            {
            case RateType.PerHour:
            {
                calculator = new HourlyBaseRateCalculator();
                break;
            }

            case RateType.Fixed:
            {
                calculator = new FixedBaseRateCalculator();
                break;
            }
            }

            calculator.Configure(user, initialUserResult);

            return(calculator);
        }
Beispiel #3
0
 public LawnCare(IPaymentCalculator calculator)
 {
     this.Calculator = calculator;
 }
Beispiel #4
0
 public Babysitter(IPaymentCalculator calculator)
 {
     this.Calculator = calculator;
 }
Beispiel #5
0
 public LoanController(IPaymentCalculator paymentCalculator, LoanFactory loanFactory)
 {
     _paymentCalculator = paymentCalculator;
     _loanFactory       = loanFactory;
 }