public InsuranceOfferControl(InsuranceOffer offer) { this.InitializeComponent(); this.DataContext = offer; this.offer = offer; this.SetSummaryAndSymbol(); }
private decimal GetPrice(InsuranceOffer offer, PlanTypes planType, BillingPeriods period) { var plan = offer.Plans.Single(p => p.PlanType == planType); switch (period) { case BillingPeriods.Monthly: return(plan.PriceMonthly); case BillingPeriods.Yearly: return(Math.Round(12 * plan.PriceMonthly * (decimal.One - offer.YearlyDiscountRate / 100))); default: throw new ArgumentOutOfRangeException(nameof(period), period, null); } }