protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.activity_profile); userName = FindViewById <EditText>(Resource.Id.displayName); userEmail = FindViewById <EditText>(Resource.Id.displayEmail); userPassword = FindViewById <EditText>(Resource.Id.displayPassword); userAge = FindViewById <EditText>(Resource.Id.displayAge); myDB = new DBHelperClass(this); myName = Intent.GetStringExtra("userName"); userData = myDB.getUserData(myName); userName.Text = userData[0]; userEmail.Text = userData[1]; userPassword.Text = userData[2]; userAge.Text = userData[3]; userName.Enabled = false; userEmail.Enabled = false; userPassword.Enabled = false; userAge.Enabled = false; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.activity_home); DBobj = new DBHelperClass(this); mySearch = FindViewById <SearchView>(Resource.Id.searchBtn); myList = FindViewById <ListView>(Resource.Id.listUsers); items = new string[] { "Adventure", "Hiking", "Sky Diving" }; // Defined Array values to show in ListView Myadapter = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, items); // Assign adapter to ListView myList.Adapter = Myadapter; myList.ItemClick += List1_ItemClick; mySearch.QueryTextChange += userSearch; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.activity_login); userName = FindViewById <EditText>(Resource.Id.myEmail); userPassword = FindViewById <EditText>(Resource.Id.myPassword); btn_logIn = FindViewById <Button>(Resource.Id.logIn_Button); btn_signUp = FindViewById <Button>(Resource.Id.signUp_Button); alert = new Android.App.AlertDialog.Builder(this); myDB = new DBHelperClass(this); btn_logIn.Click += delegate { var value1 = userName.Text; var value2 = userPassword.Text; System.Console.WriteLine("UserName: "******"Password: "******" ") || value1.Length < 0 || value2.Trim().Equals(" ") || value2.Length < 0) { alert.SetTitle("Error"); alert.SetMessage("Please Enter Valid Data"); alert.SetPositiveButton("OK", AlertOKButton); alert.SetNegativeButton("Cancel", AlertOKButton); Dialog myDialog = alert.Create(); myDialog.Show(); } else { if (myDB.checkUser(value1, value2)) { string[] userData = myDB.getUserData(value1, value2); Intent newScreen = new Intent(this, typeof(BookingActivity)); StartActivity(newScreen); } else { alert.SetTitle("Error"); alert.SetMessage("Invalid Email id or Password"); alert.SetPositiveButton("OK", AlertOKButton); Dialog myDialog = alert.Create(); myDialog.Show(); } } }; btn_signUp.Click += delegate { Intent signUpScreen = new Intent(this, typeof(SignUpActivity)); StartActivity(signUpScreen); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.activity_signup); alert = new Android.App.AlertDialog.Builder(this); myDB = new DBHelperClass(this); userName = FindViewById <EditText>(Resource.Id.inputName); userEmail = FindViewById <EditText>(Resource.Id.inputEmail); userPassword = FindViewById <EditText>(Resource.Id.inputPassword); userAge = FindViewById <EditText>(Resource.Id.inputAge); btn_submit = FindViewById <Button>(Resource.Id.btnSignUp); btn_submit.Click += delegate { var nameValue = userName.Text; var emailValue = userEmail.Text; var passwordValue = userPassword.Text; var ageValue = userAge.Text; if ((nameValue.Trim().Equals("") || nameValue.Length < 0) || (emailValue.Trim().Equals("") || emailValue.Length < 0) || (passwordValue.Trim().Equals("") || passwordValue.Length < 0) || (ageValue.Trim().Equals("") || ageValue.Length < 0)) { alert.SetTitle("Error"); alert.SetMessage("Enter right values in all fields."); alert.SetPositiveButton("OK", AlertOKButton); alert.SetNegativeButton("Cancel", AlertOKButton); Dialog myDialog = alert.Create(); myDialog.Show(); } else { myDB.insertValue(nameValue, emailValue, passwordValue, Convert.ToInt32(ageValue)); Console.WriteLine("Insertion Success"); Intent newScreen = new Intent(this, typeof(LogInActivity)); StartActivity(newScreen); } }; }