Sub B4XTable1_CellClicked (ColumnId As String, RowId As Long)
If ColumnId = "Names" Then
If message.Text="" Then
xui.MsgboxAsync("You Must Write the Message You are Sending Please","SMIS")
message.RequestFocus
Return
End If
Dim column As B4XTableColumn = B4XTable1.GetColumn(ColumnId)
Dim value As String = B4XTable1.GetRow(RowId).Get(ColumnId)
Phonex = B4XTable1.GetRow(RowId).Get("Phone")
Account = B4XTable1.GetRow(RowId).Get("Account")
Dim Valuex As String= B4XTable1.GetRow(RowId).Get("Names")
Valuexr = B4XTable1.GetRow(RowId).Get("Type")
Dim Valuexclass As String= B4XTable1.GetRow(RowId).Get("Class")
Dim ValuexrStream As String= B4XTable1.GetRow(RowId).Get("Stream")
Dim FullName As String = Valuex &": "& Valuexclass & ValuexrStream
InputTemplate.Text = value &": "& Valuexclass & ValuexrStream
InputTemplate.lblTitle.Text = column.Id
'Wait For (Dialog.ShowTemplate(InputTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
Dim sf As Object = xui.Msgbox2Async("Are You Sure You Want To Send Message To " & Valuex &" 's "&Valuexr&" ?", FullName , "Yes", "Cancel", "No", Null)
Wait For (sf) Msgbox_Result (Result As Int)
If Result = xui.DialogResponse_Positive Then
Log("handle")
SendMessage(Phonex, "Kabojja Junior School", message.Text)
xui.MsgboxAsync("Message Sent Successfully","SMIS")
'message.Text=""
' B4XTable1.sql1.ExecNonQuery2($"UPDATE data SET ${column.SQLID} = ? WHERE rowid = ?"$, Array As String(InputTemplate.Text, RowId))
' B4XTable1.Refresh
Dim hold As String
Dim rst As ResumableSub = Downloadreply(hold)
Wait For(rst) Complete (Result As String)
End If
End If
End Sub
Sub Downloadreply (a As String) As ResumableSub
Dim j As HttpJob
j.Initialize("", Me)
j.Download($"http://kccug.com/KabojjaApp/RecieveSMSReplysingle.ashx?customerId=${Account}&s=${message.Text}&f=${Valuexr}&ph=${Phonex}}"$ )
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
j.GetString
End If
j.Release
Return a
'StopMessageLoop
End Sub