Example #1
0
        List <crlEscorteVoyage> IntfDalEscorteVoyage.selectEscorteVoyageFB(string numerosFB)
        {
            #region declaration
            crlEscorteVoyage        tempEscorteVoyage = null;
            List <crlEscorteVoyage> escorteVoyages    = null;
            IntfDalEscorte          serviceEscorte    = new ImplDalEscorte();
            #endregion

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

                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        escorteVoyages = new List <crlEscorteVoyage>();

                        while (reader.Read())
                        {
                            tempEscorteVoyage = new crlEscorteVoyage();
                            tempEscorteVoyage.IdEscorteVoyage  = reader["idEscorteVoyage"].ToString();
                            tempEscorteVoyage.MatriculeEscorte = reader["matriculeEscorte"].ToString();
                            tempEscorteVoyage.NumerosFB        = reader["numerosFB"].ToString();
                            tempEscorteVoyage.TrajetEscorte    = reader["trajetEscorte"].ToString();

                            escorteVoyages.Add(tempEscorteVoyage);
                        }
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (escorteVoyages != null)
                {
                    for (int i = 0; i < escorteVoyages.Count; i++)
                    {
                        escorteVoyages[i].Escorte = serviceEscorte.selectEscorte(escorteVoyages[i].MatriculeEscorte);
                    }
                }
            }
            #endregion

            return(escorteVoyages);
        }
Example #2
0
        crlEscorteVoyage IntfDalEscorteVoyage.selectEscorteVoyage(string idEscorteVoyage)
        {
            #region declaration
            crlEscorteVoyage EscorteVoyage  = null;
            IntfDalEscorte   serviceEscorte = new ImplDalEscorte();
            #endregion

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

                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        EscorteVoyage = new crlEscorteVoyage();
                        reader.Read();
                        EscorteVoyage.IdEscorteVoyage  = reader["idEscorteVoyage"].ToString();
                        EscorteVoyage.MatriculeEscorte = reader["matriculeEscorte"].ToString();
                        EscorteVoyage.NumerosFB        = reader["numerosFB"].ToString();
                        EscorteVoyage.TrajetEscorte    = reader["trajetEscorte"].ToString();
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (EscorteVoyage != null)
                {
                    EscorteVoyage.Escorte = serviceEscorte.selectEscorte(EscorteVoyage.MatriculeEscorte);
                }
            }
            #endregion

            return(EscorteVoyage);
        }