public async Task <IActionResult> Edit(int id, [Bind("VendorNumber,VendorName,VendorAddress,Amount,Date")] VendorTransactionModel vendorTransactionModel) { if (id != vendorTransactionModel.TransactionId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vendorTransactionModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorTransactionModelExists(vendorTransactionModel.TransactionId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vendorTransactionModel)); }
public async Task <IActionResult> Create([Bind("VendorNumber,VendorName,VendorAddress,Amount,Date")] VendorTransactionModel vendorTransactionModel) { if (ModelState.IsValid) { _context.Add(vendorTransactionModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vendorTransactionModel)); }