Example #1
0
 public Offer(Member memberAssigned, OfferType type, DateTime dateExpiring, int value)
 {
     MemberAssigned = memberAssigned;
     Type           = type;
     DateExpiring   = dateExpiring;
     Value          = value;
 }
Example #2
0
        public Offer AssignOffer(OfferType offerType
                                 , IOfferValueCalculator offerValueCalculator)
        {
            var value = offerValueCalculator
                        .CalculateValue(this, offerType);

            var dateExpiring = offerType.CalculateExpiration();

            var offer = new Offer(this, offerType, dateExpiring, value);

            _assignedOffers.Add(offer);
            NumberOfActiveOffers++;

            return(offer);
        }
 public override DateTime CalculateExpiration(OfferType offerType)
 {
     return(offerType.BeginDate.Value.AddDays(offerType.DaysValid));
 }
 public override DateTime CalculateExpiration(OfferType offerType)
 {
     return(DateTime.Now.AddDays(offerType.DaysValid));
 }
 public abstract DateTime CalculateExpiration(OfferType offerType);