protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Sets our view from the "Main" layout resource SetContentView(Resource.Layout.LoginIn); // init TextView txtEmailLogin = FindViewById <TextView>(Resource.Id.txtEmailLogin); TextView txtPasswordLogin = FindViewById <TextView>(Resource.Id.txtPasswordLogin); Button btnSignIn = FindViewById <Button>(Resource.Id.btnSignIn); Button btnSignUp = FindViewById <Button>(Resource.Id.btnSignUp); Button btnTerugNaarMain = FindViewById <Button>(Resource.Id.btnTerugNaarMain); btnSignIn.Click += delegate { // hides the keyboard InputMethodManager inputManager = (InputMethodManager)this.GetSystemService(Context.InputMethodService); inputManager.HideSoftInputFromWindow(this.CurrentFocus.WindowToken, HideSoftInputFlags.NotAlways); if (string.IsNullOrEmpty(txtEmailLogin.Text)) { LoginSignUpUtils.ShowTextviewError(txtEmailLogin, "Dit veld is leeg"); } else if (string.IsNullOrEmpty(txtPasswordLogin.Text)) { LoginSignUpUtils.ShowTextviewError(txtPasswordLogin, "Dit veld is leeg"); } else { bool validEmail = LoginSignUpUtils.IsValidEmail(txtEmailLogin.Text); if (validEmail) { loginRequest(txtEmailLogin, txtPasswordLogin); } else { LoginSignUpUtils.ShowTextviewError(txtEmailLogin, "Dit is geen geldig e-mailadres"); } } }; btnSignUp.Click += delegate { StartActivity(typeof(SignUpUserUI)); }; btnTerugNaarMain.Click += delegate { this.Finish(); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Sets our view from the "Main" layout resource SetContentView(Resource.Layout.ToevoegenVerkoper); // init TextView txtEmailVerkoper = FindViewById <TextView>(Resource.Id.txtEmailVerkoper); Button btnOpslaanVerkoper = FindViewById <Button>(Resource.Id.btnOpslaanVerkoper); Button btnCancelToevoegenVerkoper = FindViewById <Button>(Resource.Id.btnCancelToevoegenVerkoper); // sets filiaalNaam // testing // To Do: set emailOndernemer to email ingelogde persoon! => creeer apart db TABLE LOGGED in: Kolom: email & Rol emailOndernemer = "testing"; btnOpslaanVerkoper.Click += delegate { // hides the keyboard InputMethodManager inputManager = (InputMethodManager)this.GetSystemService(Context.InputMethodService); inputManager.HideSoftInputFromWindow(this.CurrentFocus.WindowToken, HideSoftInputFlags.NotAlways); if (string.IsNullOrEmpty(txtEmailVerkoper.Text)) { LoginSignUpUtils.ShowTextviewError(txtEmailVerkoper, "Dit veld is leeg"); } else { toevoegRequest(txtEmailVerkoper); } }; btnCancelToevoegenVerkoper.Click += delegate { this.Finish(); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Sets our view from the "SignUp" layout resource SetContentView(Resource.Layout.SignUp); // init TextView txtEmailRegister = FindViewById <TextView>(Resource.Id.txtEmailRegister); TextView txtPasswordRegister = FindViewById <TextView>(Resource.Id.txtPasswordRegister); Button btnSignUp = FindViewById <Button>(Resource.Id.btnSignUp); Button btnCancelRegister = FindViewById <Button>(Resource.Id.btnCancelRegister); // spinner Spinner spinner = FindViewById <Spinner>(Resource.Id.spinner2); spinner.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected); var adapter = ArrayAdapter.CreateFromResource( this, Resource.Array.rolArray, Android.Resource.Layout.SimpleSpinnerItem); adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); spinner.Adapter = adapter; btnSignUp.Click += delegate { // hides keyboard InputMethodManager inputManager = (InputMethodManager)this.GetSystemService(Context.InputMethodService); inputManager.HideSoftInputFromWindow(this.CurrentFocus.WindowToken, HideSoftInputFlags.NotAlways); if (string.IsNullOrEmpty(txtEmailRegister.Text)) { LoginSignUpUtils.ShowTextviewError(txtEmailRegister, "Dit veld is leeg"); } else if (string.IsNullOrEmpty(txtPasswordRegister.Text)) { LoginSignUpUtils.ShowTextviewError(txtPasswordRegister, "Dit veld is leeg"); } else { bool validEmail = LoginSignUpUtils.IsValidEmail(txtEmailRegister.Text); bool validPassword = LoginSignUpUtils.isValidPassword(txtPasswordRegister.Text); if (validEmail && validPassword) { signUpRequest(txtEmailRegister, txtPasswordRegister); } else if (validEmail && !validPassword) { LoginSignUpUtils.ShowTextviewError(txtPasswordRegister, "Het wachtwoord moet minimaal uit 12 cijfers bestaan"); } else { LoginSignUpUtils.ShowTextviewError(txtEmailRegister, "Dit is geen geldig e-mailadres"); } } }; btnCancelRegister.Click += delegate { this.Finish(); }; }