public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyName,FormOfOwnership,HeadName,ActivityType")] Company company) { if (id != company.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(company); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyExists(company.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(company)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ReleasePlan,ReleaseFact,Quarter,Year,CompanyId,ProductId")] Release release) { if (id != release.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(release); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReleaseExists(release.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CompanyId"] = new SelectList(_context.Companies, "Id", "Name", release.CompanyId); ViewData["ProductId"] = new SelectList(_context.Products, "Id", "MeasureUnit", release.ProductId); return(View(release)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductName,MeasureUnit,Features,Photo")] 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))); } return(View(product)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ProductionType,ProductId")] ProductType productType) { if (id != productType.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductTypeExists(productType.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ProductId"] = new SelectList(_context.Products, "Id", "Features", productType.ProductId); return(View(productType)); }