Esempio n. 1
0
        string IntfDalUSTrajet.insertUSTrajet(crlUSTrajet trajet, string sigleAgence)
        {
            #region declaration
            string          numTrajet       = "";
            IntfDalUSTrajet serviceUSTrajet = new ImplDalUSTrajet();
            int             nbInsert        = 0;
            #endregion

            #region implemenation
            if (trajet != null && sigleAgence != "")
            {
                trajet.NumTrajet  = serviceUSTrajet.getNumUSTrajet(sigleAgence);
                this.strCommande  = "INSERT INTO `ustrajet` (`numTrajet`,`distanceTrajet`,`dureeTrajet`,`numArretD`,`numArretF`)";
                this.strCommande += " VALUES ('" + trajet.NumTrajet + "','" + trajet.DistanceTrajet + "','" + trajet.DureeTrajet + "',";
                this.strCommande += " '" + trajet.NumArretD + "','" + trajet.NumArretF + "')";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numTrajet = trajet.NumTrajet;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numTrajet);
        }
Esempio n. 2
0
        void IntfDalUSTrajet.insertToGridTrajet(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalUSTrajet serviceUSTrajet = new ImplDalUSTrajet();
            #endregion

            #region implementation

            this.strCommande  = "SELECT ustrajet.numTrajet, ustrajet.distanceTrajet, ustrajet.dureeTrajet,";
            this.strCommande += " ustrajet.numArretD, ustrajet.numArretF FROM ustrajet";
            this.strCommande += " Left Join usarret ON usarret.numArret = ustrajet.numArretD OR usarret.numArret = ustrajet.numArretF";
            this.strCommande += " Left Join uslieu ON uslieu.numLieu = usarret.numLieu";
            this.strCommande += " WHERE " + paramLike + " LIKE  '%" + valueLike + "%'";
            this.strCommande += " GROUP BY ustrajet.numTrajet";
            this.strCommande += " ORDER BY " + param;


            gridView.DataSource = serviceUSTrajet.getDataTableTrajet(this.strCommande);
            gridView.DataBind();
            #endregion
        }