Example #1
0
        void IntfDalBillet.insertToGridBilletInsertToFB(GridView gridView, string param, string paramLike, string valueLike, string numVille)
        {
            #region declaration
            IntfDalBillet serviceBillet = new ImplDalBillet();
            #endregion

            #region implementation

            this.strCommande  = "SELECT individu.nomIndividu, individu.prenomIndividu, individu.cinIndividu, individu.numIndividu,";
            this.strCommande += " individu.civiliteIndividu, individu.adresse, individu.profession, individu.telephoneFixeIndividu,";
            this.strCommande += " individu.telephoneMobileIndividu, individu.dateNaissanceIndividu,  individu.lieuNaissanceIndividu,";
            this.strCommande += " individu.mailIndividu, individu.numQuartier, individu.isCheque, individu.isBonCommande,";
            this.strCommande += " trajet.numVilleD, trajet.numVilleF FROM billet";
            this.strCommande += " Inner Join individu ON individu.numIndividu = billet.numIndividu";
            this.strCommande += " Inner Join trajet ON trajet.numTrajet = billet.numTrajet";
            this.strCommande += " Left Join voyage ON voyage.numBillet = billet.numBillet";
            this.strCommande += " WHERE (trajet.numVilleD =  '" + numVille + "' OR trajet.numVilleF =  '" + numVille + "')";
            this.strCommande += " AND billet.dateDeValidite >=  '" + DateTime.Now.ToString("yyyy-MM-dd") + "' AND";
            this.strCommande += " voyage.idVoyage IS NULL   AND " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceBillet.getDataTableBilletInsertToFB(this.strCommande);
            gridView.DataBind();

            #endregion
        }
