public async Task <IActionResult> Edit(int id, [Bind("ID,UserName,UserSurname,UserPhone,UserOrganization,FileName,FilePath,Status")] 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))); } return(View(order)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,MaterialName,MaterialSize,MaterialPrice")] Material material) { if (id != material.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(material); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MaterialExists(material.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(material)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,TypeName,TypeSize,TypePrice")] AdvType advType) { if (id != advType.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(advType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdvTypeExists(advType.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(advType)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Login,Password")] 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)); }