コード例 #1
0
 public Incentive(Trader traderAssigned, IncentiveDefinition incentiveDefinition, DateTime expirationDate, int value)
 {
     TraderAssigned = traderAssigned;
     Type           = incentiveDefinition;
     DateExpiring   = expirationDate;
     Value          = value;
 }
コード例 #2
0
        public Incentive AssignIncentive(IncentiveDefinition incentiveDefinition, IIncentiveValueCalculator incentiveValueCalculator, ISystemClock systemClock)
        {
            var incentiveValue = incentiveValueCalculator.CalculateValue(this, incentiveDefinition);
            var expirationDate = incentiveDefinition.CalculateExpirationDate(systemClock);

            var incentive = new Incentive(this, incentiveDefinition, expirationDate, incentiveValue);

            _assignedIncentives.Add(incentive);
            return(incentive);
        }
コード例 #3
0
 public override DateTime CalculateExpirationDate(IncentiveDefinition incentiveDefinition, ISystemClock systemClock)
 {
     return(_beginDate.AddDays(incentiveDefinition.DaysValid));
 }
コード例 #4
0
 public abstract DateTime CalculateExpirationDate(IncentiveDefinition incentiveDefinition, ISystemClock systemClock);