Exemple #1
0
 public void SupprimerLieux()
 {
     if (LieuxSelectionne != null && LieuxSelectionne.ID != 0)
     {
         bool            found = false;
         List <C_T_Lieu> tmp   = new CoucheGestion.G_T_Lieu(chConnexion).Lire("");
         foreach (C_T_Lieu t in tmp)
         {
             if (t.ID_Lieu == LieuxSelectionne.ID)
             {
                 found = true;
                 System.Windows.MessageBox.Show("Votre lieu est utilisée dans un event");
             }
         }
         if (!found) // si pas trouvé
         {
             new CoucheGestion.G_T_Lieu(chConnexion).Supprimer(LieuxSelectionne.ID);
             ListTitre.Remove(LieuxSelectionne);
         }
         LieuxSelectionne = new C_Vue_ID_Descr(0, "Lieux");
     }
     else
     {
         System.Windows.MessageBox.Show("pas de lieux a supprimer");
     }
 }
Exemple #2
0
 public void SupprimerTitre()
 {
     if (TitreSelectionne != null && TitreSelectionne.ID != 0)
     {
         bool             found = false;
         List <C_T_Titre> tmp   = new CoucheGestion.G_T_Titre(chConnexion).Lire("");
         foreach (C_T_Titre t in tmp)
         {
             if (t.ID_Titre == TitreSelectionne.ID)
             {
                 found = true;
                 System.Windows.MessageBox.Show("Votre titre est utilisée dans un event");
             }
         }
         if (!found)
         {
             new CoucheGestion.G_T_Titre(chConnexion).Supprimer(TitreSelectionne.ID);
             ListTitre.Remove(TitreSelectionne);
         }
         TitreSelectionne = new C_Vue_ID_Descr(0, "");
     }
     else
     {
         System.Windows.MessageBox.Show("pas de titres a supprimer");
     }
 }