public static ProspectDTO Charger(int idProspect) { using (ProspectDAO prospectDAO = new ProspectDAO()) { ProspectDTO prospect = prospectDAO.Charger(idProspect); if (prospect == null) throw new ExceptionMetier("Le prospect n'existe pas dans la base de données."); return prospect; } }
public static void Supprimer(int idProspect, UniteMetier um) { // TODO: vérifier si le Prospect à supprimer existe ProspectDAO prospectDAO = new ProspectDAO(); um.AjouterSuppression(prospectDAO, idProspect); }
public static List<ProspectDTO> ChargerListeProspects() { using (ProspectDAO prospectDAO = new ProspectDAO()) { return prospectDAO.ChargerListeProspects(); } }
public static void Ajouter(ProspectDTO prospect, UniteMetier um) { VerifierSaisie(prospect); ProspectDAO prospectDAO = new ProspectDAO(); um.AjouterInsertion(prospectDAO, prospect); }
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; }