private bool IsEmplacementFree(string intituleEmplacement) { AccesBD _accesBD = new AccesBD(); List <Emplacement> emplacementsPris; emplacementsPris = _accesBD.ListEmplacementPris(); if (emplacementsPris != null) { for (int i = 0; i < emplacementsPris.Count; i++) { if (intituleEmplacement == emplacementsPris[i].Intitule) { return(false); } } } return(true); }
public static List <string> ListEmplacementsLibresLoad() { AccesBD _accesBD = new AccesBD(); List <string> listInitulesLibres = InituleesEmplacements.ListInituleesEmplacements(); List <Emplacement> emplacementsPris; emplacementsPris = _accesBD.ListEmplacementPris(); if (emplacementsPris != null) { foreach (var e in emplacementsPris) { if (listInitulesLibres.Contains(e.Intitule)) { listInitulesLibres.Remove(e.Intitule); } } } return(listInitulesLibres); }