Esempio n. 1
0
        public override RulePaymentLine CalculatePayment(CadEvent cadEvent, Dictionary <string, double> supplierAgreementRates)
        {
            double rate;

            supplierAgreementRates.TryGetValue("AfterMiddayRate", out rate);
            return(new RulePaymentLine(this.Name, rate));
        }
Esempio n. 2
0
        public Payment CalculatePayments(IEnumerable <IRule> rules, CadEvent cadEvent, Dictionary <string, double> agreementRates)
        {
            Payment payment = new Payment();

            foreach (IRule rule in rules)
            {
                if (rule.IsMatchFor(cadEvent))
                {
                    payment.AddPaymentLine(rule.CalculatePayment(cadEvent, agreementRates));
                }
            }

            return(payment);
        }
Esempio n. 3
0
        public override bool IsMatchFor(CadEvent cadEvent)
        {
            TimeSpan noon = new TimeSpan(12, 0, 0);

            return(cadEvent.JobTime.TimeOfDay > noon);
        }
Esempio n. 4
0
 public abstract RulePaymentLine CalculatePayment(CadEvent cadEvent,
                                                  Dictionary <string, double> supplierAgreementRates);
Esempio n. 5
0
 public abstract bool IsMatchFor(CadEvent cadEvent);