Пример #1
0
        void IntfDalDureeAbonnement.insertToGridDureeAbonnementValide(GridView gridView, string param, string paramLike, string valueLike, string numAbonnement)
        {
            #region declaration
            IntfDalDureeAbonnement serviceDureeAbonnement = new ImplDalDureeAbonnement();
            #endregion

            #region implementation

            this.strCommande  = "SELECT dureeabonnement.numDureeAbonnement, dureeabonnement.numTrajet, dureeabonnement.zone,";
            this.strCommande += " dureeabonnement.prixUnitaire, dureeabonnement.numAbonnement, dureeabonnement.valideDu,";
            this.strCommande += " dureeabonnement.valideAu, dureeabonnement.prixTotal, dureeabonnement.matriculeAgent,";
            this.strCommande += " dureeabonnement.dateDureeAbonnement, dureeabonnement.numCalculCategorieBillet,";
            this.strCommande += " dureeabonnement.numCalculReductionBillet, dureeabonnement.modePaiement FROM dureeabonnement";
            this.strCommande += " WHERE dureeabonnement.numAbonnement = '" + numAbonnement + "' AND";
            this.strCommande += " dureeabonnement.valideAu >= '" + DateTime.Now.ToString("yyyy-MM-dd") + "' AND";
            this.strCommande += " " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceDureeAbonnement.getDataTableDureeAbonnementValide(this.strCommande);
            gridView.DataBind();

            #endregion
        }
Пример #2
0
        void IntfDalDureeAbonnement.insertToGridDureeAbonnementNonRecu(GridView gridView, string param, string paramLike, string valueLike, string numAbonnement)
        {
            #region declaration
            IntfDalDureeAbonnement serviceDureeAbonnement = new ImplDalDureeAbonnement();
            #endregion

            #region implementation

            this.strCommande  = "SELECT dureeabonnement.numDureeAbonnement, dureeabonnement.numTrajet, dureeabonnement.zone,";
            this.strCommande += " dureeabonnement.prixUnitaire, dureeabonnement.numAbonnement, dureeabonnement.valideDu, dureeabonnement.valideAu,";
            this.strCommande += " dureeabonnement.prixTotal, dureeabonnement.matriculeAgent, dureeabonnement.dateDureeAbonnement FROM dureeabonnement";
            this.strCommande += " Left Join recuabonnement ON recuabonnement.numDureeAbonnement = dureeabonnement.numDureeAbonnement";
            this.strCommande += " Left Join bondecommande ON bondecommande.numDureeAbonnement = dureeabonnement.numDureeAbonnement";
            this.strCommande += " WHERE recuabonnement.numDureeAbonnement IS NULL  AND";
            this.strCommande += " bondecommande.numDureeAbonnement IS NULL  AND";
            this.strCommande += " dureeabonnement.numAbonnement = '" + numAbonnement + "' AND";
            this.strCommande += " " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceDureeAbonnement.getDataTableDureeAbonnementNonRecu(this.strCommande);
            gridView.DataBind();

            #endregion
        }
