public async Task <IActionResult> Edit(long id, [Bind("ComponentId,ComponentTypeId,ComponentNumber,SerialNo,Status,AdminComment,UserComment,CurrentLoanInformationId")] Component component) { if (id != component.ComponentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(component); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ComponentExists(component.ComponentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(component)); }
public async Task <IActionResult> Edit(long id, [Bind("ComponentTypeId,ComponentName,ComponentInfo,Location,Status,Datasheet,ImageUrl,Manufacturer,WikiLink,AdminComment")] ComponentType componentType) { if (id != componentType.ComponentTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(componentType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ComponentTypeExists(componentType.ComponentTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(componentType)); }
public async Task <IActionResult> Edit(int id, [Bind("CategoryId,Name")] Category category) { if (id != category.CategoryId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(category); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryExists(category.CategoryId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(category)); }