public async Task <IActionResult> Edit(int id, [Bind("Id,VendorName,VendorWebstore")] Vendor vendor) { if (id != vendor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(vendor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VendorExists(vendor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(vendor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,StoreFrontName,StoreFrontUrl")] StoreFront storeFront) { if (id != storeFront.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(storeFront); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StoreFrontExists(storeFront.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(storeFront)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductId,StoreFrontId,Quantity")] Revenue revenue) { if (id != revenue.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(revenue); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RevenueExists(revenue.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ProductId"] = new SelectList(_context.Product, "Id", "Id", revenue.ProductId); ViewData["StoreFrontId"] = new SelectList(_context.Set <StoreFront>(), "Id", "Id", revenue.StoreFrontId); return(View(revenue)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,VendorId,UnitPrice,Name")] 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["VendorId"] = new SelectList(_context.Set <Vendor>(), "Id", "Id", product.VendorId); return(View(product)); }