Sub JobDone (job1 As HttpJob)
Dim sRet As String
If job1.JobName = "checkjobs" Then
sRet = tools.GetWsresult(job1,Main.WS_get_pending_jobs,"checkjobs")
If sRet.Length>0 And sRet <> "-1" And sRet <> "-2" Then
affichejobs(sRet)
end if
end if
End Sub
Sub affichejobs(sJobs As String)
Dim parser As JSONParser
Dim rows As List
Dim query As String
parser.Initialize(sJobs)
rows = parser.NextArray
ProgressDialogShow("Data Import..") ' just a indicator
query ="DELETE FROM temp_job " ' Deleting all data in temp_job
Main.SQLpi.ExecNonQuery(query)
dbutils.InsertMaps(Main.SQLpi, "temp_job", rows) ' Importing all new data parsed
ProgressDialogHide ' hide the indicator
End Sub