bool IntfDalPlaceFB.insertPlaceFB(crlPlaceFB PlaceFB) { #region declaration IntfDalPlaceFB servicePlaceFB = new ImplDalPlaceFB(); bool isInsert = false; int nombreInsert = 0; #endregion #region implementation if (PlaceFB != null) { if (PlaceFB.NumerosFB != "") { PlaceFB.NumPlace = servicePlaceFB.getNumPlaceFB(PlaceFB.NumerosFB); this.strCommande = "INSERT INTO `PlaceFB` (`numerosFB`,`numPlace`,`isOccuper`)"; this.strCommande += " VALUES ('" + PlaceFB.NumerosFB + "','" + PlaceFB.NumPlace + "','" + PlaceFB.IsOccuper + "')"; this.serviceConnectBase.openConnection(); nombreInsert = this.serviceConnectBase.requete(this.strCommande); if (nombreInsert == 1) { isInsert = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isInsert); }
bool IntfDalPlaceFB.updatePlaceFB(crlPlaceFB PlaceFB) { #region declaration bool isUpdate = false; int nombreUpDate = 0; #endregion #region implementation if (PlaceFB != null) { this.strCommande = "UPDATE `placefb` SET `isOccuper`='" + PlaceFB.IsOccuper + "'"; this.strCommande += " WHERE (`numerosFB`='" + PlaceFB.NumerosFB + "' AND `numPlace`='" + PlaceFB.NumPlace + "')"; this.serviceConnectBase.openConnection(); nombreUpDate = this.serviceConnectBase.requete(this.strCommande); if (nombreUpDate > 0) { isUpdate = true; } this.serviceConnectBase.closeConnection(); } #endregion return(isUpdate); }
bool IntfDalPlaceFB.deletePlaceFB(crlPlaceFB PlaceFB) { #region declaration bool isDelete = false; int nombreDelete = 0; #endregion #region implementation if (PlaceFB != null) { if (PlaceFB.NumerosFB != "") { this.strCommande = "DELETE FROM `PlaceFB` WHERE (`numerosFB` = '" + PlaceFB.NumerosFB + "')"; this.serviceConnectBase.openConnection(); nombreDelete = this.serviceConnectBase.requete(this.strCommande); if (nombreDelete == 1) { isDelete = true; } this.serviceConnectBase.closeConnection(); } } #endregion return(isDelete); }
string IntfDalPlaceFB.insertPlaceForFB(crlFicheBord FicheBord) { #region declaration IntfDalPlaceFB servicePlaceFB = new ImplDalPlaceFB(); crlPlaceFB tempPlaceFB = null; int nombreInsert = 0; int nombreDePlace = 0; string numerosFB = ""; #endregion #region implementation if (FicheBord != null) { if (FicheBord.autorisationVoyage != null) { if (FicheBord.autorisationVoyage.Verification != null) { if (FicheBord.autorisationVoyage.Verification.Licence != null) { nombreDePlace = FicheBord.autorisationVoyage.Verification.Licence.NombrePlacePayante; if (nombreDePlace > 0) { for (int i = 0; i < nombreDePlace; i++) { tempPlaceFB = new crlPlaceFB(); tempPlaceFB.NumerosFB = FicheBord.NumerosFB; if (servicePlaceFB.insertPlaceFB(tempPlaceFB)) { nombreInsert += 1; } } if (nombreInsert == nombreDePlace) { numerosFB = FicheBord.NumerosFB; } else { servicePlaceFB.deletePlaceFB(FicheBord.NumerosFB); } } } } } } #endregion return(numerosFB); }
public crlVoyage() { this.NumIndividu = ""; this.IdVoyage = ""; this.NumerosFB = ""; this.NumBillet = ""; this.Destination = ""; this.NumPlace = ""; this.PieceIdentite = ""; this.poidBagage = 0.00; this.bagage = null; this.individu = null; this.billet = null; this.placeFB = null; }
crlPlaceFB IntfDalPlaceFB.selectPlaceFB(string numerosFB, string numPlace) { #region declaration crlPlaceFB PlaceFB = null; #endregion #region implementation if (numerosFB != "") { this.strCommande = "SELECT * FROM `PlaceFB` WHERE (`numerosFB`='" + numerosFB + "' AND `numPlace`='" + numPlace + "')"; this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { if (this.reader.Read()) { PlaceFB = new crlPlaceFB(); PlaceFB.NumerosFB = this.reader["numerosFB"].ToString(); PlaceFB.NumPlace = this.reader["numPlace"].ToString(); try { PlaceFB.IsOccuper = int.Parse(this.reader["isOccuper"].ToString()); } catch (Exception) { } } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); } #endregion return(PlaceFB); }
List <crlPlaceFB> IntfDalPlaceFB.selectPlaceFB(string numerosFB) { #region declaration List <crlPlaceFB> placeFBs = null; crlPlaceFB tempPlaceFB = null; #endregion #region implementation if (numerosFB != "") { this.strCommande = "SELECT * FROM `PlaceFB` WHERE (`numerosFB`='" + numerosFB + "')"; this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { placeFBs = new List <crlPlaceFB>(); while (this.reader.Read()) { tempPlaceFB = new crlPlaceFB(); tempPlaceFB.NumerosFB = this.reader["numerosFB"].ToString(); tempPlaceFB.NumPlace = this.reader["numPlace"].ToString(); tempPlaceFB.IsOccuper = int.Parse(this.reader["isOccuper"].ToString()); placeFBs.Add(tempPlaceFB); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); } #endregion return(placeFBs); }