Sub JobDone(Job As HttpJob)
Dim message As String
Dim str1,str2,str3 As String
Dim list1 As List
Dim vals As Map
Dim i,j As Int
'
Main.http_message = Job.GetString ' for debug purposes
message = Job.GetString
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow(Job.JobName,False)
If Job.Success = True Then
Select Job.JobName
'####################################################
'####################################################
Case "advertupdate"
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow("ADVERT: STATUS UPDATE REQUEST SENT SUCCESSFULLY",False)
common_code.parse_adsupdate
'####################################################
'####################################################
Case "surveysubmit" 'print the result to the logs
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow("SURVEY: Update Sent (TARGET HIT SUCCESSFULLY)",False)
'####################################################
'####################################################
Case "statusupdate"
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow(Job.JobName,False)
common_code.parse_statusupdate
'####################################################
'####################################################
Case "newsupdate"
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow(Job.JobName,False)
Main.FLAG_NEWSLOADED = 1
common_code.parse_newsupdate
'####################################################
'####################################################
Case "newuser"
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow(Job.JobName,False)
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow(Main.http_message,True)
'####################################################
'####################################################
Case "advertaction"
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow(Job.JobName,False)
'ToastMessageShow(Main.http_message,True)
'####################################################
'####################################################
Case "surveyupdate"
If (Main.FLAG_DEBUG > 0) Then ToastMessageShow(Job.JobName,False)
common_code.parse_surveyupdate
'####################################################
'####################################################
End Select
'####################################################
'# NOW FOR THE FAILURES
'####################################################
Else
Select Job.JobName
'####################################################
Case "advertupaction"
ToastMessageShow("ADVERT: Action Sent (ERROR: " & Job.ErrorMessage & ")",False)
'####################################################
Case "surveyupaction"
ToastMessageShow("SURVEY: Action Sent (ERROR: " & Job.ErrorMessage & ")",False)
'####################################################
Case "surveysubmit" 'print the result to the logs
ToastMessageShow("SURVEY: Update Sent (ERROR: " & Job.ErrorMessage & ")",False)
'####################################################
Case "newsupdate" 'print the result to the logs
ToastMessageShow("NEWS: Download Request (ERROR: " & Job.ErrorMessage & ")",False)
'####################################################
Case "advertupdate" 'print the result to the logs
ToastMessageShow("ADVERT: Update Request (ERROR: " & Job.ErrorMessage & ")",False)
'####################################################
Case Else
ToastMessageShow("Error: " & Job.ErrorMessage, False)
'####################################################
End Select
End If
Job.Release