public async Task <IActionResult> Edit(decimal id, [Bind("Id,Name,Description,ThumbnailTemp,Keywords")] StandardParent standardParent) { if (id != standardParent.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(standardParent); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StandardParentExists(standardParent.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(standardParent)); }
public async Task <IActionResult> Edit(decimal id, [Bind("Id,Name,Description,Thumbnail")] Application application) { if (id != application.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(application); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ApplicationExists(application.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(application)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductId,CategoryId")] CategoryLink categoryLink) { if (id != categoryLink.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(categoryLink); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryLinkExists(categoryLink.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Category, "Id", "Id", categoryLink.CategoryId); ViewData["ProductId"] = new SelectList(_context.Product, "Id", "Id", categoryLink.ProductId); return(View(categoryLink)); }
public async Task <IActionResult> Edit(decimal id, [Bind("Id,Name,Description,Features,Specification,TempThumbnail,BrandId")] Product product) { if (id != product.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BrandId"] = new SelectList(_context.Brand, "Id", "Id", product.BrandId); return(View(product)); }
public async Task <IActionResult> Edit(decimal id, [Bind("Id,Name,Description,ThumbnailTemp,ParentId")] Standard standard) { if (id != standard.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(standard); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StandardExists(standard.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ParentId"] = new SelectList(_context.StandardParent, "Id", "Id", standard.ParentId); return(View(standard)); }