public async Task <IActionResult> Edit(decimal id, [Bind("id,MANUFACTURERID,TRANSACTIONDATE,EMPLOYEEID,AMOUNT,DESCRIPTION,REFERENCE")] ManufacturerTransaction manufacturerTransaction) { if (id != manufacturerTransaction.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(manufacturerTransaction); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ManufacturerTransactionExists(manufacturerTransaction.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(manufacturerTransaction)); }
public async Task <IActionResult> Create([Bind("id,MANUFACTURERID,TRANSACTIONDATE,EMPLOYEEID,AMOUNT,DESCRIPTION,REFERENCE")] ManufacturerTransaction manufacturerTransaction) { if (ModelState.IsValid) { _context.Add(manufacturerTransaction); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(manufacturerTransaction)); }