string IntfDalObservationChauffeur.insertObservationChauffeur(crlObservationChauffeur observation, string sigleAgence) { #region declaration string numObservation = ""; IntfDalObservationChauffeur serviceObservationChauffeur = new ImplDalObservationChauffeur(); int nbInsert = 0; #endregion #region implementation if (observation != null && sigleAgence != "") { observation.NumObservation = serviceObservationChauffeur.getNumObservation(sigleAgence); this.strCommande = "INSERT INTO `observationchauffeur` (`numObservation`,`idChauffeur`,`textObesvation`,"; this.strCommande += "`dateObservation`,`isListeNoire`) VALUES ('" + observation.NumObservation + "',"; this.strCommande += "'" + observation.IdChauffeur + "','" + observation.TextObesvation + "',"; this.strCommande += "'" + observation.DateObservation.ToString("yyyy-MM-dd") + "','" + observation.IsListeNoire + "')"; this.serviceConnectBase.openConnection(); nbInsert = this.serviceConnectBase.requete(this.strCommande); if (nbInsert == 1) { numObservation = observation.NumObservation; } this.serviceConnectBase.closeConnection(); } #endregion return(numObservation); }
void IntfDalObservationChauffeur.insertToGridObservationChauffeur(GridView gridView, string param, string paramLike, string valueLike, string idChauffeur) { #region declaration IntfDalObservationChauffeur serviceObservationChauffeur = new ImplDalObservationChauffeur(); #endregion #region implementation this.strCommande = "SELECT observationchauffeur.numObservation, observationchauffeur.idChauffeur,"; this.strCommande += " observationchauffeur.textObesvation, observationchauffeur.dateObservation,"; this.strCommande += " observationchauffeur.isListeNoire, chauffeur.idChauffeur, chauffeur.nomChauffeur,"; this.strCommande += " chauffeur.prenomChauffeur, chauffeur.cinChauffeur, chauffeur.adresseChauffeur,"; this.strCommande += " chauffeur.telephoneChauffeur, chauffeur.telephoneMobileChauffeur,"; this.strCommande += " chauffeur.imageChauffeur FROM observationchauffeur"; this.strCommande += " Inner Join chauffeur ON chauffeur.idChauffeur = observationchauffeur.idChauffeur"; this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%' AND"; this.strCommande += " observationchauffeur.idChauffeur LIKE '%" + idChauffeur + "%'"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceObservationChauffeur.getDataTableObservationChauffeur(this.strCommande); gridView.DataBind(); #endregion }