string IntfDalVoyage.insertVoyage(crlVoyage Voyage, string sigleAgence) { #region declaration IntfDalVoyage serviceVoyage = new ImplDalVoyage(); int nombreInsertion = 0; string idVoyage = ""; #endregion #region implementation if (Voyage != null) { Voyage.IdVoyage = serviceVoyage.getIdVoyage(sigleAgence); this.strCommande = "INSERT INTO `voyage` (`idVoyage`,`numIndividu`,`numerosFB`,`poidBagage`"; this.strCommande += ",`destination`,`numBillet`,`numPlace`,`pieceIdentite`)"; this.strCommande += " VALUES ('" + Voyage.IdVoyage + "', '" + Voyage.NumIndividu + "', '" + Voyage.NumerosFB + "'"; this.strCommande += ",'" + Voyage.PoidBagage + "','" + Voyage.Destination + "','" + Voyage.NumBillet + "'"; this.strCommande += ",'" + Voyage.NumPlace + "','" + Voyage.PieceIdentite + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { idVoyage = Voyage.IdVoyage; } this.serviceConnectBase.closeConnection(); } #endregion return(idVoyage); }
bool IntfDalVoyage.deleteAllVoyage(string idVoyage) { #region declaration crlVoyage voyage = null; bool isDelete = false; IntfDalVoyage serviceVoyage = new ImplDalVoyage(); IntfDalRecu serviceRecu = new ImplDalRecu(); IntfDalBagage serviceBagage = new ImplDalBagage(); #endregion #region implementation if (idVoyage != "") { voyage = serviceVoyage.selectVoyage(idVoyage); if (voyage != null) { serviceBagage.deleteAssociationBagageVoyage(voyage.IdVoyage); if (voyage.bagage != null) { serviceRecu.deleteRecu(voyage.bagage.NumRecu); serviceBagage.deleteBagage(voyage.bagage.IdBagage); } isDelete = serviceVoyage.deleteVoyage(idVoyage); } } #endregion return(isDelete); }
void IntfDalVoyage.insertToGridVoyageFB(GridView gridView, string param, string paramLike, string valueLike, string numerosFB) { #region declaration IntfDalVoyage serviceVoyage = new ImplDalVoyage(); #endregion #region implementation this.strCommande = "SELECT individu.nomIndividu, individu.prenomIndividu, voyage.pieceIdentite, voyage.destination,"; this.strCommande += " voyage.numPlace, voyage.poidBagage, voyage.idVoyage, billet.prixBillet, billet.numBillet FROM voyage"; this.strCommande += " Inner Join individu ON individu.numIndividu = voyage.numIndividu"; this.strCommande += " Inner Join billet ON billet.numBillet = voyage.numBillet"; this.strCommande += " Inner Join trajet ON trajet.numTrajet = billet.numTrajet"; this.strCommande += " WHERE voyage.numerosFB = '" + numerosFB + "' AND " + paramLike + " LIKE '%" + valueLike + "%'"; this.strCommande += " ORDER BY " + param; gridView.DataSource = serviceVoyage.getDataTableVoyageFB(this.strCommande); gridView.DataBind(); #endregion }