示例#1
0
 private void MBtnAddAnswer_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(mTxtAddAnswer.Text))
     {
         Answer = new Answer
         {
             QuestionId = this.QuestionId,
             Content    = mTxtAddAnswer.Text,
             IsCorrect  = mToggleAddAnswerIsCorrect.Checked
         };
         AddAnswer?.Invoke(this, null);
     }
     ReloadListAnswer?.Invoke(this, null);
     bsListAnswer.DataSource = Answers;
 }
示例#2
0
        private void MBtnSaveEditAnswer_Click(object sender, EventArgs e)
        {
            var check = int.TryParse(mTxtEditAnswerId.Text, out int result);

            if (check)
            {
                Answer = new Answer
                {
                    AnswerId   = int.Parse(mTxtEditAnswerId.Text),
                    QuestionId = int.Parse(mTxtEditAnswerQuestionId.Text),
                    Content    = mTxtEditAnswerContent.Text,
                    IsCorrect  = mToggleEditAnswerIsCorrect.Checked
                };

                SaveEditAnswer?.Invoke(this, null);
            }
            ReloadListAnswer?.Invoke(this, null);
            bsListAnswer.DataSource = Answers;
        }
示例#3
0
 private void MBtnReloadListAnswer_Click(object sender, EventArgs e)
 {
     ReloadListAnswer?.Invoke(this, null);
     bsListAnswer.DataSource = Answers;
 }