private void register(object sender, RoutedEventArgs e) { var todoItem = new TodoItem2 { Name = textBox.Text, SchoolID = textBox1.Text, username = textBox2.Text, password = passwordBox.Password, email = textBox3.Text, phoneno = textBox4.Text }; var todoItem2 = new TodoItem4 { username = textBox2.Text, password = passwordBox.Password, value = "Parent" }; string pw1 = passwordBox.Password; string pw2 = passwordBox2.Password; if (pw1.Equals(pw2)) { InsertTodoItem(todoItem); InsertTodoItem(todoItem2); this.Frame.Navigate(typeof(MainPage), null); } else { } }
private async Task InsertTodoItem(TodoItem2 todoitem2) { await registerparent.InsertAsync(todoitem2); items2.Add(todoitem2); }