private void PercentOff(Offer offer, Booking booking, BookingOffer bookingOffer) { if (offer.MinSpend < booking.BookingTotal()) { bookingOffer.Value = (offer.Value * (booking.BookingTotal() / 100)) * -1; bookingOffer.OfferCode = offer.OfferCode; bookingOffer.OfferDescription = offer.OfferDescription; bookingOffer.OfferID = offer.OfferId; bookingOffer.OfferType = "Percent Off"; booking.AddBookingOffer(bookingOffer); } }
} //end addOffer private void MoneyOff(Offer offer, Booking booking, BookingOffer bookingOffer) { decimal bookingTotal = booking.BookingTotal(); if (offer.MinSpend < bookingTotal) { bookingOffer.Value = offer.Value * -1; bookingOffer.OfferCode = offer.OfferCode; bookingOffer.OfferDescription = offer.OfferDescription; bookingOffer.OfferID = offer.OfferId; bookingOffer.OfferType = "Money Off"; booking.AddBookingOffer(bookingOffer); } }