public async Task <IActionResult> Edit(int id, [Bind("id,patente,km,anioFab,modelo,precio,ClienteId")] Auto auto) { if (id != auto.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(auto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AutoExists(auto.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(auto)); }
public async Task <IActionResult> Edit(int id, [Bind("idFactura,tipoFactura,importe,ClienteId")] Factura factura) { if (id != factura.idFactura) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(factura); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FacturaExists(factura.idFactura)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(factura)); }
public async Task <IActionResult> Edit(int id, [Bind("id,nombre,apellido,dni")] Cliente cliente) { if (id != cliente.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cliente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(cliente.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cliente)); }