Beispiel #1
0
 /// <summary>
 /// (button)添加新试题
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void showAddNewQuestion(object sender, RoutedEventArgs e)
 {
     #region
     NewQuestion frmquestion = new NewQuestion(ExamQuestionState.NormalAdd);
     frmquestion.InitUI();
     frmquestion.ShowDialog();
     #endregion
 }
Beispiel #2
0
 /// <summary>
 /// 编辑选中考题
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void showEditQuestion(object sender, RoutedEventArgs e)
 {
     #region
     this.AddDBCheck(() =>
     {
         DataRowView drvquestion = null;
         if (this.dgQuestion.SelectedItem != null)
         {
             drvquestion = this.dgQuestion.SelectedItem as DataRowView;
         }
         else
         {
             ExtMessage.Show("请选中要编辑的数据!");
             return;
         }
         NewQuestion frmquestion = new NewQuestion(ExamQuestionState.NormalEdit);
         frmquestion.QuestionRow = QuestionController.QuestionData.Tables[0]
                                   .Rows.Find(drvquestion[ExamQuestionData.questionId]);
         frmquestion.InitUI();
         frmquestion.ShowDialog();
     });
     #endregion
 }