Example #1
0
        public IActionResult Compare()
        {
            var model = new CompareDepositInputModel
            {
                Amount      = GlobalConstants.AmountDisplayValue,
                DepositTerm = DepositTerm.TwelveMonths
            };

            return(View(model));
        }
Example #2
0
        public IActionResult Compare(CompareDepositInputModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(model));
            }

            var comparedDeposits = this.depositsService
                                   .Compared <ComparedDepositViewModel>(model.Amount, model.Currency, model.DepositTerm,
                                                                        model.InterestPayment, model.DepositFor, model.InterestType, model.IncreasingAmount,
                                                                        model.OverdraftOpportunity, model.CreditOpportunity)
                                   .ToList();

            var allComparedDepositsViewModel = new AllComparedDepositsViewModel
            {
                Deposits = comparedDeposits
            };

            return(this.View(viewName: GlobalConstants.ResultsActionName, allComparedDepositsViewModel));
        }