Example #2
0
        crlVoyage IntfDalVoyage.selectVoyage(string idVoyage)
        {
            #region declaration
            crlVoyage       Voyage          = null;
            IntfDalBagage   serviceBagage   = new ImplDalBagage();
            IntfDalIndividu serviceIndividu = new ImplDalIndividu();
            IntfDalBillet   serviceBillet   = new ImplDalBillet();
            IntfDalPlaceFB  servicePlaceFB  = new ImplDalPlaceFB();
            #endregion

            #region implementation
            if (idVoyage != "")
            {
                this.strCommande = "SELECT * FROM `voyage` WHERE (`idVoyage`='" + idVoyage + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            Voyage             = new crlVoyage();
                            Voyage.IdVoyage    = reader["idVoyage"].ToString();
                            Voyage.NumIndividu = reader["numIndividu"].ToString();
                            Voyage.NumerosFB   = reader["numerosFB"].ToString();
                            try
                            {
                                Voyage.PoidBagage = double.Parse(reader["poidBagage"].ToString());
                            }
                            catch (Exception)
                            {}
                            Voyage.Destination   = reader["destination"].ToString();
                            Voyage.NumBillet     = reader["numBillet"].ToString();
                            Voyage.NumPlace      = reader["numPlace"].ToString();
                            Voyage.PieceIdentite = reader["pieceIdentite"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (Voyage != null)
                {
                    Voyage.billet   = serviceBillet.selectBillet(Voyage.NumBillet);
                    Voyage.individu = serviceIndividu.selectIndividu(Voyage.NumIndividu);
                    Voyage.placeFB  = servicePlaceFB.selectPlaceFB(Voyage.NumerosFB, Voyage.NumPlace);
                    Voyage.bagage   = serviceBagage.selectBagageForVoyage(Voyage.IdVoyage);
                }
            }
            #endregion

            return(Voyage);
        }
Example #3
0
        void IntfDalBillet.insertToGridBilletAbonnement(GridView gridView, string param, string paramLike, string valueLike, string numAbonnement)
        {
            #region declaration
            IntfDalBillet serviceBillet = new ImplDalBillet();
            #endregion

            #region implementation

            this.strCommande  = "SELECT billet.numBillet, billet.dateDeValidite, billet.numTrajet, billet.modePaiement,";
            this.strCommande += " billet.numIndividu, billet.matriculeAgent, billet.prixBillet, billet.numCalculCategorieBillet,";
            this.strCommande += " billet.dateBillet, trajet.numVilleD,trajet.numVilleF FROM billet";
            this.strCommande += " Inner Join assoabonnementbillet ON assoabonnementbillet.numBillet = billet.numBillet";
            this.strCommande += " Inner Join trajet ON trajet.numTrajet = billet.numTrajet";
            this.strCommande += " WHERE assoabonnementbillet.numAbonnement = '" + numAbonnement + "' AND";
            this.strCommande += " billet.dateDeValidite >= '" + DateTime.Now.ToString("yyyy-MM-dd") + "' AND";
            this.strCommande += " " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceBillet.getDataTableBilletAbonnement(this.strCommande);
            gridView.DataBind();

            #endregion
        }
Example #4
0
        void IntfDalBillet.insertToGridBilletEncaisse(GridView gridView, string param, string paramLike, string valueLike, string matriculeAgent, DateTime dateDebut, DateTime dateFin)
        {
            #region declaration
            IntfDalBillet serviceBillet = new ImplDalBillet();
            #endregion

            #region implementation

            this.strCommande  = "SELECT billet.numBillet, billet.dateDeValidite, billet.numTrajet, billet.modePaiement,";
            this.strCommande += " billet.numIndividu, billet.matriculeAgent, billet.prixBillet, billet.numCalculCategorieBillet,";
            this.strCommande += " billet.dateBillet FROM billet";
            this.strCommande += " WHERE billet.matriculeAgent = '" + matriculeAgent + "' AND";
            this.strCommande += " billet.dateBillet <= '" + dateFin.ToString("yyyy-MM-dd") + "' AND";
            this.strCommande += " billet.dateBillet >= '" + dateDebut.ToString("yyyy-MM-dd") + "' AND";
            this.strCommande += " " + paramLike + " LIKE '%" + valueLike + "%' AND";
            this.strCommande += " billet.modePaiement = 'Espèce'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceBillet.getDataTableBilletEncaisse(this.strCommande);
            gridView.DataBind();

            #endregion
        }
Example #5
0
        void IntfDalBillet.insertToGridBillet(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalBillet serviceBillet = new ImplDalBillet();
            #endregion

            #region implementation

            this.strCommande  = "SELECT billet.numBillet, billet.dateDeValidite, billet.numTrajet, billet.modePaiement,";
            this.strCommande += " billet.numIndividu, trajet.numTrajet, billet.prixBillet, trajet.distanceTrajet,";
            this.strCommande += " trajet.dureeTrajet, trajet.numVilleD, trajet.numVilleF,";
            this.strCommande += " individu.nomIndividu, individu.prenomIndividu, individu.cinIndividu FROM billet";
            this.strCommande += " Inner Join trajet ON trajet.numTrajet = billet.numTrajet";
            this.strCommande += " Left Join voyage ON voyage.numBillet = billet.numBillet";
            this.strCommande += " Left Join individu ON individu.numIndividu = billet.numIndividu";
            this.strCommande += " WHERE voyage.numBillet IS NULL  AND " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param + " DESC";

            gridView.DataSource = serviceBillet.getDataTableBillet(this.strCommande);
            gridView.DataBind();

            #endregion
        }
Example #6
0
        List <crlVoyage> IntfDalFicheBord.getVoyage(string numerosFB)
        {
            #region declaration
            List <crlVoyage> Voyages    = new List <crlVoyage>();
            crlVoyage        tempVoyage = null;

            IntfDalBagage   serviceBagage   = new ImplDalBagage();
            IntfDalIndividu serviceIndividu = new ImplDalIndividu();
            IntfDalBillet   serviceBillet   = new ImplDalBillet();
            IntfDalPlaceFB  servicePlaceFB  = new ImplDalPlaceFB();
            #endregion

            #region implementation
            if (numerosFB != "")
            {
                this.strCommande = "SELECT * FROM `voyage` WHERE (`numerosFB`='" + numerosFB + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        while (this.reader.Read())
                        {
                            tempVoyage             = new crlVoyage();
                            tempVoyage.IdVoyage    = reader["idVoyage"].ToString();
                            tempVoyage.NumIndividu = reader["numIndividu"].ToString();
                            tempVoyage.NumerosFB   = reader["numerosFB"].ToString();
                            try
                            {
                                tempVoyage.PoidBagage = double.Parse(reader["poidBagage"].ToString());
                            }
                            catch (Exception)
                            {}
                            tempVoyage.Destination   = reader["destination"].ToString();
                            tempVoyage.NumBillet     = reader["numBillet"].ToString();
                            tempVoyage.NumPlace      = reader["numPlace"].ToString();
                            tempVoyage.PieceIdentite = reader["pieceIdentite"].ToString();

                            Voyages.Add(tempVoyage);
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                for (int i = 0; i < Voyages.Count; i++)
                {
                    if (Voyages[i] != null)
                    {
                        Voyages[i].billet   = serviceBillet.selectBillet(Voyages[i].NumBillet);
                        Voyages[i].individu = serviceIndividu.selectIndividu(Voyages[i].NumIndividu);
                        Voyages[i].placeFB  = servicePlaceFB.selectPlaceFB(Voyages[i].NumerosFB, Voyages[i].NumPlace);
                        Voyages[i].bagage   = serviceBagage.selectBagageForVoyage(Voyages[i].IdVoyage);
                    }
                }
            }
            #endregion

            return(Voyages);
        }
Example #7
0
        string IntfDalBillet.insertBillet(crlBillet Billet)
        {
            #region declaration
            string        numBillet                = "";
            int           nombreInsert             = 0;
            IntfDalBillet serviceBillet            = new ImplDalBillet();
            string        modePaiement             = "";
            string        numIndividu              = "";
            string        numCalculCategorieBillet = "";
            string        numCalculReductionBillet = "";
            string        numTrajet                = "NULL";
            string        numDureeAbonnement       = "NULL";
            string        numVoyageAbonnement      = "NULL";
            string        numBilletCommande        = "NULL";
            #endregion

            #region implementation
            if (Billet != null)
            {
                if (Billet.ModePaiement != "")
                {
                    modePaiement = "'" + Billet.ModePaiement + "'";
                }
                else
                {
                    modePaiement = "NULL";
                }
                if (Billet.NumIndividu != "")
                {
                    numIndividu = "'" + Billet.NumIndividu + "'";
                }
                else
                {
                    numIndividu = "NULL";
                }
                if (Billet.NumCalculCategorieBillet != "")
                {
                    numCalculCategorieBillet = "'" + Billet.NumCalculCategorieBillet + "'";
                }
                else
                {
                    numCalculCategorieBillet = "NULL";
                }
                if (Billet.NumCalculReductionBillet != "")
                {
                    numCalculReductionBillet = "'" + Billet.NumCalculReductionBillet + "'";
                }
                else
                {
                    numCalculReductionBillet = "NULL";
                }
                if (Billet.NumTrajet != "")
                {
                    numTrajet = "'" + Billet.NumTrajet + "'";
                }
                if (Billet.NumDureeAbonnement != "")
                {
                    numDureeAbonnement = "'" + Billet.NumDureeAbonnement + "'";
                }
                if (Billet.NumVoyageAbonnement != "")
                {
                    numVoyageAbonnement = "'" + Billet.NumVoyageAbonnement + "'";
                }
                if (Billet.NumBilletCommande != "")
                {
                    numBilletCommande = "'" + Billet.NumBilletCommande + "'";
                }

                Billet.NumBillet = serviceBillet.getNumBillet(Billet.agent.agence.SigleAgence);



                this.strCommande  = "INSERT INTO `billet` (`numBillet`,`dateDeValidite`,`numTrajet`,`modePaiement`,`numIndividu`,`matriculeAgent`,";
                this.strCommande += " `prixBillet`,`numCalculCategorieBillet`,`numCalculReductionBillet`,`dateBillet`,`numDureeAbonnement`,";
                this.strCommande += " `numVoyageAbonnement`,`numBilletCommande`)";
                this.strCommande += " VALUES ('" + Billet.NumBillet + "','" + Billet.DateDeValidite.ToString("yyyy-MM-dd") + "',";
                this.strCommande += " " + numTrajet + "," + modePaiement + "," + numIndividu + ",";
                this.strCommande += " '" + Billet.MatriculeAgent + "','" + Billet.PrixBillet + "'," + numCalculCategorieBillet + ",";
                this.strCommande += " " + numCalculReductionBillet + ",'" + Billet.DateBillet.ToString("yyyy-MM-dd") + "',";
                this.strCommande += " " + numDureeAbonnement + "," + numVoyageAbonnement + "," + numBilletCommande + ")";

                this.serviceConnectBase.openConnection();
                nombreInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nombreInsert == 1)
                {
                    numBillet = Billet.NumBillet;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numBillet);
        }