예제 #1
0
    async void OnButtonClicked1(object sender, EventArgs args)
        {
            Button button = (Button)sender;

            List<usertable> users = await AzureManager.AzureManagerInstance.GetUsers();
            foreach (usertable u in users)
            {
                if (usernameS == u.username)
                {
                    await DisplayAlert("Username already exists", "Please change it :)", "Fine :(");
                    return;
                }
            }

            if (string.IsNullOrWhiteSpace(usernameS))
            {
                await DisplayAlert("Username cannot be whitespace", "Don't try to trick me :)", "Fine :(");
                return;
            }

            if (string.IsNullOrWhiteSpace(passwordS))
            {
                await DisplayAlert("Password cannot be whitespace", "Don't try to trick me :)", "Fine :(");
                return;
            }

            usertable entry = new usertable()
            {
                createdAt = DateTime.Now,
                updatedAt = DateTime.Now,
                password = passwordS,
                username = usernameS,
                points = 0
            };

            await AzureManager.AzureManagerInstance.AddUser(entry);

            await DisplayAlert("Successfully signed up!", "Great", "Thanks");
        }
예제 #2
0
 public async Task UpdateUser(usertable user)
 {
     await this.userTable.UpdateAsync(user);
 }
예제 #3
0
 public async Task AddUser(usertable entry)
 {
     await this.userTable.InsertAsync(entry);
 }