Example #1
0
        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));
        }
Example #2
0
        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));
        }