private async void InsertTodoItem(QuestionItem questionItem) { // This code inserts a new TodoItem into the database. When the operation completes // and Mobile Services has assigned an Id, the item is added to the CollectionView await questionTable.InsertAsync(questionItem); items.Add(questionItem); }
private async void UpdateCheckedTodoItem(QuestionItem item) { // This code takes a freshly completed TodoItem and updates the database. When the MobileService // responds, the item is removed from the list await questionTable.UpdateAsync(item); items.Remove(item); }
private void SubmitButton_Click(object sender, RoutedEventArgs e) { //this.userInputText = questionTextField.Text; var todoItem = new QuestionItem { UserId = userId, Question = questionTextField.Text, Answer = "", Friend = FriendBox.Text }; InsertTodoItem(todoItem); }
private void QuestionAnswered() { // Need to get the user name here.. var todoItem = new QuestionItem { UserId = userId, Question = questionTextField.Text, Answer = answer, Friend = FriendBox.Text }; InsertTodoItem(todoItem); RefreshTodoItems(); //questionTextField.Text = Windows.System.UserProfile.UserInformation.GetDisplayNameAsync().ToString();//s +" clicked \"Yes\""; }