Exemple #1
0
        private void Set_basic_parameters(PaymentParametersModel parameters)
        {
            //0.02 is my interpretation
            Annual_Interest_rate     = parameters.Annual_Interest_rate == true ? 0.05 : 0.02;
            loan_amount              = parameters.Loan_amount ?? 0.00;
            Paid_administrative_fees = parameters.Administration_fee == true?Calculation_administrative_fees() : 0.0;

            Interest_rate_calculated_monthly = parameters.Interest_rate_calculated_monthly;
            Duration_of_loan_in_months       = parameters.Duration_of_loan * 12 ?? 0;
        }
Exemple #2
0
        public IActionResult Index(PaymentParametersModel parameters)
        {
            if (ModelState.IsValid)
            {
                Set_basic_parameters(parameters);

                ViewBag.paid_administrative_fees = Paid_administrative_fees;
                ViewBag.monthly_cost             = Calculation_monthly_cost_amound().ToString("N2");
                ViewBag.paid_interest_rate       = Calculation_interest_rate().ToString("N2");
                ViewBag.aop = Calculation_AOP().ToString("N2");

                Repository.AddRepository(parameters, (double)ViewBag.paid_administrative_fees, ViewBag.monthly_cost, ViewBag.paid_interest_rate, ViewBag.aop, Annual_Interest_rate);
                return(View("LoanInformations", parameters));
            }
            else
            {
                return(View());
            }
        }