public async Task <IActionResult> Edit(int id, [Bind("IdCustomer,CookieID")] Customer customer) { if (id != customer.IdCustomer) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.IdCustomer)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Edit(int id, [Bind("IdOrder,IdCustomer,Date,Time,Price")] Orders orders) { if (id != orders.IdOrder) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(orders); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdersExists(orders.IdOrder)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(orders)); }
public async Task <IActionResult> Edit(int id, [Bind("IdItem,Catagory,Name,Url,Price")] Items items) { if (id != items.IdItem) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(items); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemsExists(items.IdItem)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(items)); }
public async Task <IActionResult> Edit(int id, [Bind("IdOrder,IdItem,Quantity")] ItemsOrdered itemsOrdered) { if (id != itemsOrdered.IdOrder) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(itemsOrdered); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItemsOrderedExists(itemsOrdered.IdOrder)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(itemsOrdered)); }