public async Task <IActionResult> Edit(int id, [Bind("ID,AccNo,Narration,Amount,Balance")] BankWithDrawal bankWithDrawal) { if (id != bankWithDrawal.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(bankWithDrawal); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BankWithDrawalExists(bankWithDrawal.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(bankWithDrawal)); }
public async Task <IActionResult> Create([Bind("ID,AccNo,Narration,Amount,Balance")] BankWithDrawal bankWithDrawal) { if (ModelState.IsValid) { _context.Add(bankWithDrawal); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(bankWithDrawal)); }