protected override void OnCreate(Bundle bundle) { RequestWindowFeature(WindowFeatures.NoTitle); base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); mBtnSignUp = FindViewById <Button>(Resource.Id.btnSignUp); mProgressBar = FindViewById <ProgressBar>(Resource.Id.progressBar1); mBtnLogIn = FindViewById <Button>(Resource.Id.btnSignIn); mBtnSignUp.Click += (object sender, EventArgs args) => { //Pull up dialog FragmentTransaction transaction = FragmentManager.BeginTransaction(); dialog_SignUp signUpDialog = new dialog_SignUp(); signUpDialog.Show(transaction, "dialog fragment"); signUpDialog.mOnSignUpComplete += SignUpDialog_mOnSignUpComplete; }; mBtnLogIn.Click += (object sender, EventArgs args) => { FragmentTransaction transaction2 = FragmentManager.BeginTransaction(); Dialog_Login aardappel = new Dialog_Login(); aardappel.Show(transaction2, "potato fragment"); aardappel.mOnLogInComplete += LogInDialog_mOnLogInComplete; }; }
void SignUpDialog_mOnSignUpComplete(object sender, OnSignUpEventArgs e) { mProgressBar.Visibility = ViewStates.Visible; Thread thread = new Thread(ActLikeARequest); thread.Start(); string FirstName = e.FirstName; string Email = e.Email; string Password = e.Password; string LastName = e.LastName; int leeftijd = e.Leeftijd; string bloedgroep = e.Bloedtype; DataTable data = DBconnect.GrabData("select * from Gebruiker"); var emailList = new List <string>(); foreach (DataRow row in data.Rows) { var EmailObject = row[1]; if (EmailObject != null) { emailList.Add(EmailObject.ToString()); } } bool available = DBconnect.CheckForAvailableEmail(emailList, e.Email); if (available) { DBconnect.PushDataAccount(FirstName, Email, Password, LastName, leeftijd, bloedgroep); } else { AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.SetTitle("Error"); alertDialog.SetMessage("Email is al in gebruik"); alertDialog.SetNeutralButton("OK", delegate { alertDialog.Dispose(); //Pull up dialog FragmentTransaction transaction = FragmentManager.BeginTransaction(); dialog_SignUp signUpDialog = new dialog_SignUp(); signUpDialog.Show(transaction, "dialog fragment"); signUpDialog.mOnSignUpComplete += SignUpDialog_mOnSignUpComplete; }); alertDialog.Show(); }; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); mBtnSignUp = FindViewById <Button>(Resource.Id.btnSignUpWithEmail); mProgressWait = FindViewById <ProgressBar>(Resource.Id.progressBar1); mBtnSignUp.Click += (object sender, EventArgs args) => { //Pull up dialog FragmentTransaction transaction = FragmentManager.BeginTransaction(); dialog_SignUp signUpDialog = new dialog_SignUp(); signUpDialog.Show(transaction, "dialog_fragment"); signUpDialog.mOnSignUpComplete += signUpDialog_mOnSignUpComplete; }; }