public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Link")] Sellers sellers) { if (id != sellers.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sellers); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SellersExists(sellers.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sellers)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Question,Answer")] Faqs faqs) { if (id != faqs.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(faqs); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FaqsExists(faqs.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(faqs)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,Name")] Products products) { if (id != products.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(products); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductsExists(products.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(products)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Subject,Description,Rating,ProductName,SellerName,Image,Link,ProductDescription,ProductCondition,Price,SoldOut")] Reviews reviews) { if (id != reviews.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(reviews); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReviewsExists(reviews.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(reviews)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,SellerName,Date,UserId,ProductName,Image,Link,Price,ProductDescription,ProductCondition,SoldOut")] SearchHistories searchHistories) { if (id != searchHistories.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(searchHistories); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SearchHistoriesExists(searchHistories.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["UserId"] = new SelectList(_context.AspNetUsers, "Id", "Id", searchHistories.UserId); return(View(searchHistories)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Address,Province")] Locations locations) { if (id != locations.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(locations); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LocationsExists(locations.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(locations)); }