public HomeLoanVM GetHomeLoanEmpty()
        {
            var homeLoanVM = new HomeLoanVM()
            {
                BankDetailsList = GetBankDetailsVM()
            };

            return(homeLoanVM);
        }
        public ActionResult Checkout(HomeLoanVM homeLoanVM)
        {
            try
            {
                var isResult = homeLoanService.SaveUserHomeLoanDetails(homeLoanVM);
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Index", "Error"));
            }

            return(RedirectToAction("Index", "Offers", new
                                    RouteValueDictionary(new
            {
                bankID = homeLoanVM.selectedBankID,
                loanAmount = homeLoanVM.LoanAmount
            })));
        }
        public bool SaveUserHomeLoanDetails(HomeLoanVM homeLoanVM)
        {
            UserDetail userDetails = Mapper.Map <UserDetail>(homeLoanVM.customer);

            var isResult = userDetailRepository.CreateUser(userDetails);

            if (isResult)
            {
                homeLoanVM.customer.CustomerID = Convert.ToString(userDetails.Id);

                UserHomeLoanDetail userHomeLoanDetails = Mapper.Map <UserHomeLoanDetail>(homeLoanVM);

                isResult = userHomeLoanRepository.CreateUserHomeLoan(userHomeLoanDetails);
            }

            //Send Email

            return(isResult);
        }