Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
'Stored Procedure IN Parameter
Dim queryIN As String = $"CALL sp_totalerecordchiusure(100)"$
ExecuteRemoteQuery(queryIN, "Test_In", "normal")
'Stored Procedure OUT Parameter
Dim queryOUT As String = $"CALL `sp_contarecord`(@r);
Select @r As vediamo;"$
ExecuteRemoteQuery(queryOUT, "Test_Out", "storedout")
End Sub
#Region db
Sub ExecuteRemoteQuery(Query As String, JobName As String, Action As String)
Dim job As HttpJob
job.Initialize(JobName, Me)
job.Download2("https://www.ourserver.xxxx/db/dbpw_mysqli_stored_procedure.php", Array As String("Action", Action , "Query", Query))
End Sub
Sub JobDone (Job As HttpJob)
ProgressDialogHide
Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
If Job.Success Then
Dim res As String
res = Job.GetString
'res = Job.Tag
Log("Response from server: " & res)
Dim parser As JSONParser
parser.Initialize(res)
Select Job.JobName
Case "Test_In"
Dim COUNTRIES As List
Dim m As Map
m.Initialize
COUNTRIES = parser.NextArray 'returns a list with maps
If COUNTRIES.Size > 0 Then
For i = 0 To COUNTRIES.Size -1
m = COUNTRIES.Get(i)
Log(m.Get("incasso"))
Next
End If
Case "Test_Out"
Dim COUNTRIES As List
Dim m As Map
m.Initialize
COUNTRIES = parser.NextArray 'returns a list with maps
If COUNTRIES.Size > 0 Then
m = COUNTRIES.Get(0)
Log(m.Get("vediamo"))
End If
End Select
Else
Log("Error: " & Job.ErrorMessage)
End If
Job.Release
End Sub