Exemple #1
0
        private void btnAddAnswer_Click(object sender, EventArgs e)
        {
            AnswerForm af = new AnswerForm();

            af.ShowDialog();

            if (af.DialogResult == DialogResult.OK)
            {
                _gameLogic.Answers.Add(af.Answer);
            }

            _gameLogic.UpdateQandA();
            UpdateAllLists();
        }
Exemple #2
0
        private void btnEditAnswer_Click(object sender, EventArgs e)
        {
            var selectedIndex = lstBoxAnswers.SelectedIndex;

            var itemToEdit = _gameLogic.AnswersAll[selectedIndex];

            AnswerForm ans = new AnswerForm(itemToEdit.Text);

            ans.ShowDialog();

            if (ans.DialogResult == DialogResult.OK)
            {
                itemToEdit.Text = ans.Answer;

                _gameLogic.Answers.UpdateOnDbSide(itemToEdit);

                _gameLogic.UpdateQandA();
                UpdateAllLists();
            }
        }