public async Task <IActionResult> Edit(long id, [Bind("ManobristaId,Name,Cpf,DataNascimento")] Manobrista manobrista) { if (id != manobrista.ManobristaId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(manobrista); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ManobristaExists(manobrista.ManobristaId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(manobrista)); }
public async Task <IActionResult> Edit(long id, [Bind("VeiculoId,Marca,Modelo,Placa")] Veiculo veiculo) { if (id != veiculo.VeiculoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(veiculo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VeiculoExists(veiculo.VeiculoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(veiculo)); }
public async Task <IActionResult> Edit(long id, [Bind("ManobraId,ManobristaId,VeiculoId,DataManobra")] Manobra manobra) { if (id != manobra.ManobraId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(manobra); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ManobraExists(manobra.ManobraId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ManobristaId"] = new SelectList(_context.Manobrista, "ManobristaId", "Cpf", manobra.ManobristaId); ViewData["VeiculoId"] = new SelectList(_context.Veiculo, "VeiculoId", "Marca", manobra.VeiculoId); return(View(manobra)); }