public async Task <IActionResult> Edit(int id, [Bind("ReqID,UserID,OrgID,StockID,ReqDesc,ReqItems,ReqStatus")] Requests requests) { if (id != requests.ReqID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(requests); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RequestsExists(requests.ReqID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(requests)); }
public async Task <IActionResult> Edit(int id, [Bind("StockID,ItemName,Quantity,OrgID")] Inventory inventory) { if (id != inventory.StockID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(inventory); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InventoryExists(inventory.StockID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(inventory)); }
public async Task<IActionResult> Edit(int id, [Bind("StockID,ItemName,ImagePath,OrgID")] StockList stockList) { if (id != stockList.StockID) { return NotFound(); } if (ModelState.IsValid) { try { _context.Update(stockList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StockListExists(stockList.StockID)) { return NotFound(); } else { throw; } } return RedirectToAction(nameof(Index)); } return View(stockList); }
public async Task <IActionResult> Edit(int id, [Bind("UserID,UserName,FirstName,LastName,OrgID,AuthLevel")] Users users) { if (id != users.UserID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(users); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsersExists(users.UserID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(users)); }