Esempio n. 1
0
        crlBonDeCommande IntfDalBonDeCommande.selectBonDeCommande(string numBonDeCommande)
        {
            #region declaration
            crlBonDeCommande bonDeCommande = null;

            IntfDalAgent    serviceAgent    = new ImplDalAgent();
            IntfDalProforma serviceProforma = new ImplDalProforma();
            #endregion

            #region implementation
            if (numBonDeCommande != "")
            {
                this.strCommande = "SELECT * FROM `bondecommande` WHERE (`numBonDeCommande`='" + numBonDeCommande + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            bonDeCommande = new crlBonDeCommande();
                            bonDeCommande.NumBonDeCommande = this.reader["numBonDeCommande"].ToString();
                            try
                            {
                                bonDeCommande.DateBC = Convert.ToDateTime(this.reader["dateBC"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                bonDeCommande.DatePaiementBC = Convert.ToDateTime(this.reader["datePaiementBC"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            bonDeCommande.DescriptionBC  = this.reader["descriptionBC"].ToString();
                            bonDeCommande.MatriculeAgent = this.reader["matriculeAgent"].ToString();
                            try
                            {
                                bonDeCommande.MontantBC = double.Parse(this.reader["montantBC"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            bonDeCommande.NumProforma = this.reader["numProforma"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (bonDeCommande != null)
                {
                    if (bonDeCommande.NumProforma != "")
                    {
                        bonDeCommande.proforma = serviceProforma.selectProforma(bonDeCommande.NumProforma);
                    }
                    if (bonDeCommande.MatriculeAgent != "")
                    {
                        bonDeCommande.agent = serviceAgent.selectAgent(bonDeCommande.MatriculeAgent);
                    }
                }
            }
            #endregion

            return(bonDeCommande);
        }
Esempio n. 2
0
        crlBilletCommande IntfDalBilletCommande.selectBilletCommande(string numBilletCommande)
        {
            #region declaration
            crlBilletCommande            billetCommande  = null;
            IntfDalTrajet                serviceTrajet   = new ImplDalTrajet();
            IntfDalProforma              serviceProforma = new ImplDalProforma();
            IntfDalCalculCategorieBillet serviceCalculCategorieBillet = new ImplDalCalculCategorieBillet();
            IntfDalCalculReductionBillet serviceCalculReductionBillet = new ImplDalCalculReductionBillet();
            IntfDalIndividu              serviceIndividu = new ImplDalIndividu();
            #endregion

            #region implementation
            if (numBilletCommande != "")
            {
                this.strCommande = "SELECT * FROM `billetcommande` WHERE (`numBilletCommande`='" + numBilletCommande + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            billetCommande = new crlBilletCommande();
                            billetCommande.NumBilletCommande = this.reader["numBilletCommande"].ToString();
                            billetCommande.NumTrajet         = this.reader["numTrajet"].ToString();

                            billetCommande.NumProforma = this.reader["numProforma"].ToString();
                            try
                            {
                                billetCommande.MontantBilletCommande = double.Parse(this.reader["montantBilletCommande"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                billetCommande.NombreBilletCommande = int.Parse(this.reader["nombreBilletCommande"].ToString());
                            }
                            catch (Exception) { }
                            billetCommande.NumCalculCategorieBillet = this.reader["numCalculCategorieBillet"].ToString();
                            billetCommande.NumCalculReductionBillet = this.reader["numCalculReductionBillet"].ToString();
                            billetCommande.NumIndividu = this.reader["numIndividu"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (billetCommande != null)
                {
                    if (billetCommande.NumTrajet != "")
                    {
                        billetCommande.trajet = serviceTrajet.selectTrajet(billetCommande.NumTrajet);
                    }
                    if (billetCommande.NumCalculCategorieBillet != "")
                    {
                        billetCommande.calculCategorieBillet = serviceCalculCategorieBillet.selectCalculCategorieBillet(billetCommande.NumCalculCategorieBillet);
                    }
                    if (billetCommande.NumCalculReductionBillet != "")
                    {
                        billetCommande.calculReductionBillet = serviceCalculReductionBillet.selectCalculReductionBillet(billetCommande.NumCalculReductionBillet);
                    }
                    if (billetCommande.NumIndividu != "")
                    {
                        billetCommande.individu = serviceIndividu.selectIndividu(billetCommande.NumIndividu);
                    }
                }
            }
            #endregion

            return(billetCommande);
        }