public async Task <IActionResult> Edit(int id, [Bind("AssortmentId,AssortmentName,AssortmentBrand,AssortmentPrice,ParamId")] Assortment assortment) { if (id != assortment.AssortmentId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(assortment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AssortmentExists(assortment.AssortmentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ParamId"] = new SelectList(_context.Params, "ParamId", "ParamName", assortment.ParamId); return(View(assortment)); }
public async Task <IActionResult> Edit(int id, [Bind("LeasingId,LeasingStart,LeasingEnd,LeasingExtend,Id")] Leasing leasing) { if (id != leasing.LeasingId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(leasing); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeasingExists(leasing.LeasingId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.ApplicationUsers, "Id", "Id", leasing.Id); return(View(leasing)); }
public async Task <IActionResult> Edit(int id, [Bind("StatusId,StatusName")] Status status) { if (id != status.StatusId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(status); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StatusExists(status.StatusId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(status)); }
public async Task <IActionResult> Edit(int id, [Bind("CategoryId,CategoryName")] 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)); }
public async Task <IActionResult> Edit(int id, [Bind("ParamId,ParamName")] Param @param) { if (id != @param.ParamId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(@param); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ParamExists(@param.ParamId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(@param)); }
public async Task <IActionResult> Edit(int id, [Bind("ProductId,ProductName,ProductPrice,ProductAvailability,ProductCode,ProductAdded,CategoryId")] Product products) { if (id != products.ProductId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(products); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductsExist(products.ProductId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(products)); }
public async Task <IActionResult> Edit(int id, [Bind("ReportId,ReportDescription,LeasingDetailId,StatusId")] Report report) { if (id != report.ReportId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(report); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ReportExists(report.ReportId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["LeasingDetailId"] = new SelectList(_context.LeasingDetails, "LeasingDetailId", "LeasingDetailId", report.LeasingDetailId); ViewData["StatusId"] = new SelectList(_context.Statuses, "StatusId", "StatusName", report.StatusId); return(View(report)); }
public async Task <IActionResult> Edit(int id, [Bind("CompanyId,CompanyName,CompanyHeadquarters,CompanyNIP")] Company company) { if (id != company.CompanyId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(company); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompanyExists(company.CompanyId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(company)); }
public async Task <IActionResult> Edit(int id, [Bind("PhotoId,PhotoUrl")] Photo photo) { if (id != photo.PhotoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(photo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PhotoExists(photo.PhotoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(photo)); }
public async Task <IActionResult> Edit(int id, [Bind("ProductId,ProductName,ProductDescription,ProductPrice,ProductAvailability,ProductCode,ProductAdded,CategoryId")] Product product) { if (id != product.ProductId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(product); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductExists(product.ProductId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["CategoryId"] = new SelectList(_context.Categories, "CategoryId", "CategoryName", product.CategoryId); return(View(product)); }