public async Task <IActionResult> Edit(int id, [Bind("ProductId,ProductName,Detail,EstimatePrice,AddedBy,AddedDate,ModifyBy,ModifyDate")] Product product) { if (id != product.ProductId) { return(NotFound()); } if (ModelState.IsValid) { try { product.ModifyBy = sessionUserLogin; product.ModifyDate = DateTime.Now; _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(int id, [Bind("CustId,CustName,CustEmail,CustContactNo,CustWhatsapp,CustAddress,CustCompany,AddedBy,AddedDate,UpdatedBy,UpdatedDate")] Customer customer) { if (id != customer.CustId) { return(NotFound()); } if (ModelState.IsValid) { try { customer.UpdatedBy = sessionUserLogin; customer.UpdatedDate = DateTime.Now; _context.Update(customer); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CustomerExists(customer.CustId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(customer)); }
public async Task <IActionResult> Edit(int id, [Bind("OrderId,CustId,OrderTakenBy,OrderAssignTo,OpeningAmount,CurrentAmount,PriceIsFinal,PaidAmount,ExpenseAmount,ExtraAmount,OrderDate,DueDate,Link,Detail,Status,AddedBy,AddedDate,ModifyBy,ModifyDate")] 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)); }