public DiscountEntity(Discount discount) { _pcs = new PropertyChangeSupport(this); _discount = discount; if (discount != null) { _validityEntity = new DateRangeEntity(discount.Validity); } }
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]; } }