Beispiel #1
0
        public ActionResult SearchAgreement(AgreementSearchModel model)
        {
            var customer = service.GetAgreements(model.PersonalId);

            if (customer == null)
            {
                return(PartialView("_PartialAgreements", null));
            }

            var ab = new Models.CustomerDetailsModel(model.BaseRateCode.ToString())
            {
                Name       = customer.Name,
                Id         = customer.Id,
                Agreements = customer.Agreements.Select(t => new Models.Agreement
                {
                    Id           = t.Id,
                    Amount       = t.Amount,
                    Margin       = t.Margin,
                    BaseRateCode = t.Code,
                    Duration     = t.Duration
                }).ToList()
            };

            return(PartialView("_PartialAgreements", ab));
        }
Beispiel #2
0
        public ActionResult CalculateInterestRate(Models.CustomerDetailsModel model)
        {
            if (model.SelectedAgreementId == 0)
            {
                return(View());
            }
            var rates = service.GetCalculatedInterestRates(new ServiceModelsAgreementForRate
            {
                Code        = model.SelectedBaseCode,
                AgreementId = model.SelectedAgreementId
            });

            return(PartialView("_RatesResults", new InterestRatesModel()
            {
                OldInterestRate = rates.FirstRate,
                NewInterestRate = rates.SecondRate
            }));
        }