void IntfDalUSReductionParticulier.insertToGridUSReductionParticulier(GridView gridView, string param, string paramLike, string valueLike) { #region declaration IntfDalUSReductionParticulier serviceUSReductionParticulier = new ImplDalUSReductionParticulier(); #endregion #region implementation this.strCommande = "SELECT usreductionparticulier.numUSReductionParticulier, usreductionparticulier.numIndividu,"; this.strCommande += " usreductionparticulier.numEtablissementScolaire, usreductionparticulier.numSociete,"; this.strCommande += " usreductionparticulier.numCategorieBillet, individu.numIndividu, individu.civiliteIndividu,"; this.strCommande += " individu.nomIndividu, individu.prenomIndividu, individu.cinIndividu, individu.adresse, individu.profession,"; this.strCommande += " individu.telephoneFixeIndividu, individu.telephoneMobileIndividu, individu.dateNaissanceIndividu,"; this.strCommande += " individu.lieuNaissanceIndividu, societe.nomSociete,"; this.strCommande += " etablissementscolaire.etablissementScolaire, uscategoriebillet.categorieBillet FROM usreductionparticulier"; this.strCommande += " Inner Join individu ON individu.numIndividu = usreductionparticulier.numIndividu"; this.strCommande += " Left Join societe ON societe.numSociete = usreductionparticulier.numSociete"; this.strCommande += " Left Join etablissementscolaire ON etablissementscolaire.numEtablissementScolaire = usreductionparticulier.numEtablissementScolaire"; this.strCommande += " Inner Join uscategoriebillet ON uscategoriebillet.numCategorieBillet = usreductionparticulier.numCategorieBillet"; this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%'"; this.strCommande += " ORDER BY " + param; gridView.DataSource = serviceUSReductionParticulier.getDataTableUSReductionParticulier(this.strCommande); gridView.DataBind(); #endregion }
crlUSCarte IntfDalUSCarte.selectUSCarte(string numCarte) { #region declaration crlUSCarte carte = null; IntfDalAbonnement serviceAbonnement = new ImplDalAbonnement(); IntfDalUSReductionParticulier serviceUSReductionParticulier = new ImplDalUSReductionParticulier(); #endregion #region implementation if (numCarte != "") { this.strCommande = "SELECT * FROM `uscarte` WHERE `numCarte`='" + numCarte + "'"; this.serviceConnectBase.openConnection(); this.reader = this.serviceConnectBase.select(this.strCommande); if (this.reader != null) { if (this.reader.HasRows) { if (this.reader.Read()) { carte = new crlUSCarte(); carte.NumCarte = this.reader["numCarte"].ToString(); carte.NumAbonnement = this.reader["numAbonnement"].ToString(); carte.NumUSReductionParticulier = this.reader["numUSReductionParticulier"].ToString(); carte.NumUSValidationReduction = this.reader["numUSValidationReduction"].ToString(); try { carte.PrixCarte = double.Parse(this.reader["prixCarte"].ToString()); } catch (Exception) { } carte.NumAgence = this.reader["numAgence"].ToString(); carte.NumAbonnementNV = this.reader["numAbonnementNV"].ToString(); carte.NumAbonnementNVDevis = this.reader["numAbonnementNVDevis"].ToString(); } } this.reader.Dispose(); } this.serviceConnectBase.closeConnection(); if (carte != null) { if (carte.NumAbonnement != "") { carte.abonnement = serviceAbonnement.selectAbonnement(carte.NumAbonnement); } if (carte.NumUSReductionParticulier != "") { carte.reductionParticulier = serviceUSReductionParticulier.selectUSReductionParticulier(carte.NumUSReductionParticulier); } } } #endregion return(carte); }
string IntfDalUSReductionParticulier.insertUSReductionParticulier(crlUSReductionParticulier reductionParticulier, string sigleAgence) { #region declaration int nbInsert = 0; string numUSReductionParticulier = ""; string numEtablissementScolaire = "NULL"; string numSociete = "NULL"; IntfDalUSReductionParticulier serviceUSReductionParticulier = new ImplDalUSReductionParticulier(); #endregion #region implementation if (reductionParticulier != null) { if (reductionParticulier.NumEtablissementScolaire != "") { numEtablissementScolaire = "'" + reductionParticulier.NumEtablissementScolaire + "'"; } if (reductionParticulier.NumSociete != "") { numSociete = "'" + reductionParticulier.NumSociete + "'"; } reductionParticulier.NumUSReductionParticulier = serviceUSReductionParticulier.getNumUSReductionParticulier(sigleAgence); this.strCommande = "INSERT INTO `usreductionparticulier` (`numUSReductionParticulier`,`numIndividu`,"; this.strCommande += " `numEtablissementScolaire`,`numSociete`,`numCategorieBillet`,"; this.strCommande += " `imageReductionParticulier`) VALUES ('" + reductionParticulier.NumUSReductionParticulier + "',"; this.strCommande += " '" + reductionParticulier.NumIndividu + "'," + numEtablissementScolaire + ","; this.strCommande += " " + numSociete + ",'" + reductionParticulier.NumCategorieBillet + "',"; this.strCommande += " '" + reductionParticulier.ImageReductionParticulier + "')"; this.serviceConnectBase.openConnection(); nbInsert = this.serviceConnectBase.requete(this.strCommande); if (nbInsert == 1) { numUSReductionParticulier = reductionParticulier.NumUSReductionParticulier; } this.serviceConnectBase.closeConnection(); } #endregion return(numUSReductionParticulier); }