Exemplo n.º 1
0
        public async Task <IActionResult> Details(int id)
        {
            var loanType = await _loanTypeService.GetLoanType(id);

            if (loanType == null)
            {
                return(NotFound());
            }

            return(View(loanType));
        }
        public async Task <IActionResult> Create(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var user = await _userManager.GetUserAsync(HttpContext.User);

            ViewData[ViewDataKeys.UserAccountId] = new SelectList(await _bankAccountService.GetUserAccounts(user.Id), "Id", "Name");
            ViewData[ViewDataKeys.LoanType]      = await _loanTypeService.GetLoanType((int)id);

            ViewData[ViewDataKeys.EmploymentTypeId] = new SelectList(_employmentTypeService.GetAllTypes(), "Id", "Name");
            return(View());
        }
Exemplo n.º 3
0
        public async Task <IActionResult> LoanTypeDetails(int LoanTypeId)
        {
            try
            {
                var response = await _service.GetLoanType(LoanTypeId);

                if (response != null)
                {
                    return(Ok(response));
                }
                return(StatusCode(StatusCodes.Status204NoContent));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }