bool IntfDalEscorte.deleteEscorte(crlEscorte Escorte) { #region declaration bool isDelete = false; int nombreDelete = 0; #endregion #region implementation if (Escorte != null) { if (Escorte.MatriculeEscorte != "") { this.strCommande = "DELETE FROM `escorte` WHERE (`matriculeEscorte` = '" + Escorte.MatriculeEscorte + "')"; this.serviceConnectBase.openConnection(); nombreDelete = this.serviceConnectBase.requete(this.strCommande); if (nombreDelete == 1) { isDelete = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isDelete); }
string IntfDalEscorte.insertEscorte(crlEscorte Escorte) { #region declaration IntfDalEscorte serviceEscorte = new ImplDalEscorte(); int nombreInsertion = 0; string matriculeEscorte = ""; #endregion #region implementation if (Escorte != null) { Escorte.MatriculeEscorte = serviceEscorte.getMatriculeEscorte(); this.strCommande = "INSERT INTO `escorte` (`matriculeEscorte`,`nomEscorte`,`prenomEscorte`"; this.strCommande += ",`cinEscorte`,`adresseEscorte`,`telephoneEscorte`,`telephoneMobileEscorte`)"; this.strCommande += " VALUES ('" + Escorte.MatriculeEscorte + "','" + Escorte.NomEscorte + "'"; this.strCommande += ",'" + Escorte.PrenomEscorte + "','" + Escorte.CinEscorte + "'"; this.strCommande += ",'" + Escorte.AdresseEscorte + "','" + Escorte.TelephoneEscorte + "', '" + Escorte.TelephoneMobileEscorte + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { matriculeEscorte = Escorte.MatriculeEscorte; } this.serviceConnectBase.closeConnection(); } #endregion return(matriculeEscorte); }
crlEscorte IntfDalEscorte.selectEscorte(string matriculeEscorte) { #region declaration crlEscorte Escorte = null; #endregion #region implementation if (matriculeEscorte != "") { this.strCommande = "SELECT * FROM `escorte` WHERE (`matriculeEscorte` = '" + matriculeEscorte + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { Escorte = new crlEscorte(); reader.Read(); Escorte.AdresseEscorte = reader["adresseEscorte"].ToString(); Escorte.CinEscorte = reader["cinEscorte"].ToString(); Escorte.MatriculeEscorte = reader["matriculeEscorte"].ToString(); Escorte.NomEscorte = reader["nomEscorte"].ToString(); Escorte.PrenomEscorte = reader["prenomEscorte"].ToString(); Escorte.TelephoneEscorte = reader["telephoneEscorte"].ToString(); Escorte.TelephoneMobileEscorte = reader["telephoneMobileEscorte"].ToString(); } reader.Dispose(); } this.serviceConnectBase.closeConnection(); } #endregion return(Escorte); }
int IntfDalEscorte.isEscorteInt(crlEscorte Escorte) { #region declaration int isEscorte = 0; #endregion #region implementation if (Escorte != null) { this.strCommande = "SELECT * FROM `escorte` WHERE (`matriculeEscorte` <> '" + Escorte.MatriculeEscorte + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { while (reader.Read()) { if (Escorte.CinEscorte.Trim().ToLower().Equals(reader["cinEscorte"].ToString().Trim().ToLower())) { isEscorte = 1; break; } } } reader.Dispose(); } this.serviceConnectBase.closeConnection(); } #endregion return(isEscorte); }
bool IntfDalEscorte.updateEscorte(crlEscorte Escorte) { #region declaration bool isUpdate = false; int nombreUpdate = 0; #endregion #region implementation if (Escorte != null) { if (Escorte.MatriculeEscorte != "") { this.strCommande = "UPDATE `escorte` SET `nomEscorte`='" + Escorte.NomEscorte + "', `prenomEscorte`='" + Escorte.PrenomEscorte + "', "; this.strCommande += "`cinEscorte`='" + Escorte.CinEscorte + "', `adresseEscorte`='" + Escorte.AdresseEscorte + "', "; this.strCommande += "`telephoneEscorte`='" + Escorte.TelephoneEscorte + "', `telephoneMobileEscorte`='" + Escorte.TelephoneMobileEscorte + "' "; this.strCommande += "WHERE (`matriculeEscorte`='" + Escorte.MatriculeEscorte + "')"; this.serviceConnectBase.openConnection(); nombreUpdate = this.serviceConnectBase.requete(this.strCommande); if (nombreUpdate == 1) { isUpdate = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isUpdate); }
public crlEscorteVoyage() { this.IdEscorteVoyage = ""; this.MatriculeEscorte = ""; this.NumerosFB = ""; this.TrajetEscorte = ""; this.Escorte = null; }