public static Departement GetDepartement(string abreviation, string expand = "")
        {
            Departement departement = null;

            if (ConnexionBD.Instance().EstConnecte())
            {
                int idEmployeChef = -1;
                ConnexionBD.Instance().ExecuterRequete(
                    string.Format(
                        "SELECT idDepartement _id, nom, abreviation, idEmploye " +
                        "FROM Departements " +
                        "WHERE abreviation = '{0}'",
                        abreviation
                        ), lecteur =>
                {
                    departement = new Departement
                    {
                        _identifiant = int.Parse(lecteur.GetString("_id")),
                        Nom          = lecteur.GetString("nom"),
                        Abreviation  = lecteur.GetString("abreviation")
                    };
                    if (!lecteur.IsDBNull(lecteur.GetOrdinal("idEmploye")))
                    {
                        idEmployeChef = int.Parse(lecteur.GetString("idEmploye"));
                    }
                }
                    );

                if (departement != null)
                {
                    departement.PersonnelMedicalEnChef = (idEmployeChef >= 0 ? null : DataModelEmploye.GetEmploye(idEmployeChef));
                    if (expand.Contains("chambres"))
                    {
                        StringBuilder expandPropagation = new StringBuilder();
                        if (expand.Contains("lits"))
                        {
                            expandPropagation.Append("lits ");
                        }
                        if (expand.Contains("equipements"))
                        {
                            expandPropagation.Append("equipements ");
                        }
                        departement.Chambres = new ObservableCollection <Chambre>(
                            DataModelChambre.GetChambres(
                                departement._identifiant.ToString(),
                                expandPropagation.ToString()
                                )
                            );
                    }
                }
            }
            return(departement);
        }
        public static List <Departement> GetDepartements()
        {
            List <Departement> lstDepartement = new List <Departement>();

            // On vérifie si la BD est connecté
            if (ConnexionBD.Instance().EstConnecte())
            {
                List <int> idEmployesChefs = new List <int>();

                // Si oui, on execute la requête que l'on veut effectuer
                // SqlDR (MySqlDataReader) emmagasine une liste des citoyens de la BD
                ConnexionBD.Instance().ExecuterRequete(
                    "SELECT * " +
                    "FROM departements"
                    , SqlDR => {
                    lstDepartement.Add(new Departement
                    {
                        _identifiant = int.Parse(SqlDR.GetString("idDepartement")),
                        Nom          = SqlDR.GetString("nom"),
                        Abreviation  = SqlDR.GetString("abreviation")
                    });
                    idEmployesChefs.Add(SqlDR.IsDBNull(SqlDR.GetOrdinal("idEmploye")) ? -1 : int.Parse(SqlDR.GetString("idEmploye")));
                }
                    );

                for (int i = 0; i < lstDepartement.Count; i++)
                {
                    lstDepartement[i].PersonnelMedicalEnChef = (idEmployesChefs[i] == -1 ? null : DataModelEmploye.GetEmploye(idEmployesChefs[i]));
                }

                for (int i = 0; i < lstDepartement.Count; i++)
                {
                    lstDepartement[i].Chambres = new ObservableCollection <Chambre>(DataModelChambre.GetChambres(lstDepartement[i]._identifiant.ToString(), "lits, equipements"));
                }
            }

            return(lstDepartement);
        }