public async Task <IActionResult> Edit(int id, [Bind("UserId,Name,Login,Password,Email")] User user) { if (id != user.UserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(user); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserExists(user.UserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Edit(int id, [Bind("ItemPatternId,CategoryItemPatternId,BarCode,Unit,Size,Name,Capacity,LongLife")] Itempattern itempattern) { if (id != itempattern.ItemPatternId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(itempattern); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ItempatternExists(itempattern.ItemPatternId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CategoryItemPatternId"] = new SelectList(_context.Categoryitempattern, "CategoryItemPatternId", "Name", itempattern.CategoryItemPatternId); return(View(itempattern)); }