Example #1
0
        private void dgwAnswers_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            Answer    a = answersList[e.RowIndex];
            frmAnswer f = new frmAnswer(a);

            f.ShowDialog();

            answersList           = db.GetAnswersOfAQuestion(currentQuestion.IdQuestion);
            dgwAnswers.DataSource = answersList;
        }
Example #2
0
        private void btnAddAnswer_Click(object sender, EventArgs e)
        {
            frmAnswer a = new frmAnswer(currentQuestion.IdQuestion);

            a.ShowDialog();
            if (a.currentAnswer.IdAnswer > 0)
            {
                db.AddAnswerToQuestion(currentQuestion.IdQuestion, a.currentAnswer.IdAnswer);
            }

            RefreshData();

            List <Answer> answers = db.GetAnswersOfAQuestion(currentQuestion.IdQuestion);
        }