int IntfDalEscorteVoyage.isEscorteVoyageInt(crlEscorteVoyage EscorteVoyage) { #region declaration int isEscorteVoyage = 0; #endregion #region implementation if (EscorteVoyage != null) { this.strCommande = "SELECT * FROM `escortevoyage` WHERE (`idEscorteVoyage` <> '" + EscorteVoyage.IdEscorteVoyage + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { while (reader.Read()) { if (EscorteVoyage.MatriculeEscorte.Trim().ToLower().Equals(reader["matriculeEscorte"].ToString().Trim().ToLower()) && EscorteVoyage.NumerosFB.Trim().ToLower().Equals(reader["numerosFB"].ToString().Trim().ToLower())) { isEscorteVoyage = 1; break; } } } reader.Dispose(); } this.serviceConnectBase.closeConnection(); } #endregion return(isEscorteVoyage); }
string IntfDalEscorteVoyage.insertEscorteVoyage(crlEscorteVoyage EscorteVoyage) { #region declaration IntfDalEscorteVoyage serviceEscorteVoyage = new ImplDalEscorteVoyage(); int nombreInsertion = 0; string idEscorteVoyage = ""; #endregion #region implementation if (EscorteVoyage != null) { EscorteVoyage.IdEscorteVoyage = serviceEscorteVoyage.getIdEscorteVoyage(); this.strCommande = "INSERT INTO `escortevoyage` (`idEscorteVoyage`"; this.strCommande += ",`matriculeEscorte`,`numerosFB`,`trajetEscorte`)"; this.strCommande += " VALUES ('" + EscorteVoyage.IdEscorteVoyage + "'"; this.strCommande += ",'" + EscorteVoyage.MatriculeEscorte + "','" + EscorteVoyage.NumerosFB + "'"; this.strCommande += ",'" + EscorteVoyage.TrajetEscorte + "')"; this.serviceConnectBase.openConnection(); nombreInsertion = this.serviceConnectBase.requete(this.strCommande); if (nombreInsertion == 1) { idEscorteVoyage = EscorteVoyage.IdEscorteVoyage; } this.serviceConnectBase.closeConnection(); } #endregion return(idEscorteVoyage); }
bool IntfDalEscorteVoyage.updateEscorteVoyageAll(crlEscorteVoyage EscorteVoyage) { #region declaration IntfDalEscorte serviceEscorte = new ImplDalEscorte(); IntfDalEscorteVoyage serviceEscorteVoyage = new ImplDalEscorteVoyage(); bool isUpdate = false; int isEscorte = 0; #endregion #region implementation if (EscorteVoyage != null) { if (EscorteVoyage.Escorte != null) { isEscorte = serviceEscorte.isEscorteInt(EscorteVoyage.Escorte); if (isEscorte == 0) { serviceEscorte.updateEscorte(EscorteVoyage.Escorte); } if (EscorteVoyage.Escorte.MatriculeEscorte != "") { isUpdate = serviceEscorteVoyage.updateEscorteVoyage(EscorteVoyage); } } } #endregion return(isUpdate); }
bool IntfDalEscorteVoyage.updateEscorteVoyage(crlEscorteVoyage EscorteVoyage) { #region declaration bool isUpdate = false; int nombreUpdate = 0; #endregion #region implementation if (EscorteVoyage != null) { if (EscorteVoyage.IdEscorteVoyage != "") { this.strCommande = "UPDATE `escortevoyage` SET `matriculeEscorte`='" + EscorteVoyage.MatriculeEscorte + "', "; this.strCommande += "`numerosFB`='" + EscorteVoyage.NumerosFB + "', `trajetEscorte`='" + EscorteVoyage.TrajetEscorte + "' "; this.strCommande += "WHERE (`idEscorteVoyage`='" + EscorteVoyage.IdEscorteVoyage + "')"; this.serviceConnectBase.openConnection(); nombreUpdate = this.serviceConnectBase.requete(this.strCommande); if (nombreUpdate == 1) { isUpdate = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isUpdate); }
bool IntfDalEscorteVoyage.deleteEscorteVoyage(crlEscorteVoyage EscorteVoyage) { #region declaration bool isDelete = false; int nombreDelete = 0; #endregion #region implementation if (EscorteVoyage != null) { if (EscorteVoyage.IdEscorteVoyage != "") { this.strCommande = "DELETE FROM `escortevoyage` WHERE (`idEscorteVoyage` = '" + EscorteVoyage.IdEscorteVoyage + "')"; this.serviceConnectBase.openConnection(); nombreDelete = this.serviceConnectBase.requete(this.strCommande); if (nombreDelete == 1) { isDelete = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isDelete); }
List <crlEscorteVoyage> IntfDalEscorteVoyage.selectEscorteVoyageFB(string numerosFB) { #region declaration crlEscorteVoyage tempEscorteVoyage = null; List <crlEscorteVoyage> escorteVoyages = null; IntfDalEscorte serviceEscorte = new ImplDalEscorte(); #endregion #region implementation if (numerosFB != "") { this.strCommande = "SELECT * FROM `escortevoyage` WHERE (`numerosFB` = '" + numerosFB + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { escorteVoyages = new List <crlEscorteVoyage>(); while (reader.Read()) { tempEscorteVoyage = new crlEscorteVoyage(); tempEscorteVoyage.IdEscorteVoyage = reader["idEscorteVoyage"].ToString(); tempEscorteVoyage.MatriculeEscorte = reader["matriculeEscorte"].ToString(); tempEscorteVoyage.NumerosFB = reader["numerosFB"].ToString(); tempEscorteVoyage.TrajetEscorte = reader["trajetEscorte"].ToString(); escorteVoyages.Add(tempEscorteVoyage); } } reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (escorteVoyages != null) { for (int i = 0; i < escorteVoyages.Count; i++) { escorteVoyages[i].Escorte = serviceEscorte.selectEscorte(escorteVoyages[i].MatriculeEscorte); } } } #endregion return(escorteVoyages); }
string IntfDalEscorteVoyage.insertEscorteVoyageAll(crlEscorteVoyage EscorteVoyage) { #region declaration IntfDalEscorte serviceEscorte = new ImplDalEscorte(); IntfDalEscorteVoyage serviceEscorteVoyage = new ImplDalEscorteVoyage(); string idEscorteVoyage = ""; int isEscorteVoyage = 0; #endregion #region implementation if (EscorteVoyage != null) { if (EscorteVoyage.Escorte != null) { EscorteVoyage.Escorte.MatriculeEscorte = serviceEscorte.isEscorte(EscorteVoyage.Escorte); if (EscorteVoyage.Escorte.MatriculeEscorte != "") { serviceEscorte.updateEscorte(EscorteVoyage.Escorte); } else { EscorteVoyage.Escorte.MatriculeEscorte = serviceEscorte.insertEscorte(EscorteVoyage.Escorte); } if (EscorteVoyage.Escorte.MatriculeEscorte != "") { EscorteVoyage.MatriculeEscorte = EscorteVoyage.Escorte.MatriculeEscorte; EscorteVoyage.IdEscorteVoyage = serviceEscorteVoyage.insertEscorteVoyage(EscorteVoyage); //isEscorteVoyage if (EscorteVoyage.IdEscorteVoyage != "") { idEscorteVoyage = EscorteVoyage.IdEscorteVoyage; } } } } #endregion return(idEscorteVoyage); }
crlEscorteVoyage IntfDalEscorteVoyage.selectEscorteVoyage(string idEscorteVoyage) { #region declaration crlEscorteVoyage EscorteVoyage = null; IntfDalEscorte serviceEscorte = new ImplDalEscorte(); #endregion #region implementation if (idEscorteVoyage != "") { this.strCommande = "SELECT * FROM `escortevoyage` WHERE (`idEscorteVoyage` = '" + idEscorteVoyage + "')"; this.serviceConnectBase.openConnection(); reader = this.serviceConnectBase.select(this.strCommande); if (reader != null) { if (reader.HasRows) { EscorteVoyage = new crlEscorteVoyage(); reader.Read(); EscorteVoyage.IdEscorteVoyage = reader["idEscorteVoyage"].ToString(); EscorteVoyage.MatriculeEscorte = reader["matriculeEscorte"].ToString(); EscorteVoyage.NumerosFB = reader["numerosFB"].ToString(); EscorteVoyage.TrajetEscorte = reader["trajetEscorte"].ToString(); } reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (EscorteVoyage != null) { EscorteVoyage.Escorte = serviceEscorte.selectEscorte(EscorteVoyage.MatriculeEscorte); } } #endregion return(EscorteVoyage); }