private void EnterQuestion_Click(object sender, RoutedEventArgs e) { // Event handler for when the user clicks the EnterQuestion button QuestionEntryWindow enter_question = new QuestionEntryWindow(); enter_question.Show(); }
//doesn't do anything yet! private void EditButton_Click(object sender, RoutedEventArgs e) { // Event handler for when the user clicks the Edit button // Modifies a question in the database QuestionEntryWindow editor = new QuestionEntryWindow(); Boolean isInt = false; int edit = 0; String type = ""; try { edit = Convert.ToInt32(NumberToRemove.Text); isInt = true; } catch (Exception convertError) { MessageBox.Show("Can't Edit at value!"); } if (isInt) { if (this.QuestionTypeToQuery.SelectedIndex == 0) { type = "trueFalse"; DataRow toEdit = DatabaseConnectionQuery.getItemToEdit(edit, type); editor = new QuestionEntryWindow(edit, (String)toEdit.ItemArray[1], "True", "False", null, null, type, this.CatagoryToQuery.SelectedIndex); } else if (this.QuestionTypeToQuery.SelectedIndex == 1) { type = "multipleChoice"; DataRow toEdit = DatabaseConnectionQuery.getItemToEdit(edit, type); editor = new QuestionEntryWindow(edit, (String)toEdit.ItemArray[1], (String)toEdit.ItemArray[2], (String)toEdit.ItemArray[3], (String)toEdit.ItemArray[4], (String)toEdit.ItemArray[5], type, this.CatagoryToQuery.SelectedIndex); } else if (this.QuestionTypeToQuery.SelectedIndex == 2) { type = "shortAnswer"; DataRow toEdit = DatabaseConnectionQuery.getItemToEdit(edit, type); editor = new QuestionEntryWindow(edit, (String)toEdit.ItemArray[1], (String)toEdit.ItemArray[2], (String)toEdit.ItemArray[3], (String)toEdit.ItemArray[4], (String)toEdit.ItemArray[5], type, this.CatagoryToQuery.SelectedIndex); } editor.Show(); } }