public static String Ajouter(ProspectDTO prospect)
 {
     String rslt = String.Empty;
     UniteMetier um = new UniteMetier();
     ProspectMetier.Ajouter(prospect, um);
     um.Executer();
     return rslt;
 }
 public void AjouterProspect(ProspectDTO prospect)
 {
     try {
         ProspectService.Ajouter(prospect);
     }
     catch (Exception e) {
         GererException(e);
     }
 }
 public List<ProspectDTO> ChargerListeProspects()
 {
     _db.Sql = "SELECT PERSONNE.NOM,PERSONNE.PRENOM,PERSONNE.TELEPHONE,DATECONTACT,PERSONNE.ID FROM PERSONNE"
                     + " INNER JOIN PROSPECT ON PERSONNEID=ID";
     IDataReader rd = _db.ExecuteReader();
     List<ProspectDTO> prospects = new List<ProspectDTO>();
     while (rd.Read()) {
         ProspectDTO prospect = new ProspectDTO();
         prospects.Add(Mapper(rd, prospect));
     }
     rd.Close();
     return prospects;
 }
 public new ProspectDTO Charger(int idProspect)
 {
     _db.Sql = "SELECT PERSONNE.NOM,PERSONNE.PRENOM,PERSONNE.TELEPHONE,DATECONTACT,PERSONNE.ID FROM PERSONNE"
                     + " INNER JOIN PROSPECT ON PERSONNEID=ID"
                     + " WHERE ID=@idProspect";
     _db.AddParameter("idProspect", idProspect);
     IDataReader rd = _db.ExecuteReader();
     ProspectDTO prospect = new ProspectDTO();
     try {
         if (rd.Read())
             return Mapper(rd, prospect);
         else
             return null;
     }
     finally {
         rd.Close();
     }
 }
 public static void VerifierSaisie(ProspectDTO prospect)
 {
     PersonneMetier.VerifierSaisie(prospect);
     if (prospect.DateContact == null)
         throw new ExceptionMetier("Vous devez saisir la date de contact avec le prospect.");
 }
 public static void Ajouter(ProspectDTO prospect, UniteMetier um)
 {
     VerifierSaisie(prospect);
     ProspectDAO prospectDAO = new ProspectDAO();
     um.AjouterInsertion(prospectDAO, prospect);
 }
 internal ProspectDTO Mapper(IDataReader rd, ProspectDTO prospect)
 {
     base.Mapper(rd, prospect);
     prospect.DateContact = rd.GetDateTime("DATECONTACT");
     return prospect;
 }