public IHttpActionResult Actualizar([FromBody] Cliente cliente) { var response = clienteService.Actualizar(cliente); if (response == 0) { return(BadRequest("OcurriĆ³ un error")); } return(Ok("Cliente actualizado")); }
public ActionResult Save(ClienteEntity entity) { try { var result = new DBEntity(); if (entity.IdCliente.HasValue) { result = ClienteService.Actualizar(entity); } else { result = ClienteService.Insertar(entity); } return(Json(result)); } catch (Exception ex) { return(Json(new DBEntity { CodeError = ex.HResult, MsgError = ex.Message })); } }