public async Task <IActionResult> Edit(int id, [Bind("Id,Nome,Site,Prioridade")] Fabricante fabricante) { if (id != fabricante.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(fabricante); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FabricanteExists(fabricante.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(fabricante)); }
public async Task <IActionResult> Edit(Guid id, [Bind("Id,ModeloId,Placa,Chassis,Hodometro,Cor,AnoFab,AnoModelo,Origem,Renavam,ValorFipe,ValorPago,ValorVenda")] Veiculo veiculo) { if (id != veiculo.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(veiculo); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VeiculoExists(veiculo.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(veiculo)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,FabricanteId,Nome")] ModeloCar modeloCar) { if (id != modeloCar.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(modeloCar); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ModeloCarExists(modeloCar.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FabricanteId"] = new SelectList(_context.Fabricante, "Id", "Id", modeloCar.FabricanteId); return(View(modeloCar)); }