private void Btn_UpdateQuestion(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(QuestionIdTextBox.Text)) { MessageBox.Show("Id field is empty"); return; } var teacher = new TeacherBll(); _myQuestion.QuestionStatement = QStatemenTextBox.Text; _myQuestion.OptionA = OptionATextBox.Text; _myQuestion.OptionB = OptionBTextBox.Text; _myQuestion.OptionC = OptionCTextBox.Text; _myQuestion.OptionD = OptionDTextBox.Text; _myQuestion.Answer = OptionBox.Text; if (teacher.UpdateQuestionById(_myQuestion)) { MessageBox.Show("Question Updated"); } else { MessageBox.Show("Something went wrong"); } }