public async Task <IActionResult> Edit(int id, [Bind("GLAccountId,CustomerAccounts,InterestRate,AccountName,LinkedAccount,Principal,DurationYears,RepaymentFrequencyMonths,StartDate")] LoanAccountViewModel accountViewModel)
        {
            if (id != accountViewModel.GLAccountId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _gLAccountService.EditLoanAccountAsync(accountViewModel);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!await _gLAccountService.GLAccountExists(accountViewModel.GLAccountId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                catch (Exception ex)
                {
                    ViewBag.Message = new StatusMessage
                    {
                        Message = ex.Message,
                        Type    = StatusType.Error
                    };
                    return(View(accountViewModel));
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(accountViewModel));
        }