Beispiel #1
0
        string IntfDalUSLigne.insertUSLigne(crlUSLigne ligne, string sigleAgence)
        {
            #region declaration
            string         numLigne       = "";
            IntfDalUSLigne serviceUSLigne = new ImplDalUSLigne();
            int            nbInsert       = 0;
            #endregion

            #region implemenation
            if (ligne != null && sigleAgence != "")
            {
                ligne.NumLigne    = serviceUSLigne.getNumUSLigne(sigleAgence);
                this.strCommande  = "INSERT INTO `usligne` (`numLigne`,`numCooperative`,`nomLigne`,`descriptionLigne`,`zone`,`numArretD`,`numArretF`,`numAxe`)";
                this.strCommande += " VALUES ('" + ligne.NumLigne + "','" + ligne.NumCooperative + "','" + ligne.NomLigne + "',";
                this.strCommande += " '" + ligne.DescriptionLigne + "','" + ligne.Zone + "','" + ligne.NumArretD + "','" + ligne.NumArretF + "','" + ligne.NumAxe + "')";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numLigne = ligne.NumLigne;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numLigne);
        }
Beispiel #2
0
        void IntfDalUSLigne.insertToGridLigne(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalUSLigne serviceUSLigne = new ImplDalUSLigne();
            #endregion

            #region implementation

            this.strCommande  = "SELECT usligne.numLigne, usligne.numCooperative, usligne.nomLigne,";
            this.strCommande += " usligne.descriptionLigne, usligne.numArretD, usligne.numArretF,";
            this.strCommande += " usligne.zone, cooperative.nomCooperative FROM usligne";
            this.strCommande += " Left Join usarret ON usarret.numArret = usligne.numArretF OR usarret.numArret = usligne.numArretD";
            this.strCommande += " Left Join uslieu ON uslieu.numLieu = usarret.numLieu";
            this.strCommande += " Inner Join cooperative ON cooperative.numCooperative = usligne.numCooperative";
            this.strCommande += " WHERE " + paramLike + " LIKE  '%" + valueLike + "%'";
            this.strCommande += " GROUP BY usligne.numLigne";
            this.strCommande += " ORDER BY " + param;


            gridView.DataSource = serviceUSLigne.getDataTableLigne(this.strCommande);
            gridView.DataBind();
            #endregion
        }