public async Task <IActionResult> Edit(int id, [Bind("CustomerID,Name,Address,City,PostCode")] Customer customer) { if (id != customer.CustomerID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.CustomerID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Edit(int id, [Bind("BillPayID,Period,AccountNumber1,PayeeID,Amount,ScheduleDate,BillPayTimeUtc")] BillPay billPay) { if (id != billPay.BillPayID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(billPay); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BillPayExists(billPay.BillPayID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(billPay)); }