private void register(object sender, RoutedEventArgs e) { var todoItem = new TodoItem { Name = textBox.Text, SchoolID = textBox1.Text, gender = comboBox.Items[comboBox.SelectedIndex].ToString(), dateofbirth = comboBox2.Items[comboBox2.SelectedIndex].ToString() + "/" + comboBox3.Items[comboBox3.SelectedIndex].ToString() + "/" + comboBox4.Items[comboBox4.SelectedIndex].ToString(), username = textBox2.Text, password = passwordBox.Password, email = textBox3.Text, phoneno = textBox4.Text, eng = checkBox.IsChecked.Value, hin = checkBox1.IsChecked.Value, math = checkBox2.IsChecked.Value, sci = checkBox3.IsChecked.Value, ss = checkBox4.IsChecked.Value, cs = checkBox5.IsChecked.Value }; var todoItem2 = new TodoItem4 { username = textBox2.Text, password = passwordBox.Password, value = "Student" }; 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(TodoItem todoitem) { await registerstudent.InsertAsync(todoitem); items.Add(todoitem); }