Ejemplo n.º 1
0
        crlUSReductionParticulier IntfDalUSReductionParticulier.selectUSReductionParticulier(string numUSReductionParticulier)
        {
            #region declaration
            crlUSReductionParticulier reductionParticulier     = null;
            IntfDalIndividu           serviceIndividu          = new ImplDalIndividu();
            IntfDalUSCategorieBillet  serviceUSCategorieBillet = new ImplDalUSCategorieBillet();
            #endregion

            #region implementation
            if (numUSReductionParticulier != "")
            {
                this.strCommande  = "SELECT * FROM `usreductionparticulier` WHERE";
                this.strCommande += " usreductionparticulier.numUSReductionParticulier = '" + numUSReductionParticulier + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            reductionParticulier = new crlUSReductionParticulier();
                            reductionParticulier.NumCategorieBillet       = this.reader["numCategorieBillet"].ToString();
                            reductionParticulier.NumIndividu              = this.reader["numIndividu"].ToString();
                            reductionParticulier.NumEtablissementScolaire = this.reader["numEtablissementScolaire"].ToString();
                            reductionParticulier.NumSociete = this.reader["numSociete"].ToString();
                            reductionParticulier.NumUSReductionParticulier = this.reader["numUSReductionParticulier"].ToString();
                            reductionParticulier.ImageReductionParticulier = this.reader["imageReductionParticulier"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (reductionParticulier != null)
                {
                    if (reductionParticulier.NumIndividu != "")
                    {
                        reductionParticulier.individu = serviceIndividu.selectIndividu(reductionParticulier.NumIndividu);
                    }
                    if (reductionParticulier.NumCategorieBillet != "")
                    {
                        reductionParticulier.categorieBillet = serviceUSCategorieBillet.selectUSCategorieBillet(reductionParticulier.NumCategorieBillet);
                    }
                }
            }
            #endregion

            return(reductionParticulier);
        }
Ejemplo n.º 2
0
        crlUSCarteReduction IntfDalUSCarteReduction.selectUSCarteReduction(string numCarteReduction)
        {
            #region declaration
            crlUSCarteReduction carteReduction = null;
            IntfDalClient serviceClient = new ImplDalClient();
            IntfDalUSCategorieBillet serviceUSCategorieBillet = new ImplDalUSCategorieBillet();
            #endregion

            #region implementation
            if (numCarteReduction != "")
            {
                this.strCommande = "SELECT * FROM `uscartereduction` WHERE `numCarteReduction`='" + numCarteReduction + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            carteReduction = new crlUSCarteReduction();
                            try
                            {
                                carteReduction.DateValideAu = Convert.ToDateTime(this.reader["dateValideAu"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.DateValideDu = Convert.ToDateTime(this.reader["dateValideDu"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsDimanche = int.Parse(this.reader["isDimanche"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsJeudi = int.Parse(this.reader["isJeudi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsLundi = int.Parse(this.reader["isLundi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsMardi = int.Parse(this.reader["isMardi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsMercredi = int.Parse(this.reader["isMercredi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsSamedi = int.Parse(this.reader["isSamedi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsVendredi = int.Parse(this.reader["isVendredi"].ToString());
                            }
                            catch (Exception) { }
                            carteReduction.NumCarteReduction = this.reader["numCarteReduction"].ToString();
                            carteReduction.NumCategorieBillet = this.reader["numCategorieBillet"].ToString();
                            carteReduction.NumClient = this.reader["numClient"].ToString();
                            carteReduction.EtatCivil = this.reader["etatCivil"].ToString();
                            try
                            {
                                carteReduction.DateNaissance = Convert.ToDateTime(this.reader["dateNaissance"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.DateDelivranceCertificatScolarite = Convert.ToDateTime(this.reader["dateDelivranceCertificatScolarite"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                carteReduction.DateAtestationEmployeur = Convert.ToDateTime(this.reader["dateAtestationEmployeur"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            carteReduction.ImageCarteReduction = this.reader["imageCarteReduction"].ToString();
                            carteReduction.NumEtablissementScolaire = this.reader["numEtablissementScolaire"].ToString();
                            carteReduction.NumSociete = this.reader["numSociete"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (carteReduction != null) 
                {
                    if (carteReduction.NumCategorieBillet != "") 
                    {
                        carteReduction.categorieBillet = serviceUSCategorieBillet.selectUSCategorieBillet(carteReduction.NumCategorieBillet);
                    }
                    if (carteReduction.NumClient != "") 
                    {
                        carteReduction.client = serviceClient.selectClient(carteReduction.NumClient);
                    }
                }
            }
            #endregion

            return carteReduction;
        }