public async Task <IActionResult> Edit(int id, [Bind("IdEmpresa,Nombre,Propietario")] Empresa empresa) { if (id != empresa.IdEmpresa) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(empresa); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EmpresaExists(empresa.IdEmpresa)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(empresa)); }
public async Task <IActionResult> Edit(int id, [Bind("Direccion,IdCliente,Cedula,Nombre,Apellido")] Cliente cliente) { if (id != cliente.IdCliente) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cliente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(cliente.IdCliente)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cliente)); }
public async Task <IActionResult> Edit(int id, [Bind("IdMotor,Marca,TipoDeMotor")] Motor motor) { if (id != motor.IdMotor) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(motor); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MotorExists(motor.IdMotor)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(motor)); }