Exemple #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));
        }
        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));
        }
Exemple #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));
        }