bool IntfDalUSInfoPasse.updateUSInfoPasse(crlUSInfoPasse infoPasse) { #region declaration bool isUpdate = false; int nbUpdate = 0; #endregion #region implementation if (infoPasse != null) { this.strCommande = "UPDATE `usinfopasse` SET `nombrePasse`='" + infoPasse.NombrePasse.ToString("0") + "',"; this.strCommande += " `niveau`='" + infoPasse.Niveau.ToString("0") + "',"; this.strCommande += " `numReductionBillet`='" + infoPasse.NumReductionBillet + "'"; this.strCommande += " WHERE `numInfoPasse`='" + infoPasse.NumInfoPasse + "'"; this.serviceConnectBase.openConnection(); nbUpdate = this.serviceConnectBase.requete(this.strCommande); if (nbUpdate == 1) { isUpdate = true; } this.serviceConnectBase.closeConnection(); } #endregion return(isUpdate); }
string IntfDalUSInfoPasse.insertUSInfoPasse(crlUSInfoPasse infoPasse, string sigleAgence) { #region declaration string numInfoPasse = ""; int nbInsert = 0; IntfDalUSInfoPasse serviceUSInfoPasse = new ImplDalUSInfoPasse(); #endregion #region implementation if (infoPasse != null && sigleAgence != "") { infoPasse.NumInfoPasse = serviceUSInfoPasse.getNumUSInfoPasse(sigleAgence); this.strCommande = "INSERT INTO `usinfopasse` (`numInfoPasse`,`nombrePasse`,"; this.strCommande += " `niveau`,`numReductionBillet`) VALUES"; this.strCommande += " ('" + infoPasse.NumInfoPasse + "','" + infoPasse.NombrePasse.ToString("0") + "',"; this.strCommande += " '" + infoPasse.Niveau.ToString("0") + "','" + infoPasse.NumReductionBillet + "')"; this.serviceConnectBase.openConnection(); nbInsert = this.serviceConnectBase.requete(this.strCommande); if (nbInsert == 1) { numInfoPasse = infoPasse.NumInfoPasse; } this.serviceConnectBase.closeConnection(); } #endregion return(numInfoPasse); }
string IntfDalUSInfoPasse.isUSInfoPasse(crlUSInfoPasse infoPasse) { #region declaration string numInfoPasse = ""; #endregion #region implementation if (infoPasse != null) { this.strCommande = "SELECT `numInfoPasse` FROM `usinfopasse`"; this.strCommande += " WHERE `niveau`='" + infoPasse.Niveau.ToString("0") + "' AND"; this.strCommande += " `nombrePasse`='" + infoPasse.NombrePasse.ToString("0") + "'"; this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { if (this.reader.Read()) { numInfoPasse = this.reader["numInfoPasse"].ToString(); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); } #endregion return(numInfoPasse); }
crlUSInfoPasse IntfDalUSInfoPasse.selectUSInfoPasse(string numInfoPasse) { #region delcaration crlUSInfoPasse infoPasse = null; IntfDalUSReductionBillet serviceUSReductionBillet = new ImplDalUSReductionBillet(); #endregion #region implementation if (numInfoPasse != "") { this.strCommande = "SELECT * FROM `usinfopasse` WHERE `numInfoPasse`='" + numInfoPasse + "'"; this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { if (this.reader.Read()) { infoPasse = new crlUSInfoPasse(); try { infoPasse.Niveau = int.Parse(this.reader["niveau"].ToString()); } catch (Exception) { } try { infoPasse.NombrePasse = int.Parse(this.reader["nombrePasse"].ToString()); } catch (Exception) { } infoPasse.NumInfoPasse = this.reader["numInfoPasse"].ToString(); infoPasse.NumReductionBillet = this.reader["numReductionBillet"].ToString(); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (infoPasse != null) { if (infoPasse.NumReductionBillet != "") { infoPasse.reductionBillet = serviceUSReductionBillet.selectUSReductionBillet(infoPasse.NumReductionBillet); } } } #endregion return(infoPasse); }