Exemple #1
0
        public async void SignInUsingParse(string username, string password)
        {
            var coll = await this.users.Get();

            if (coll.Contains(new User {
                Username = username, Password = password
            }))
            {
                await ParseUser.LogInAsync(username, password);

                var successMessage = new MessageDialog("You successfully signed in!");
                await successMessage.ShowAsync();
            }
            else
            {
                await this.users.Insert(new User { Username = username, Password = password });

                var user = ParseUser.Create <UserParse>();
                user = new UserParse
                {
                    Username = username,
                    Password = password
                };

                await user.SignUpAsync();
            }
        }
Exemple #2
0
        public async void SignUpParse(string username, string password)
        {
            var user = ParseUser.Create <UserParse>();

            user = new UserParse
            {
                Username = username,
                Password = password
            };

            if (user.IsDirty)
            {
                await user.SignUpAsync();

                await user.SaveAsync();
            }
            else
            {
                await ParseUser.LogInAsync(username, password);

                //var successMessage = new MessageDialog("You already have a profile. Please, use the sign in form!");
                //await successMessage.ShowAsync();
            }
        }