Exemplo n.º 1
0
        public async Task <IActionResult> Edit(long id, [Bind("Id,CmndNumber,Beneficiaries,NumberAccount,Bank,Created,Updated,CreatedBy,UpdateBy")] BankAccount bankAccount)
        {
            TempData["url"] = "bankacount";
            if (id != bankAccount.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bankAccount);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BankAccountExists(bankAccount.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(bankAccount));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(long id, Transaction transaction)
        {
            if (id != transaction.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(transaction);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TransactionExists(transaction.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BankAccountId"] = new SelectList(_context.BankAccount, "Id", "CmndNumber", transaction.BankAccountId);
            ViewData["OriginalId"]    = new SelectList(_context.OriginalListing, "Id", "Id", transaction.OriginalId);
            return(View(transaction));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(long id, OriginalListing originalListing)
        {
            if (id != originalListing.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(originalListing);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OriginalListingExists(originalListing.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(originalListing));
        }