Пример #3
0
        crlRecuAbonnement IntfDalRecuAbonnement.selectRecuAbonnement(string numRecuAbonnement)
        {
            #region declaration
            crlRecuAbonnement recuAbonnement = null;

            IntfDalAgent            serviceAgent            = new ImplDalAgent();
            IntfDalCheque           serviceCheque           = new ImplDalCheque();
            IntfDalBonDeCommande    serviceBonDeCommande    = new ImplDalBonDeCommande();
            IntfDalVoyageAbonnement serviceVoyageAbonnement = new ImplDalVoyageAbonnement();
            IntfDalDureeAbonnement  serviceDureeAbonnement  = new ImplDalDureeAbonnement();
            #endregion

            #region implementation
            if (numRecuAbonnement != "")
            {
                this.strCommande = "SELECT * FROM `recuabonnement` WHERE (`numRecuAbonnement`='" + numRecuAbonnement + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            recuAbonnement = new crlRecuAbonnement();
                            try
                            {
                                recuAbonnement.DateRecuAbonnement = Convert.ToDateTime(this.reader["dateRecuAbonnement"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            recuAbonnement.MatriculeAgent = this.reader["matriculeAgent"].ToString();
                            recuAbonnement.ModePaiement   = this.reader["modePaiement"].ToString();
                            try
                            {
                                recuAbonnement.MontantRecuAbonnement = double.Parse(this.reader["montantRecuAbonnement"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            recuAbonnement.NumBonDeCommande    = this.reader["numBonDeCommande"].ToString();
                            recuAbonnement.NumCheque           = this.reader["numCheque"].ToString();
                            recuAbonnement.NumDureeAbonnement  = this.reader["numDureeAbonnement"].ToString();
                            recuAbonnement.NumRecuAbonnement   = this.reader["numRecuAbonnement"].ToString();
                            recuAbonnement.NumVoyageAbonnement = this.reader["numVoyageAbonnement"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (recuAbonnement != null)
                {
                    if (recuAbonnement.MatriculeAgent != "")
                    {
                        recuAbonnement.agent = serviceAgent.selectAgent(recuAbonnement.MatriculeAgent);
                    }
                    if (recuAbonnement.NumBonDeCommande != "")
                    {
                        recuAbonnement.bonDeCommande = serviceBonDeCommande.selectBonDeCommande(recuAbonnement.NumBonDeCommande);
                    }
                    if (recuAbonnement.NumCheque != "")
                    {
                        recuAbonnement.cheque = serviceCheque.selectCheque(recuAbonnement.NumCheque);
                    }
                    if (recuAbonnement.NumDureeAbonnement != "")
                    {
                        recuAbonnement.dureeAbonnement = serviceDureeAbonnement.selectDureeAbonnement(recuAbonnement.NumDureeAbonnement);
                    }
                    if (recuAbonnement.NumVoyageAbonnement != "")
                    {
                        recuAbonnement.voyageAbonnement = serviceVoyageAbonnement.selectVoyageAbonnement(recuAbonnement.NumVoyageAbonnement);
                    }
                }
            }
            #endregion

            return(recuAbonnement);
        }
Пример #4
0
        string IntfDalDureeAbonnement.insertDureeAbonnement(crlDureeAbonnement dureeAbonnement)
        {
            #region declaration
            string numDureeAbonnement = "";
            int    nombreInsert       = 0;
            IntfDalDureeAbonnement serviceDureeAbonnement = new ImplDalDureeAbonnement();
            string strTrajet = "";
            string numCalculCategorieBillet = "NULL";
            string numCalculReductionBillet = "NULL";
            string modePaiement             = "NULL";
            #endregion

            #region implementation
            if (dureeAbonnement != null)
            {
                if (dureeAbonnement.agent != null)
                {
                    if (dureeAbonnement.NumTrajet != "")
                    {
                        strTrajet = "'" + dureeAbonnement.NumTrajet + "'";
                    }
                    else
                    {
                        strTrajet = "NULL";
                    }
                    if (dureeAbonnement.NumCalculCategorieBillet != "")
                    {
                        numCalculCategorieBillet = "'" + dureeAbonnement.NumCalculCategorieBillet + "'";
                    }
                    if (dureeAbonnement.NumCalculReductionBillet != "")
                    {
                        numCalculReductionBillet = "'" + dureeAbonnement.NumCalculReductionBillet + "'";
                    }
                    if (dureeAbonnement.ModePaiement != "")
                    {
                        modePaiement = "'" + dureeAbonnement.ModePaiement + "'";
                    }

                    dureeAbonnement.NumDureeAbonnement = serviceDureeAbonnement.getNumDureeAbonnement(dureeAbonnement.agent.agence.SigleAgence);
                    this.strCommande  = "INSERT INTO `dureeabonnement` (`numDureeAbonnement`,`numTrajet`,`zone`,`prixUnitaire`,";
                    this.strCommande += " `numAbonnement`,`valideDu`,`valideAu`,`prixTotal`,`matriculeAgent`,`dateDureeAbonnement`,";
                    this.strCommande += " `numCalculCategorieBillet`,`numCalculReductionBillet`,`modePaiement`)";
                    this.strCommande += " VALUES ('" + dureeAbonnement.NumDureeAbonnement + "'," + strTrajet + ",";
                    this.strCommande += " '" + dureeAbonnement.Zone + "','" + dureeAbonnement.PrixUnitaire + "',";
                    this.strCommande += " '" + dureeAbonnement.NumAbonnement + "','" + dureeAbonnement.ValideDu.ToString("yyyy-MM-dd") + "',";
                    this.strCommande += " '" + dureeAbonnement.ValideAu.ToString("yyyy-MM-dd") + "','" + dureeAbonnement.PrixTotal + "',";
                    this.strCommande += " '" + dureeAbonnement.MatriculeAgent + "','" + dureeAbonnement.DateDureeAbonnement.ToString("yyyy-MM-dd") + "',";
                    this.strCommande += " " + numCalculCategorieBillet + "," + numCalculReductionBillet + "," + modePaiement + ")";

                    this.serviceConnectBase.openConnection();
                    nombreInsert = this.serviceConnectBase.requete(this.strCommande);
                    if (nombreInsert == 1)
                    {
                        numDureeAbonnement = dureeAbonnement.NumDureeAbonnement;
                    }
                    this.serviceConnectBase.closeConnection();
                }
            }
            #endregion

            return(numDureeAbonnement);
        }