Example #1
0
        private void bSuppression_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Êtes-vous sure de vouloir supprimer la question ?", "My App", MessageBoxButton.YesNo);

            switch (result)
            {
            case MessageBoxResult.Yes:
                if (currentTest == "GAME")
                {
                    Answer_Game newAnswerGame = new Answer_Game();
                    newAnswerGame.DeleteAnswersGameFromQuestionId(questionGame.Id);
                    Questions_Game newQuestionGame = new Questions_Game();
                    newQuestionGame.DeleteQuestionGame(questionGame.Id);
                }
                else
                {
                    Answer_Orientation newAnswerOrientation = new Answer_Orientation();
                    newAnswerOrientation.DeleteAnswersOrientationFromQuestionId(questionOrientation.Id);
                    Questions_Orientation newQuestionOrientation = new Questions_Orientation();
                    newQuestionOrientation.DeleteQuestionOrientation(questionOrientation.Id);
                }
                MessageBox.Show("Question supprimée.", "My App");
                //Mettre à jours la liste
                View.wAdminQuestionSelected pg = new View.wAdminQuestionSelected(currentTest);
                pg.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
                pg.Show();
                this.Close();
                break;

            case MessageBoxResult.No:
                break;
            }
        }
Example #2
0
 private void bBack_Click(object sender, RoutedEventArgs e)
 {
     View.wAdminQuestionSelected pg = new View.wAdminQuestionSelected(currentTest);
     pg.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
     pg.Show();
     this.Close();
 }
Example #3
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Answer_Orientation newAnswerOrientation = new Answer_Orientation();

            newAnswerOrientation.EditJobAnswerOrientation(lstAnswer[0].Id, cbAnswerJobOne.SelectedIndex);
            newAnswerOrientation.EditJobAnswerOrientation(lstAnswer[1].Id, cbAnswerJobTwo.SelectedIndex);
            newAnswerOrientation.EditJobAnswerOrientation(lstAnswer[2].Id, cbAnswerJobThree.SelectedIndex);
            newAnswerOrientation.EditJobAnswerOrientation(lstAnswer[3].Id, cbAnswerJobFour.SelectedIndex);
            View.wAdminQuestionSelected pg = new View.wAdminQuestionSelected(currentTest, questionSelected);
            pg.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            pg.Show();
            this.Close();
        }
Example #4
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         Answer_Game editAnswerGame = new Answer_Game();
         editAnswerGame.EditRightAnswerGame(lstAnswer[0].Id, (bool)chbAnswerOne.IsChecked);
         editAnswerGame.EditRightAnswerGame(lstAnswer[1].Id, (bool)chbAnswerTwo.IsChecked);
         editAnswerGame.EditRightAnswerGame(lstAnswer[2].Id, (bool)chbAnswerThree.IsChecked);
         editAnswerGame.EditRightAnswerGame(lstAnswer[3].Id, (bool)chbAnswerFour.IsChecked);
         MessageBox.Show("Modification effectuée");
     }
     catch (Exception ex)
     {
         MessageBox.Show("Erreur lors de la modification de la question");
     }
     View.wAdminQuestionSelected pg = new View.wAdminQuestionSelected(currentTest, questionSelected);
     pg.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
     pg.Show();
     this.Close();
 }
Example #5
0
 private void listView_Click(object sender, MouseButtonEventArgs e)
 {
     if (lvAdmin.SelectedValue != null)
     {
         if (currentTest == "GAME")
         {
             Questions_Game questionGameSelected         = (Questions_Game)lvAdmin.SelectedItems[0];
             View.wAdminQuestionSelected pgAdminQuestion = new View.wAdminQuestionSelected(currentTest, questionGameSelected);
             pgAdminQuestion.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
             pgAdminQuestion.Show();
             this.Close();
         }
         else
         {
             Questions_Orientation       questionOrientationSelected = (Questions_Orientation)lvAdmin.SelectedItems[0];
             View.wAdminQuestionSelected pgAdminQuestion             = new View.wAdminQuestionSelected(currentTest, questionOrientationSelected);
             pgAdminQuestion.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
             pgAdminQuestion.Show();
             this.Close();
         }
     }
 }