Private Sub Button_register_Click
Dim bt As Button = Sender
If bt.Tag = "button-register-open-login" Then ' apre la finestra login
Root.RemoveAllViews
Root.LoadLayout("frame_login")
End If
If bt.Tag = "button-register-save" Then 'registra il nuovo profilo
If TextField_mail.Text="" Or TextField_password.Text = "" Or TextField_name.Text = "" Or TextField_surname.Text = "" Or TextField_phone.Text = "" Then
fx.Msgbox(Main.MainForm,"fill in the email and password, name e surname and phone fields","Alert Login")
Return
End If
Dim query As String = "INSERT INTO `ms_gpt`.`tb00`" & _
"(`ms_01`," & _
"`ms_02`, " & _
"`ms_03`," & _
"`ms_04`," & _
"`ms_05`," & _
"`ms_06`," & _
"`ms_07`," & _
"`ms_08`)" & _
"VALUES " & _
"('" & TextField_name.Text &"'," & _
"'" & TextField_surname.Text & "'," & _
"'" & TextField_mail.Text & "'," & _
"'" & TextField_password.Text & "'," & _
"'" & TextField_phone.Text & "'," & _
"'null'," & _
"'"& TextArea_info_profile.Text &"'," & _
"'true');"
Log(query)
If MySql.IsInitialized = False Then
initializeMySQL
End If
Try
If MySql.ExecNonQuery(query) = False Then
Root.RemoveAllViews
Root.LoadLayout("frame_login")
Else
fx.Msgbox(Null,"registration not completed","Alert new Profile")
End If
Catch
Log(LastException)
End Try
MySql.Close
End If
If bt.Tag = "button-register-rule" Then ' apre la finestra rule (info servizio) da farsi
fx.Msgbox(Null, "Bottone ancora da definire","Alert developer")
Return
Root.RemoveAllViews
Root.LoadLayout("frame_login")
End If
End Sub