/// <summary>
        /// Ajoute une nouvelle DAO à l'aide d'une nouvelle fenêtre
        /// </summary>
        /// <returns>moi-même (un DAO)</returns>
        public DAO Add()
        {
            //Affichage du message "ajout en cours"
            ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = true;
            ((App)App.Current)._theMainWindow.changementTexteStatusBar("Ajout d'une DAO en cours ...");

            //Initialisation de la fenêtre
            DAOWindow daoWindow = new DAOWindow();

            //Création de l'objet temporaire
            DAO tmp = new DAO();
            tmp.Utilisateur = ((App)App.Current)._connectedUser;
            tmp.Date_Creation = DateTime.Today;

            //Mise de l'objet temporaire dans le datacontext
            daoWindow.DataContext = tmp;

            //mise en place du booléen création à vrai
            daoWindow.creation = true;

            //booléen nullable vrai ou faux ou null
            bool? dialogResult = daoWindow.ShowDialog();

            if (dialogResult.HasValue && dialogResult.Value == true)
            {
                //Si j'appuie sur le bouton Ok, je renvoi l'objet DAO se trouvant dans le datacontext de la fenêtre
                return (DAO)daoWindow.DataContext;
            }
            else
            {
                //Si j'appuie sur le bouton annuler, je détache mon objet de la base de données
                try
                {
                    ((App)App.Current).mySitaffEntities.Detach((DAO)daoWindow.DataContext);
                }
                catch (Exception)
                {
                }

                //Si j'appuie sur le bouton annuler, je préviens que j'annule mon ajout
                ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = false;
            ((App)App.Current)._theMainWindow.changementTexteStatusBar("Ajout d'une DAO annulé.");

                //Je renvoi null car j'oublie la dao à ajouter
                return null;
            }
        }
        /// <summary>
        /// Ouvre la DAO séléctionnée à l'aide d'une nouvelle fenêtre
        /// </summary>
        /// <returns>moi-même (un DAO)</returns>
        public DAO Open()
        {
            if (this._DataGridMain.SelectedItem != null)
            {
                if (this._DataGridMain.SelectedItems.Count == 1)
                {
                    //Affichage du message "modification en cours"
                    ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = true;
            ((App)App.Current)._theMainWindow.changementTexteStatusBar("Modification d'une DAO en cours ...");

                    //Création de la fenêtre
                    DAOWindow daoWindow = new DAOWindow();

                    //Initialisation du Datacontext en DAO et association à la DAO sélectionnée
                    daoWindow.DataContext = new DAO();
                    daoWindow.DataContext = this._DataGridMain.SelectedItem;

                    //booléen nullable vrai ou faux ou null
                    bool? dialogResult = daoWindow.ShowDialog();

                    if (dialogResult.HasValue && dialogResult.Value == true)
                    {
                        //Si j'appuie sur le bouton Ok, je renvoi l'objet DAO se trouvant dans le datacontext de la fenêtre
                        return (DAO)daoWindow.DataContext;
                    }
                    else
                    {
                        //Je récupère les anciennes données de la base sur les modifications effectuées
                        ((App)App.Current).mySitaffEntities.Refresh(System.Data.Objects.RefreshMode.StoreWins, (DAO)(this._DataGridMain.SelectedItem));

                        //Si j'appuie sur le bouton annuler, je préviens que j'annule ma modification
                        ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = false;
            ((App)App.Current)._theMainWindow.changementTexteStatusBar("Modification d'une DAO annulée.");

                        //Si j'appuie sur le bouton annuler, je renvoi null
                        return null;
                    }

                }
                else
                {
                    MessageBox.Show("Vous ne devez sélectionner qu'une seule DAO.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return null;
                }
            }
            else
            {
                MessageBox.Show("Vous devez sélectionner une DAO.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return null;
            }
        }
        private void _ButtonAffaireDAONouveau_Click(object sender, RoutedEventArgs e)
        {
            DAOWindow daoWindow = new DAOWindow();
            DAO tmp = new DAO();
            tmp.Utilisateur = ((App)App.Current)._connectedUser;
            tmp.Date_Creation = DateTime.Today;
            daoWindow.DataContext = tmp;

            daoWindow._checkBoxSurAffaire.IsEnabled = false;
            daoWindow._checkBoxSurDevis.IsEnabled = false;
            daoWindow._comboBoxAffaire.IsEnabled = false;
            daoWindow._comboBoxDevis.IsEnabled = false;

            ((DAO)daoWindow.DataContext).Affaire1 = (Affaire)this.DataContext;

            daoWindow.creation = true;

            bool? dialogResult = daoWindow.ShowDialog();

            if (dialogResult.HasValue && dialogResult.Value == true)
            {
                ((Affaire)this.DataContext).DAO.Add((DAO)daoWindow.DataContext);
            }
            else
            {
                try
                {
                    ((App)App.Current).mySitaffEntities.Detach((DAO)daoWindow.DataContext);
                }
                catch (Exception)
                {
                }
            }

            this._dataGridDAO.Items.Refresh();
        }
        /// <summary>
        /// Ouvre la DAO séléctionnée en lecture seule à l'aide d'une nouvelle fenêtre
        /// </summary>
        public DAO Look()
        {
            if (this._DataGridMain.SelectedItem != null)
            {
                if (this._DataGridMain.SelectedItems.Count == 1)
                {
                    //Affichage du message "affichage en cours"
                    ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = true;
            ((App)App.Current)._theMainWindow.changementTexteStatusBar("Affichage d'une DAO en cours ...");

                    //Création de la fenêtre
                    DAOWindow daoWindow = new DAOWindow();

                    //Initialisation du Datacontext en DAO et association à la DAO sélectionnée
                    daoWindow.DataContext = new DAO();
                    daoWindow.DataContext = this._DataGridMain.SelectedItem;

                    //Je positionne la lecture seule sur la fenêtre
                    daoWindow.lectureSeule();

                    //Je met un titre à la fenêtre
                    daoWindow.Title = "DAO : " + ((DAO)daoWindow.DataContext).getNumero;

                    //J'affiche la fenêtre
                    bool? dialogResult = daoWindow.ShowDialog();

                    //Affichage du message "affichage en cours"
                    ((App)App.Current)._theMainWindow.progressBarMainWindow.IsIndeterminate = false;
            ((App)App.Current)._theMainWindow.changementTexteStatusBar("Affichage d'une DAO terminé.");

                    //Renvoi null
                    return null;
                }
                else
                {
                    MessageBox.Show("Vous ne devez sélectionner qu'une seule DAO.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return null;
                }
            }
            else
            {
                MessageBox.Show("Vous devez sélectionner une DAO.", "Attention", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                return null;
            }
        }
        private void _ButtonAffaireDAOModifier_Click(object sender, RoutedEventArgs e)
        {
            if (this._dataGridDAO.SelectedItems.Count <= 0)
            {
                MessageBox.Show("Vous devez sélectionner une DAO à modifier.", "Erreur", MessageBoxButton.OK, MessageBoxImage.Stop);
            }
            else if (this._dataGridDAO.SelectedItems.Count > 1)
            {
                MessageBox.Show("Vous ne devez sélectionner qu'une DAO à modifier.", "Erreur", MessageBoxButton.OK, MessageBoxImage.Stop);
            }
            else if (this._dataGridDAO.SelectedItem != null)
            {
                DAOWindow daoWindow = new DAOWindow();
                daoWindow.DataContext = (DAO)this._dataGridDAO.SelectedItem;

                bool? dialogResult = daoWindow.ShowDialog();

                if (dialogResult.HasValue && dialogResult.Value == true)
                {
                    this._dataGridDAO.SelectedItem = (DAO)daoWindow.DataContext;
                }
                else
                {
                    try
                    {
                        ((App)App.Current).mySitaffEntities.Refresh(System.Data.Objects.RefreshMode.StoreWins, (DAO)daoWindow.DataContext);
                    }
                    catch (Exception)
                    {
                    }

                }
            }
        }