コード例 #1
0
        private MortgageAnalysis BuildDefaultModel()
        {
            var model = new MortgageAnalysis
                            {
                                LoanAmount = 150000.00m,
                                AnnualInterestRate = 0.055m,
                                Term = 15,
                                CompoundPeriod = MortgageEnums.CompoundPeriod.Monthly,
                                PaymentFrequency = MortgageEnums.PaymentFrequency.Monthly,
                                TaxBracket = .25m,
                                RateType = MortgageEnums.RateType.Fixed,
                                FirstPaymentDate = DateTime.Now,
                                EstimatedAdjustment = .0025m,
                                IntrestRateCap = .12m,
                                IntrestRateMin = .004m,
                                PeriodsBetweenAdjustments = 12,
                                YearsRateRemainsFixed = 3,
                                ExtraPaymentInterval = 1,
                                ExtraPaymentAmount = 0
                            };

            var result = _analyzerService.AnalyzeMortgages(model.ToMortgageAnalyzeIn());

            if (result != null)
            {
                model.PaymentScheduleResults = result.ToMortgageAnalysis();
            }

            return model;
        }
コード例 #2
0
        public ActionResult Index(MortgageAnalysis model)
        {
            var result = _analyzerService.AnalyzeMortgages(model.ToMortgageAnalyzeIn());

            if (result != null)
            {
                model.PaymentScheduleResults = result.ToMortgageAnalysis();
            }

            if (model.RateType == MortgageEnums.RateType.Fixed)
            {
                //put back in defaults
                model.EstimatedAdjustment = .0025m;
                model.IntrestRateCap = .12m;
                model.IntrestRateMin = .004m;
                model.PeriodsBetweenAdjustments = 12;
                model.YearsRateRemainsFixed = 3;
            }
            return View(model);
        }