示例#1
0
		async void OnValidClicked (object sender, EventArgs e)
		{
			string nom, prenom, email, password,passwordConf;
			nom = nomEntry.Text;
			prenom = prenomEntry.Text;
			email = emailEntry.Text;
			password = passEntry.Text;
			passwordConf = confEntry.Text;


		
			if (!nom.Equals ("") && !prenom.Equals ("") && !email.Equals ("") && !password.Equals ("") && !passwordConf.Equals ("") && password.Equals(passwordConf)) {
				
				Console.WriteLine ("user infos : \n nom = {0} \n prenom = {1} \n email = {2} \n password = {3} \n password conf = {4} \n",
					nom, prenom,email,password,passwordConf);

				User user = new User (email, password, prenom, nom);
				user.Rigister ();

				await Navigation.PushAsync (new Products ());
			}
				




		}
示例#2
0
		async void OnLoginButtonClicked (object sender, EventArgs e)
		{
			var user = new User {
				Username = usernameEntry.Text,
				Password = passwordEntry.Text
			};

			/*var isValid = AreCredentialsCorrect (user);
			if (isValid) {
				App.IsUserLoggedIn = true;
				Navigation.InsertPageBefore (new MainPage (), this);
				await Navigation.PopAsync ();
			} else {
				messageLabel.Text = "Login failed";
				passwordEntry.Text = string.Empty;
			}*/
		}
示例#3
0
		bool AreCredentialsCorrect (User user)
		{
			//return user.Username == Constants.Username && user.Password == Constants.Password;
			return true;
		}