Exemplo n.º 1
0
        bool IntfDalUSAxe.updateUSAxe(crlUSAxe axe)
        {
            #region declaration
            bool isUpdate = false;
            int  nbUpdate = 0;
            #endregion

            #region implementation
            if (axe != null)
            {
                this.strCommande  = "UPDATE `usaxe` SET `nomAxe`='" + axe.NomAxe + "',";
                this.strCommande += " `descriptionAxe`='" + axe.DescriptionAxe + "' WHERE";
                this.strCommande += " `numAxe`='" + axe.NumAxe + "'";

                this.serviceConnectBase.openConnection();
                nbUpdate = this.serviceConnectBase.requete(this.strCommande);
                if (nbUpdate == 1)
                {
                    isUpdate = true;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(isUpdate);
        }
Exemplo n.º 2
0
        string IntfDalUSAxe.insertUSAxe(crlUSAxe axe, string sigleAgence)
        {
            #region declaration
            string       numAxe       = "";
            IntfDalUSAxe serviceUSAxe = new ImplDalUSAxe();
            int          nbInsert     = 0;
            #endregion

            #region implemenation
            if (axe != null && sigleAgence != "")
            {
                axe.NumAxe        = serviceUSAxe.getNumUSAxe(sigleAgence);
                this.strCommande  = "INSERT INTO `usaxe` (`numAxe`,`nomAxe`,`descriptionAxe`)";
                this.strCommande += " VALUES ('" + axe.NumAxe + "','" + axe.NomAxe + "',";
                this.strCommande += " '" + axe.DescriptionAxe + "')";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numAxe = axe.NumAxe;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numAxe);
        }
Exemplo n.º 3
0
        string IntfDalUSAxe.isUSAxe(crlUSAxe axe)
        {
            #region declaration
            string numAxe = "";
            #endregion

            #region implementation
            if (axe != null)
            {
                this.strCommande = "SELECT * FROM `usaxe` WHERE (`numAxe`<>'" + axe.NumAxe + "' AND `nomAxe`='" + axe.NomAxe + "')";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            numAxe = this.reader["numAxe"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numAxe);
        }
Exemplo n.º 4
0
        crlUSAxe IntfDalUSAxe.selectUSAxe(string numAxe)
        {
            #region declaration
            crlUSAxe axe = null;
            #endregion

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

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            axe                = new crlUSAxe();
                            axe.NumAxe         = this.reader["numAxe"].ToString();
                            axe.NomAxe         = this.reader["nomAxe"].ToString();
                            axe.DescriptionAxe = this.reader["descriptionAxe"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(axe);
        }
Exemplo n.º 5
0
        crlUSAxe IntfDalUSAxe.selectUSAxeLieu(string numLieu)
        {
            #region declaration
            crlUSAxe axe = null;
            #endregion

            #region implementation
            if (numLieu != "")
            {
                this.strCommande  = "SELECT usaxe.numAxe, usaxe.nomAxe, usaxe.descriptionAxe FROM `usaxe`";
                this.strCommande += " Inner Join usassocaxelieu ON usassocaxelieu.numAxe = usaxe.numAxe";
                this.strCommande += " WHERE (usassocaxelieu.numLieu='" + numLieu + "')";
                this.strCommande += " ORDER BY usaxe.numAxe DESC";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            axe                = new crlUSAxe();
                            axe.NumAxe         = this.reader["numAxe"].ToString();
                            axe.NomAxe         = this.reader["nomAxe"].ToString();
                            axe.DescriptionAxe = this.reader["descriptionAxe"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(axe);
        }