public static AnnonceDTO Charger(int idAnnonce)
 {
     using (AnnonceDAO annonceDAO = new AnnonceDAO()) {
         AnnonceDTO annonce = annonceDAO.Charger(idAnnonce);
         if (annonce == null)
             throw new ExceptionMetier("L'annonce n'existe pas dans la base de données.");
         return annonce;
     }
 }
 public static void Supprimer(int idAnnonce, UniteMetier um)
 {
     using (AnnonceDAO annonceDAO = new AnnonceDAO()) {
         AnnonceDTO annonce = annonceDAO.Charger(idAnnonce);
         if (annonce == null)
             throw new ExceptionMetier("L'annonce n'existe pas dans la base de données.");
         um.AjouterSuppression(annonceDAO, idAnnonce);
     }
 }
        internal AgendaDTO Mapper(IDataReader rd, AgendaDTO agenda)
        {
            agenda.Date = rd.GetDateTime("DATEENTREE");
            agenda.Description = rd.GetString("DESCRIPTION");
            agenda.Titre = rd.GetString("TITRE");
            if (rd.GetNullableInt("PROSPECTPERSONNEID") != null) {
                ProspectDAO prospect = new ProspectDAO();
                agenda.Prospect = prospect.Charger(rd.GetInt("PROSPECTPERSONNEID"));
            }
            if (rd.GetNullableInt("AGENTPERSONNEID") != null) {
                AgentDAO agent = new AgentDAO();
                agenda.Agent = agent.Charger(rd.GetInt("AGENTPERSONNEID"));
            }
            if (rd.GetNullableInt("ANNONCEID") != null) {
                AnnonceDAO annonce = new AnnonceDAO();
                agenda.Annonce = annonce.Charger(rd.GetInt("ANNONCEID"));
            }
            agenda.IdAgenda = rd.GetInt("ID");

            return agenda;
        }