public async Task <IActionResult> Edit(int id, [Bind("ID,LastName,MiddleName,FirstName,Gender,Address,Mobile")] User user) { if (id != user.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,UserID,MobileID,OrderDate")] Order order) { if (id != order.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(order); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrderExists(order.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["MobileID"] = new SelectList(_context.Mobile, "ID", "ID", order.MobileID); ViewData["UserID"] = new SelectList(_context.Set <User>(), "ID", "ID", order.UserID); return(View(order)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Description,Typr,Brand,Price,Image,Rating")] Mobile mobile) { if (id != mobile.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mobile); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MobileExists(mobile.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mobile)); }
public bool Update(Cart entity) { _dbContext.Update(entity); return(Save()); }
public bool Update(ProductDetails entity) { _dbContext.Update(entity); return(Save()); }
public bool Update(MobileBrand entity) { _dbContext.Update(entity); return(Save()); }