Exemple #1
0
 public DiscountEntity(Discount discount)
 {
     _pcs = new PropertyChangeSupport(this);
     _discount = discount;
     if (discount != null)
     {
         _validityEntity = new DateRangeEntity(discount.Validity);
     }
 }
Exemple #2
0
 private void _computeOptionDiscount()
 {
     List<OptionChoice> sortedOptionChoices = new List<OptionChoice>(OptionChoices);
     sortedOptionChoices.Sort((firstOptChoice, secondOptChoice) =>
         secondOptChoice.DiscountedAmmount.CompareTo(firstOptChoice.DiscountedAmmount)
     );
     if (sortedOptionChoices.Count > 0)
     {
         _optionDiscount = sortedOptionChoices[0].Option.CurrentDiscount;
         _discountedOptionChoice = sortedOptionChoices[0];
     }
 }