Exemplo n.º 1
0
        void IntfDalUSVoyage.insertToGridUSVoyageNonArrive(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalUSVoyage serviceUSVoyage = new ImplDalUSVoyage();
            #endregion

            #region implementation

            this.strCommande  = "SELECT usvoyage.dateHeureDepart, usligne.nomLigne,";
            this.strCommande += " vehicule.marqueVehicule, vehicule.matriculeVehicule,";
            this.strCommande += " vehicule.couleurVehicule, usvoyage.matriculeAgentDepart,";
            this.strCommande += " usvoyage.matriculeAgentChauffeur, usvoyage.matriculeAgentReceveur,";
            this.strCommande += " usvoyage.matriculeAgentControleur, usvoyage.numVoyage";
            this.strCommande += " FROM usvoyage";
            this.strCommande += " Inner Join usligne ON usligne.numLigne = usvoyage.numLigne";
            this.strCommande += " Inner Join licence ON licence.numLicence = usvoyage.numLicence";
            this.strCommande += " Inner Join vehicule ON vehicule.numVehicule = licence.numVehicule";
            this.strCommande += " Left Join agent ON agent.matriculeAgent = usvoyage.matriculeAgentChauffeur";
            this.strCommande += " OR agent.matriculeAgent = usvoyage.matriculeAgentReceveur";
            this.strCommande += " OR agent.matriculeAgent = usvoyage.matriculeAgentControleur";
            this.strCommande += " WHERE " + paramLike + " LIKE  '%" + valueLike + "%' AND";
            this.strCommande += " usvoyage.matriculeAgentArrive IS NULL";
            this.strCommande += " GROUP BY usvoyage.numVoyage";
            this.strCommande += " ORDER BY " + param;


            gridView.DataSource = serviceUSVoyage.getDataTableUSVoyageNonArrive(this.strCommande);
            gridView.DataBind();
            #endregion
        }
Exemplo n.º 2
0
        string IntfDalUSVoyage.insertUSVoyage(crlUSVoyage voyage, string sigleAgence)
        {
            #region declaration
            string          numVoyage                = "";
            IntfDalUSVoyage serviceUSVoyage          = new ImplDalUSVoyage();
            string          matriculeAgentArrive     = "NULL";
            string          matriculeAgentControleur = "NULL";
            string          numFacture               = "NULL";
            string          numAppareil              = "NULL";
            int             nbInsert = 0;
            #endregion

            #region implementation
            if (voyage != null)
            {
                if (voyage.MatriculeAgentArrive != "")
                {
                    matriculeAgentArrive = "'" + voyage.MatriculeAgentArrive + "'";
                }
                if (voyage.MatriculeAgentControleur != "")
                {
                    matriculeAgentControleur = "'" + voyage.MatriculeAgentControleur + "'";
                }
                if (voyage.NumFacture != "")
                {
                    numFacture = "'" + voyage.NumFacture + "'";
                }
                if (voyage.NumAppareil != "")
                {
                    numAppareil = "'" + voyage.NumAppareil + "'";
                }
                voyage.NumVoyage = serviceUSVoyage.getNumUSVoyage(sigleAgence);

                this.strCommande  = "INSERT INTO `usvoyage` (`numVoyage`,`dateHeureDepart`,`dateHeureArrive`,";
                this.strCommande += " `numLicence`,`matriculeAgentDepart`,`matriculeAgentArrive`,`matriculeAgentChauffeur`,";
                this.strCommande += " `matriculeAgentReceveur`,`matriculeAgentControleur`,`numLigne`,`numFacture`,`numAppareil`)";
                this.strCommande += " VALUES ('" + voyage.NumVoyage + "','" + voyage.DateHeureDepart.ToString("yyyy-MM-dd HH:mm:ss") + "',";
                this.strCommande += " '" + voyage.DateHeureArrive.ToString("yyyy-MM-dd HH:mm:ss") + "','" + voyage.NumLicence + "',";
                this.strCommande += " '" + voyage.MatriculeAgentDepart + "'," + matriculeAgentArrive + ",";
                this.strCommande += " '" + voyage.MatriculeAgentChauffeur + "','" + voyage.MatriculeAgentReceveur + "',";
                this.strCommande += " " + matriculeAgentControleur + ",'" + voyage.NumLigne + "'," + numFacture + "," + numAppareil + ")";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numVoyage = voyage.NumVoyage;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numVoyage);
        }