Esempio n. 1
0
 public void SupprimerCollation()
 {
     if (CollationSelectionne != null)
     {
         bool            found    = false;
         List <C_T_Menu> lmenutmp = new CoucheGestion.G_T_Menu(chConnexion).Lire("");
         foreach (C_T_Menu menu in lmenutmp)
         {
             if (menu.ID_Collation == CollationSelectionne.ID)
             {
                 found = true;
                 System.Windows.MessageBox.Show("Votre Collation est utilisée dans un plat");
             }
         }
         if (!found)
         {
             new CoucheGestion.G_T_Nourriture(chConnexion).Supprimer(CollationSelectionne.ID);
             ListCollation.Remove(CollationSelectionne);
         }
     }
 }
Esempio n. 2
0
 public void SupprimerPlat()
 {
     if (PlatSelectionne != null)
     {
         bool            found    = false;
         List <C_T_Menu> lmenutmp = new CoucheGestion.G_T_Menu(chConnexion).Lire("");
         foreach (C_T_Menu menu in lmenutmp)
         {
             if (menu.ID_Plat == PlatSelectionne.ID)
             {
                 found = true;
                 System.Windows.MessageBox.Show("Votre plat est utilisée dans un menu");
             }
         }
         if (!found)
         {
             new CoucheGestion.G_T_Nourriture(chConnexion).Supprimer(PlatSelectionne.ID);
             ListPlat.Remove(PlatSelectionne);
         }
     }
 }