Exemplo n.º 1
0
            public override DateTime GetDateExpiring(OfferType offerType)
            {
                if (offerType.BeginDate != null)
                    return offerType.BeginDate.Value.AddDays(offerType.DaysValid);

                throw new InvalidOperationException();
            }
Exemplo n.º 2
0
            public override DateTime GetDateExpiring(OfferType offerType)
            {
                if (offerType.BeginDate != null)
                {
                    return(offerType.BeginDate.Value.AddDays(offerType.DaysValid));
                }

                throw new InvalidOperationException();
            }
Exemplo n.º 3
0
 public Offer(Member memberAssigned,
              OfferType type,
              DateTime dateExpiring,
              int value)
 {
     MemberAssigned = memberAssigned;
     Type           = type;
     DateExpiring   = dateExpiring;
     Value          = value;
 }
Exemplo n.º 4
0
 public Offer(Member memberAssigned,
     OfferType type,
     DateTime dateExpiring,
     int value)
 {
     MemberAssigned = memberAssigned;
     Type = type;
     DateExpiring = dateExpiring;
     Value = value;
 }
Exemplo n.º 5
0
        public Offer AssignOffer(OfferType offerType,
            IOfferValueCalculator offerValueCalulator)
        {
            var value = offerValueCalulator.CalculateValue(this, offerType);

            var dateExpiring = offerType.ExpirationType.GetDateExpiring(offerType);

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

            _assignedOffers.Add(offer);
            NumberOfActiveOffers++;

            return offer;
        }
Exemplo n.º 6
0
        public Offer AssignOffer(OfferType offerType,
                                 IOfferValueCalculator offerValueCalulator)
        {
            var value = offerValueCalulator.CalculateValue(this, offerType);

            var dateExpiring = offerType.ExpirationType.GetDateExpiring(offerType);

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

            _assignedOffers.Add(offer);
            NumberOfActiveOffers++;

            return(offer);
        }
Exemplo n.º 7
0
 public override DateTime GetDateExpiring(OfferType offerType)
 {
     return DateTime.Now.AddDays(offerType.DaysValid);
 }
Exemplo n.º 8
0
 public abstract DateTime GetDateExpiring(OfferType offerType);
Exemplo n.º 9
0
 public override DateTime GetDateExpiring(OfferType offerType)
 {
     return(DateTime.Now.AddDays(offerType.DaysValid));
 }
Exemplo n.º 10
0
 public abstract DateTime GetDateExpiring(OfferType offerType);