コード例 #1
0
        List <crlTarifBaseCommission> IntfDalTarifBaseCommission.selectTarifBaseCommissions(string numTrajet)
        {
            #region decalaration
            List <crlTarifBaseCommission> tarifBaseCommissions      = null;
            crlTarifBaseCommission        tempTarifBaseCommission   = null;
            IntfDalTarifCommissionPar     serviceTarifCommissionPar = new ImplDalTarifCommissionPar();
            #endregion

            #region implementation
            if (numTrajet != "")
            {
                this.strCommande  = "SELECT tarifbasecommission.numTarifBaseCommission, tarifbasecommission.numTarifCommissionPar,";
                this.strCommande += " tarifbasecommission.montantTarifBaseCommission FROM tarifbasecommission";
                this.strCommande += " Inner Join associationtrajettarifcommission ON associationtrajettarifcommission.numTarifBaseCommission = tarifbasecommission.numTarifBaseCommission";
                this.strCommande += " WHERE associationtrajettarifcommission.numTrajet = '" + numTrajet + "'";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        tarifBaseCommissions = new List <crlTarifBaseCommission>();
                        while (this.reader.Read())
                        {
                            tempTarifBaseCommission = new crlTarifBaseCommission();
                            tempTarifBaseCommission.NumTarifBaseCommission = this.reader["numTarifBaseCommission"].ToString();
                            tempTarifBaseCommission.NumTarifCommissionPar  = this.reader["numTarifCommissionPar"].ToString();
                            try
                            {
                                tempTarifBaseCommission.MontantTarifBaseCommission = double.Parse(this.reader["montantTarifBaseCommission"].ToString());
                            }
                            catch (Exception)
                            {
                            }

                            tarifBaseCommissions.Add(tempTarifBaseCommission);
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (tarifBaseCommissions != null)
                {
                    for (int i = 0; i < tarifBaseCommissions.Count; i++)
                    {
                        if (tarifBaseCommissions[i].NumTarifCommissionPar != "")
                        {
                            tarifBaseCommissions[i].tarifCommissionPar = serviceTarifCommissionPar.selectTarifCommissionPar(tarifBaseCommissions[i].NumTarifCommissionPar);
                        }
                    }
                }
            }
            #endregion

            return(tarifBaseCommissions);
        }
コード例 #2
0
        crlTarifBaseCommission IntfDalTarifBaseCommission.selectTarifBaseCommission(string numTarifBaseCommission)
        {
            #region decalaration
            crlTarifBaseCommission    tarifBaseCommission       = null;
            IntfDalTarifCommissionPar serviceTarifCommissionPar = new ImplDalTarifCommissionPar();
            #endregion

            #region implementation
            if (numTarifBaseCommission != "")
            {
                this.strCommande = "SELECT * FROM `tarifbasecommission` WHERE (`numTarifBaseCommission`='" + numTarifBaseCommission + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            tarifBaseCommission = new crlTarifBaseCommission();
                            tarifBaseCommission.NumTarifBaseCommission = this.reader["numTarifBaseCommission"].ToString();
                            tarifBaseCommission.NumTarifCommissionPar  = this.reader["numTarifCommissionPar"].ToString();
                            try
                            {
                                tarifBaseCommission.MontantTarifBaseCommission = double.Parse(this.reader["montantTarifBaseCommission"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (tarifBaseCommission != null)
                {
                    if (tarifBaseCommission.NumTarifCommissionPar != "")
                    {
                        tarifBaseCommission.tarifCommissionPar = serviceTarifCommissionPar.selectTarifCommissionPar(tarifBaseCommission.NumTarifCommissionPar);
                    }
                }
            }
            #endregion

            return(tarifBaseCommission);
        }