string IntfDalAgent.insertAgent(crlAgent Agent) { #region declaration IntfDalAgent serviceAgent = new ImplDalAgent(); int nombreInsertion = 0; string matriculeAgent = ""; #endregion #region implementation if (Agent != null) { if (Agent.agence != null) { Agent.matriculeAgent = serviceAgent.getMatriculeAgent(Agent.agence.SigleAgence); this.strCommande = "INSERT INTO `agent` (`matriculeAgent`,`numAgence`,`typeAgent`,`nomAgent`,`prenomAgent`,"; this.strCommande += "`dateNaissanceAgent`, `lieuNaissanceAgent`,`loginAgent`,`motDePasseAgent`,`cinAgent`,`adresseAgent`,"; this.strCommande += "`telephoneAgent`,`telephoneMobileAgent`,`imageAgent`,`situationFamilialeAgent`) VALUES ('" + Agent.matriculeAgent + "','" + Agent.numAgence + "',"; this.strCommande += "'" + Agent.typeAgent + "', '" + Agent.nomAgent + "', '" + Agent.prenomAgent + "', '" + Agent.dateNaissanceAgent.ToString("yyyy-MM-dd") + "',"; this.strCommande += "'" + Agent.lieuNaissanceAgent + "', '" + Agent.loginAgent + "', '" + Agent.motDePasseAgent + "', '" + Agent.cinAgent + "',"; this.strCommande += "'" + Agent.adresseAgent + "', '" + Agent.telephoneAgent + "', '" + Agent.telephoneMobileAgent + "','" + Agent.ImageAgent + "',"; this.strCommande += "'" + Agent.SituationFamilialeAgent + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { matriculeAgent = Agent.matriculeAgent; } this.serviceConnectBase.closeConnection(); } } #endregion return(matriculeAgent); }