--
Has recibido este mensaje porque estás suscrito al grupo "ActiveVFP" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a activevfp+...@googlegroups.com.
Para ver esta conversación en el sitio web, visita https://groups.google.com/d/msgid/activevfp/406c4f17-46be-411b-9e8e-0ecda81ef4bcn%40googlegroups.com.
CASE UPPER(lctipo) = 'POST'
DO LocFile("C:\webservice\prg\JSONFox\JSONFox", "app") &&cargar el objeto en _screen.json
IF TYPE('_screen.json') = 'U'
RETURN ('No fue posible crear el objecto _screen.json')
ENDIF
* Deserialize and Indent
lcStrj1 = AVToJSON(This.data)
loObj = _Screen.Json.Parse(lcStrj1)
*Aqui accedemos a los valores fijos
lcNumber = TRANSFORM(loObj.number)
lcObservations = TRANSFORM(loObj.observations)
lcBultos = TRANSFORM(loObj.bultos)
lcDepot = TRANSFORM(loObj.depot_id)
* Make a copy of the internal array from obj.data
Acopy(loObj.items, aListadoArray)
* Now pass the aEmployeeList by reference with '@'
lcJsonArray = _Screen.Json.Encode(@aListadoArray)
* Convert the JSONArray into VFP CURSOR **(this is cool)**
lcCursor = 'obtenerPedidos_POST_' + SYS(2015)
lcDbfNew = 'C:\webservice\prg\rest\controllers\' + lcCursor + '.dbf' &&FULLPATH("") + lcCursor + '.dbf'
_Screen.Json.JSONToCursor(lcJsonArray, lcCursor)
SELECT * FROM (lcCursor) INTO CURSOR _recibido
SELECT (lcCursor)
COPY TO (lcDbfNew)
*!* SELECT _recibido
SCAN
lccodigo = EVALUATE(FIELD(1)) &&_recibido.product_id
lncantidad = EVALUATE(FIELD(2)) &&_recibido.quantity_prepared
* lncantidad = EVAL(fields2)
IF !used('ob_pedidos')
SELECT 0
USE ob_pedidos
ENDIF
SELECT ob_pedidos
APPEND BLANK
replace numero WITH VAL(lcNumber)
replace observa WITH lcObservations
replace bultos WITH VAL(lcBultos)
replace deposito WITH lcDepot
replace codigo WITH lccodigo
replace cantidad WITH lncantidad
SELECT (lcCursor)
ENDSCAN
IF used('ob_pedidos')
USE IN ob_pedidos
ENDIF
saludos cordiales
Para ver esta conversación en el sitio web, visita https://groups.google.com/d/msgid/activevfp/dffe7134-cf7b-45dc-bcdf-66f4372836c3n%40googlegroups.com.
Para ver esta conversación en el sitio web, visita https://groups.google.com/d/msgid/activevfp/d9e92b49-2492-4172-b6fa-f44d7da2b622n%40googlegroups.com.