public async Task <IActionResult> Edit(Guid id, [Bind("CartProductID,CartId,ProductID,ProductQuantityOrdered,ProductPrice,AddressId,TotalAmount,LastModifiedDateTime")] CartProduct cartProduct) { if (id != cartProduct.CartProductID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cartProduct); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CartProductExists(cartProduct.CartProductID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cartProduct)); }
public async Task <IActionResult> Edit(Guid id, [Bind("ProductID,ProductName,ProductColor,ProductSize,ProductMaterial,Category,ProductPrice,CreationDateTime,LastModifiedDateTime")] Product product) { if (id != product.ProductID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.ProductID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(product)); }
public async Task <IActionResult> Edit(Guid id, [Bind("OrderDetailId,OrderId,IsCancelled,ProductID,ProductQuantityOrdered,ProductPrice,AddressId,TotalAmount,LastModifiedDateTime,DateOfOrder,OrderSerial")] OrderDetail orderDetail) { if (id != orderDetail.OrderDetailId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(orderDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderDetailExists(orderDetail.OrderDetailId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(orderDetail)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,CategoryName")] Category category) { if (id != category.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(category); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryExists(category.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(category)); }
public async Task <IActionResult> Edit(Guid id, [Bind("AdminID,AdminName,Email,Password,CreationDateTime,LastModifiedDateTime")] Admin admin) { if (id != admin.AdminID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(admin); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdminExists(admin.AdminID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(admin)); }
public async Task <IActionResult> Edit(Guid id, [Bind("CartId,AddressID,CustomerID,TotalQuantity,TotalAmount")] Cart cart) { if (id != cart.CartId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cart); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CartExists(cart.CartId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cart)); }
public async Task <IActionResult> Edit(Guid id, [Bind("OrderCancelID,CartProductID,QuantityToBeCancelled,RefundAmount")] OrderCancel orderCancel) { if (id != orderCancel.OrderCancelID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(orderCancel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderCancelExists(orderCancel.OrderCancelID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(orderCancel)); }
public async Task <IActionResult> Edit(Guid id, [Bind("CustomerID,CustomerName,Email,Password,CustomerMobile,CreationDateTime,LastModifiedDateTime")] Customer customer) { if (id != customer.CustomerID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.CustomerID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Edit(Guid id, [Bind("AddressID,AddressLine1,AddressLine2,Landmark,City,State,PinCode,CustomerID,CreationDateTime,LastModifiedDateTime")] Address address) { if (id != address.AddressID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(address); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AddressExists(address.AddressID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(address)); }
public async Task <IActionResult> Edit(Guid id, [Bind("OrderId,CustomerID,DateOfOrder,TotalQuantity,LastModifiedDateTime,OrderAmount,OrderNumber")] Order order) { if (id != order.OrderId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(order); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderExists(order.OrderId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(order)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductName,ProductDescription,ProductImageUrl")] Product product) { if (id != product.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(product)); }