internal bool Matches(PaymentStrategyInfo info) { bool res = true; foreach (Entities.TourCostRuleConstraint con in info.Rule.Constraints) { if (validators.ContainsKey(con.ConstraintType.Id)) { ITourRuleConstraintValidator validator = validators[con.ConstraintType.Id]; if (!validator.Matches(info.Tour, info.Service, info.CostDetail, con)) { res = false; break; } res = true; } else { res = false; break; } } return(res); }
public NormalStrategy(PaymentStrategyInfo info) { this.StrategyInfo = info; this.services = new PaymentStrategyInfoCollection(); this.ruleValidator = new PaymentRuleValidator(); this.calculating = false; }