Rafi Fahreza
Member
hi guys, i just create a class module that store all of my service like CRUD into my db, look like this:
and i already initialize authservice class in my starter service like this :
and i called the RegisterNewUser2 from my authservice class in my register activity like this :
the data successfully inserted into my db but theevent not triggered
Class AuthService:
Sub Class_Globals
Dim requestSuccess As Boolean
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
End Sub
public Sub RegisterNewUser2(args() As Object) As ResumableSub
Dim cmd As DBCommand = Utility.CreateCommand("registerUser", Array(args(1), args(2), args(3)))
Dim j As HttpJob
j.Initialize("j", args(0))
j = Utility.CreateRequest(args(0)).ExecuteBatch(Array(cmd), Null)
Wait For(j) JobDone(j As HttpJob)
Return j.Success
End Sub
and i already initialize authservice class in my starter service like this :
Starter Service:
Sub Service_Start (StartingIntent As Intent)
authService.Initialize
End Sub
and i called the RegisterNewUser2 from my authservice class in my register activity like this :
Register Activity:
sub button1_Click
Wait For(Starter.authService.RegisterNewUser2(Array As Object(Me, txtUsername.Text, txtPassword.Text, txtEmail.Text))) Complete (Success As Boolean)
If Success Then
StartActivity(Main)
Activity.FInish
Else
ViewHelper.ShowSnackBar(Activity, "Registrasi gagal")
End If
End Sub
the data successfully inserted into my db but theevent not triggered