예제 #1
0
        public async Task SaveUsernameAsync(UserToSend item)
        {
            var json = await Task.Run(() => JsonConvert.SerializeObject(item));

            var content = await Task.Run(() => new StringContent("data=" + json, Encoding.UTF8, "application/json"));

            HttpResponseMessage response = null;

            response = await client.PostAsync("http://timekeeperapi.azurewebsites.net/api.php/table3", content);
        }
예제 #2
0
        public void seAllUsers(string name, int userId)
        {
            foreach (User user in userList)
            {
                if (user.getUserID().Equals(userId))
                {
                    user.setName(name);
                }
            }
            UserToSend myUserToSend = new UserToSend(name, userId);

            setUsernameDatabase(myUserToSend);
        }
예제 #3
0
 public async void setUsernameDatabase(UserToSend item)
 {
     RestService myService = new TimekeeperDisplayApp.RestService();
     await myService.SaveUsernameAsync(item);
 }