Send_data (DB As String)
For i = 0 To CLV1.Size - 1
Dim cd As UserData = CLV1.GetValue(i)
Dim req As DBRequestManager = CreateRequest(DB)
Dim dbcmd As DBCommand = CreateCommand("insert_data", Array(params))
'
Dim j As HttpJob = req.ExecuteBatch(Array(dbcmd), Null)
Wait For(j) JobDone(j As HttpJob)
'
PD.MyProgressDialogShow("Proses", "Process send to.." & i) '-- PD is custom progress with b4xdialog'
Next
'
If j.Success Then
PD.MyProgressDialogHide
xui.MsgboxAsync("The message has been sent to : " & CLV1.Size & " users", "Succeed")
Wait For Msgbox_Result (Result As Int)
If Result = DialogResponse.POSITIVE Then
B4XPages.ShowPageAndRemovePreviousPages("page1")
End If
Else
TM.MyToastMsg("failed to send data")
Return
End If
j.Release
End Sub