public IHttpActionResult PutCliente(int id, Cliente cliente) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != cliente.Id) { return(BadRequest()); } db.Entry(cliente).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <ActionResult> Edit([Bind(Include = "ClienteID,Nombre,Apellido,Telefono,Correo")] Cliente cliente) { if (ModelState.IsValid) { db.Entry(cliente).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(cliente)); }
public async Task <ActionResult> Edit([Bind(Include = "PrestamoID,Plazo,Interes,CantidadPrestada,Cuota,IniciodePrestamo,IdCliente")] Prestar prestar) { if (ModelState.IsValid) { db.Entry(prestar).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(prestar)); }