示例#1
0
 public InsuranceOfferControl(InsuranceOffer offer)
 {
     this.InitializeComponent();
     this.DataContext = offer;
     this.offer       = offer;
     this.SetSummaryAndSymbol();
 }
示例#2
0
文件: MainDialog.cs 项目: mluvii/dots
        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);
            }
        }