Ejemplo n.º 1
0
        public ActionResult Get(int id, int customerId)
        {
            var model = loanService.CreateViewModel(id);

            SelectList customerSelectList;

            if (customerId > 0)
            {
                customerSelectList = new SelectList(customerService.GetAllCustomers(), "Id", "Name", customerId);
                model.CustomerId   = customerId;
            }
            else
            {
                customerSelectList = new SelectList(customerService.GetAllCustomers(), "Id", "Name", model.CustomerId);
            }

            ViewBag.Customers    = customerSelectList;
            ViewBag.Status       = new SelectList(lookupService.GetAllLoanStatus(), "Key", "Value", model.Status);
            ViewBag.BankAccounts = new SelectList(bankAccountService.GetAllBanks(), "Id", "AccountNumber", model.BankAccountId);
            return(PartialView("_LoanForm", model));
        }