//perguntas de diagnostico private void buttonPerDia_Click(object sender, RoutedEventArgs e) { DBConnect NewcConnection = new DBConnect(); NewcConnection.dbConnection(); MySqlCommand verifica = new MySqlCommand("SELECT * FROM questionset", DBConnect.db); MySqlDataReader read = verifica.ExecuteReader(); int count = 0; while (read.Read()) { count = count + 1; } DBConnect.db.Close(); if (count != 0) { Questionario pergunt = new Questionario(); pergunt.ShowDialog(); } else { if (MessageBox.Show("Não tem QuestionSet inserido, quer inserir agora?", "Confirmation", MessageBoxButton.YesNo) == MessageBoxResult.Yes) { QuestionSet quest = new QuestionSet(); quest.ShowDialog(); Questionario pergunt = new Questionario(); pergunt.ShowDialog(); } else { MessageBox.Show("Operação anulada!!!"); } } }
//question set private void button3_Click(object sender, RoutedEventArgs e) { QuestionSet quest = new QuestionSet(); quest.ShowDialog(); }