public void Login_Clicked(object sender, EventArgs e) { try { //conexao com MySQL MySQLCon db = new MySQLCon(); //carrega lista de strings com dados dos produtos int result = db.CarregaUsers(EntryUser.Text, EntryPassword.Text); this.DisplayAlert("Alert", "Código da mensagem\n\n" + Convert.ToString(result), "OK", "Cancel"); if (result == 0) { App.Current.MainPage = new NavigationPage(new ItemsPage()); } } catch (Exception ex) { //Toast.MakeText(this, "Erro : " + ex.Message, ToastLength.Short).Show(); this.DisplayAlert("Error", "Failed User Name or Password", "OK"); } //App.Current.MainPage = new NavigationPage(new ItemsPage()); }
private void Register_Clicked(object sender, EventArgs e) { try { //conexao com MySQL MySQLCon db = new MySQLCon(); //carrega lista de strings com dados dos produtos db.GravaUsers(EntryUserEmail.Text, EntryUserPassword.Text, EntryUserPhoneNumber.Text, EntryUserName.Text); var Esperamensagem = this.DisplayAlert("Alert", "User registered correctly, please confirm your email", "OK", "Cancel"); App.Current.MainPage = new NavigationPage(new LoginPage()); } catch (Exception ex) { //Toast.MakeText(this, "Erro : " + ex.Message, ToastLength.Short).Show(); var Esperamensagem = this.DisplayAlert("Error", "Failed registration", "OK"); } //App.Current.MainPage = new NavigationPage(new ItemsPage()); //Navigation.PushAsync(new LoginPage()); }