public async Task <IActionResult> Edit(int id, [Bind("Id,Name")] Contractor contractor) { if (id != contractor.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(contractor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContractorExists(contractor.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(contractor)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Type,DeviceId")] Sign sign) { if (id != sign.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(sign); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SignExists(sign.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(sign)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Lat,Lng,Img,Rating")] CameraInfo cameraInfo) { if (id != cameraInfo.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cameraInfo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CameraInfoExists(cameraInfo.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cameraInfo)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,ContractorId")] Work work) { if (id != work.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(work); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!WorkExists(work.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ContractorId"] = new SelectList(_context.Contractors, "Id", "Name", work.ContractorId); return(View(work)); }