private void Option_Click(object sender, EventArgs e) { Button clickedButton = (Button)sender; foreach (Answer a in Answer.GetAllAnswers()) { if (clickedButton.Text == a.text) { answer = a; Voter.GetAllVoters()[0].AddGivenAnswer(Voter.GetAllVoters()[0], a); //MessageBox.Show("Votes für '" + clickedButton.Text + "': " + answer.countVotes); ShowEvaluation(); } } }
private void Option_Click(object sender, EventArgs e) { Button clickedButton = (Button)sender; Answer answer; foreach (Answer a in Answer.GetAllAnswers()) { if (clickedButton.Text == a.text) { answer = a; Voter.GetAllVoters()[0].AddGivenAnswer(Voter.GetAllVoters()[0], a); //MessageBox.Show("Votes für '" + clickedButton.Text + "': " + answer.countVotes); //if (_choseOptionQuestion1 == true) //{ // ShowEvaluation(); //} //else //{ // //StartFeedback(0); //} } } _currentQuestion++; Button answerGiven = (Button)sender; DatabaseConnection db = new DatabaseConnection(); string q1 = "INSERT INTO feedback VALUES ("; string q2 = _feedbackID.ToString() + "," + _currentQuestion.ToString() + ",'" + answerGiven.Text + "'"; string q3 = ")"; string q = q1 + q2 + q3; Debug.Print(q); db.InsertUpdateDelete(q); UpdateFeedbackID(); NextQuestion(); }