string IntfDalObservationMateriel.insertObservationMateriel(crlObservationMateriel observation, string sigleAgence) { #region declaration string numObservation = ""; IntfDalObservationMateriel serviceObservationMateriel = new ImplDalObservationMateriel(); int nbInsert = 0; #endregion #region implementation if (observation != null && sigleAgence != "") { observation.NumObservation = serviceObservationMateriel.getNumObservation(sigleAgence); this.strCommande = "INSERT INTO `observationmateriel` (`numObservation`,`numAppareil`,`textObservation`,"; this.strCommande += "`dateObservation`,`isListeNoire`) VALUES ('" + observation.NumObservation + "',"; this.strCommande += "'" + observation.NumAppareil + "','" + 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 IntfDalObservationMateriel.insertToGridObservationMateriel(GridView gridView, string param, string paramLike, string valueLike, string numAppareil) { #region declaration IntfDalObservationMateriel serviceObservationMateriel = new ImplDalObservationMateriel(); #endregion #region implementation this.strCommande = "SELECT observationmateriel.numObservation, observationmateriel.numAppareil,"; this.strCommande += " observationmateriel.textObservation, observationmateriel.dateObservation,"; this.strCommande += " observationmateriel.isListeNoire, usappareil.numAppareil,"; this.strCommande += " usappareil.typeAppareil, usappareil.numSerie FROM observationmateriel"; this.strCommande += " Inner Join usappareil ON usappareil.numAppareil = observationmateriel.numAppareil"; this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%' AND"; this.strCommande += " observationmateriel.numAppareil LIKE '%" + numAppareil + "%'"; this.strCommande += " ORDER BY " + param + " ASC"; gridView.DataSource = serviceObservationMateriel.getDataTableObservationMateriel(this.strCommande); gridView.DataBind(); #endregion }