Exemplo n.º 1
0
        bool IntfDalEscorteVoyage.updateEscorteVoyageAll(crlEscorteVoyage EscorteVoyage)
        {
            #region declaration
            IntfDalEscorte       serviceEscorte       = new ImplDalEscorte();
            IntfDalEscorteVoyage serviceEscorteVoyage = new ImplDalEscorteVoyage();

            bool isUpdate  = false;
            int  isEscorte = 0;
            #endregion

            #region implementation
            if (EscorteVoyage != null)
            {
                if (EscorteVoyage.Escorte != null)
                {
                    isEscorte = serviceEscorte.isEscorteInt(EscorteVoyage.Escorte);

                    if (isEscorte == 0)
                    {
                        serviceEscorte.updateEscorte(EscorteVoyage.Escorte);
                    }


                    if (EscorteVoyage.Escorte.MatriculeEscorte != "")
                    {
                        isUpdate = serviceEscorteVoyage.updateEscorteVoyage(EscorteVoyage);
                    }
                }
            }
            #endregion

            return(isUpdate);
        }
Exemplo n.º 2
0
        string IntfDalEscorte.insertEscorte(crlEscorte Escorte)
        {
            #region declaration
            IntfDalEscorte serviceEscorte   = new ImplDalEscorte();
            int            nombreInsertion  = 0;
            string         matriculeEscorte = "";
            #endregion

            #region implementation
            if (Escorte != null)
            {
                Escorte.MatriculeEscorte = serviceEscorte.getMatriculeEscorte();
                this.strCommande         = "INSERT INTO `escorte` (`matriculeEscorte`,`nomEscorte`,`prenomEscorte`";
                this.strCommande        += ",`cinEscorte`,`adresseEscorte`,`telephoneEscorte`,`telephoneMobileEscorte`)";
                this.strCommande        += " VALUES ('" + Escorte.MatriculeEscorte + "','" + Escorte.NomEscorte + "'";
                this.strCommande        += ",'" + Escorte.PrenomEscorte + "','" + Escorte.CinEscorte + "'";
                this.strCommande        += ",'" + Escorte.AdresseEscorte + "','" + Escorte.TelephoneEscorte + "', '" + Escorte.TelephoneMobileEscorte + "')";

                this.serviceConnectBase.openConnection();
                nombreInsertion = this.serviceConnectBase.requete(this.strCommande);
                if (nombreInsertion == 1)
                {
                    matriculeEscorte = Escorte.MatriculeEscorte;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(matriculeEscorte);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        string IntfDalEscorteVoyage.insertEscorteVoyageAll(crlEscorteVoyage EscorteVoyage)
        {
            #region declaration
            IntfDalEscorte       serviceEscorte       = new ImplDalEscorte();
            IntfDalEscorteVoyage serviceEscorteVoyage = new ImplDalEscorteVoyage();

            string idEscorteVoyage = "";
            int    isEscorteVoyage = 0;
            #endregion

            #region implementation
            if (EscorteVoyage != null)
            {
                if (EscorteVoyage.Escorte != null)
                {
                    EscorteVoyage.Escorte.MatriculeEscorte = serviceEscorte.isEscorte(EscorteVoyage.Escorte);
                    if (EscorteVoyage.Escorte.MatriculeEscorte != "")
                    {
                        serviceEscorte.updateEscorte(EscorteVoyage.Escorte);
                    }
                    else
                    {
                        EscorteVoyage.Escorte.MatriculeEscorte = serviceEscorte.insertEscorte(EscorteVoyage.Escorte);
                    }

                    if (EscorteVoyage.Escorte.MatriculeEscorte != "")
                    {
                        EscorteVoyage.MatriculeEscorte = EscorteVoyage.Escorte.MatriculeEscorte;
                        EscorteVoyage.IdEscorteVoyage  = serviceEscorteVoyage.insertEscorteVoyage(EscorteVoyage);

                        //isEscorteVoyage

                        if (EscorteVoyage.IdEscorteVoyage != "")
                        {
                            idEscorteVoyage = EscorteVoyage.IdEscorteVoyage;
                        }
                    }
                }
            }
            #endregion

            return(idEscorteVoyage);
        }
Exemplo n.º 5
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);
        }