Sub btnCargarPedidos_Click
Dim Query As String
Dim id As Int
Dim fecha As String
Dim idCliente As Int
Dim usuarioEmpleado As String
Dim estado As String
c=s.ExecQuery("SELECT * FROM pedido")
If c.RowCount>0 Then
For i=0 To c.RowCount-1
c.Position=i
Dim hc As HttpJob
Dim req As HttpJob
hc.Initialize("hc", Me)
req.Initialize("req", Me)
id=c.GetString("id")
fecha=c.GetString("fecha")
idCliente=c.GetString("idCliente")
usuarioEmpleado=c.GetString("usuarioEmpleado")
estado=c.GetString("estado")
Query="INSERT INTO Pedido (id, fecha, idCliente, usuarioEmpleado, estado) VALUES ('" & id & "','" & fecha & "','" & idCliente & "','" & usuarioEmpleado & "','" & estado & "')"
req.PostString("http://167.250.5.13/paises.php", Query.GetBytes("UTF8"))
Next
End If
End Sub
Sub JobDone (req As HttpJob)
Log("JobName = " & req.JobName & ", Success = " & req.Success)
If req.Success = True Then
Select req.JobName
Case "Job1", "Job2"
'print the result to the logs
Log(req.GetString)
Case "Job3"
'show the downloaded image
Activity.SetBackgroundImage(req.GetBitmap)
End Select
Else
Log("Error: " & req.ErrorMessage)
ToastMessageShow("Error: " & req.ErrorMessage, True)
End If
req.Release
End Sub