public async Task <IActionResult> Edit(long id, [Bind("Id,StaffId,Name,Amount,Date")] ExtraIncomes extraIncomes) { if (id != extraIncomes.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(extraIncomes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ExtraIncomesExists(extraIncomes.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(extraIncomes)); }
public async Task <IActionResult> Create([Bind("Id,StaffId,Name,Amount,Date")] ExtraIncomes extraIncomes) { if (ModelState.IsValid) { _context.Add(extraIncomes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(extraIncomes)); }