Пример #1
0
        string IntfDalUSZone.insertUSZone(crlUSZone zone, string sigleAgence)
        {
            #region declaration
            string        numZone       = "";
            IntfDalUSZone serviceUSZone = new ImplDalUSZone();
            int           nbInsert      = 0;
            #endregion

            #region implemenation
            if (zone != null && sigleAgence != "")
            {
                zone.NumZone      = serviceUSZone.getNumUSZone(sigleAgence);
                this.strCommande  = "INSERT INTO `uszone` (`numZone`,`nomZone`,`niveau`,`numCommune`)";
                this.strCommande += " VALUES ('" + zone.NumZone + "','" + zone.NomZone + "',";
                this.strCommande += " '" + zone.Niveau.ToString("0") + "','" + zone.NumCommune + "')";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numZone = zone.NumZone;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numZone);
        }
Пример #2
0
        int IntfDalUSPrixBase.getNiveauPrixBase(string numLieuD, string numLieuF)
        {
            #region declaration
            int       niveau = -1;
            crlUSLieu lieuD  = null;
            crlUSLieu lieuF  = null;
            crlUSZone zoneD  = null;
            crlUSZone zoneF  = null;

            IntfDalUSLieu     serviceUSLieu     = new ImplDalUSLieu();
            IntfDalUSZone     serviceUSZone     = new ImplDalUSZone();
            IntfDalUSPrixBase serviceUSPrixBase = new ImplDalUSPrixBase();
            #endregion

            #region implementation
            if (numLieuD != "" && numLieuF != "")
            {
                lieuD = serviceUSLieu.selectUSLieu(numLieuD);
                lieuF = serviceUSLieu.selectUSLieu(numLieuF);

                if (lieuD != null && lieuF != null)
                {
                    zoneD = serviceUSZone.selectUSZone(lieuD.NumZone);
                    zoneF = serviceUSZone.selectUSZone(lieuF.NumZone);

                    if (zoneD != null && zoneF != null)
                    {
                        if (zoneD.Niveau == 1 && zoneD.Niveau == zoneF.Niveau)
                        {
                            niveau = 1;
                        }
                        else
                        {
                            if (zoneD.Niveau == 1)
                            {
                                niveau = zoneF.Niveau;
                            }
                            else if (zoneF.Niveau == 1)
                            {
                                niveau = zoneD.Niveau;
                            }
                            else
                            {
                                if (serviceUSPrixBase.isMemeAxe(numLieuD, numLieuF))
                                {
                                    niveau = Math.Abs(zoneD.Niveau - zoneF.Niveau) + 1;
                                }
                                else
                                {
                                    niveau = zoneD.Niveau + zoneF.Niveau;
                                }
                            }
                        }
                    }
                }
            }
            #endregion

            return(niveau);
        }
Пример #3
0
        int IntfDalUSPrixBase.getNiveauPrixBase(string numZoneD, string numZoneF, bool isMemeAxe)
        {
            #region declaration
            int           niveau        = -1;
            crlUSZone     zoneD         = null;
            crlUSZone     zoneF         = null;
            IntfDalUSZone serviceUSZone = new ImplDalUSZone();
            #endregion

            #region implementation
            zoneD = serviceUSZone.selectUSZone(numZoneD);
            zoneF = serviceUSZone.selectUSZone(numZoneF);

            if (zoneD != null && zoneF != null)
            {
                if (zoneD.Niveau == 1 && zoneF.Niveau == 1)
                {
                    niveau = 1;
                }
                else
                {
                    if (zoneD.Niveau == 1 || zoneF.Niveau == 1)
                    {
                        if (zoneD.Niveau == 1)
                        {
                            niveau = zoneF.Niveau;
                        }
                        else
                        {
                            niveau = zoneD.Niveau;
                        }
                    }
                    else
                    {
                        if (isMemeAxe)
                        {
                            niveau = Math.Abs(zoneD.Niveau - zoneF.Niveau) + 1;
                        }
                        else
                        {
                            niveau = zoneF.Niveau + zoneD.Niveau;
                        }
                    }
                }
            }
            #endregion

            return(niveau);
        }
Пример #4
0
        void IntfDalUSAbonnementNV.loadDdlAbonnementNVNonCarte(DropDownList ddl, string numAbonnement)
        {
            #region declaration
            crlUSZone     zoneD         = null;
            crlUSZone     zoneF         = null;
            IntfDalUSZone serviceUSZone = new ImplDalUSZone();
            #endregion

            #region implementation
            if (ddl != null)
            {
                ddl.Items.Clear();
                ddl.Items.Add("");

                this.strCommande  = "SELECT usabonnementnv.numZoneD, usabonnementnv.numZoneF,";
                this.strCommande += " usabonnementnv.numAbonnementNV FROM usabonnementnv";
                this.strCommande += " Left Join uscarte ON uscarte.numAbonnementNV = usabonnementnv.numAbonnementNV";
                this.strCommande += " WHERE usabonnementnv.numAbonnement = '" + numAbonnement + "' AND";
                this.strCommande += " uscarte.numAbonnementNV IS NULL";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        while (this.reader.Read())
                        {
                            zoneD = serviceUSZone.selectUSZone(this.reader["numZoneD"].ToString());
                            zoneF = serviceUSZone.selectUSZone(this.reader["numZoneF"].ToString());

                            if (zoneD != null && zoneF != null)
                            {
                                ddl.Items.Add(new ListItem(zoneD.NomZone + "-" + zoneF.NomZone, this.reader["numAbonnementNV"].ToString()));
                            }
                            else
                            {
                                ddl.Items.Add(new ListItem(this.reader["numZoneD"].ToString() + "-" + this.reader["numZoneF"].ToString(), this.reader["numAbonnementNV"].ToString()));
                            }
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion
        }
Пример #5
0
        string IntfDalUSLieu.isUSLieu(crlUSLieu lieu)
        {
            #region declaration
            string        numLieu       = "";
            string        numCommune    = "";
            IntfDalUSZone serviceUSZone = new ImplDalUSZone();
            #endregion

            #region implementation
            if (lieu != null)
            {
                numCommune = serviceUSZone.getNumCommune(lieu.NumZone);

                this.strCommande  = "SELECT * FROM `uslieu`";
                this.strCommande += " Inner Join uszone ON uszone.numZone = uslieu.numZone WHERE";
                this.strCommande += " uszone.numCommune = '" + numCommune + "' AND";
                this.strCommande += " `numQuartier`='" + lieu.NumQuartier + "' AND";
                this.strCommande += " `numLieu`<>'" + lieu.NumLieu + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            numLieu = this.reader["numLieu"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numLieu);
        }
Пример #6
0
        crlUSBillet IntfDalUSBillet.selectUSBillet(string numBillet)
        {
            #region declaration
            crlUSBillet   billet        = null;
            IntfDalUSZone serviceUSZone = new ImplDalUSZone();
            #endregion

            #region implementation
            if (numBillet != "")
            {
                this.strCommande = "SELECT * FROM `usbillet` WHERE `numBillet`='" + numBillet + "'";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            billet = new crlUSBillet();
                            try
                            {
                                billet.DateBillet = Convert.ToDateTime(this.reader["dateBillet"].ToString());
                            }
                            catch (Exception) { }
                            billet.MatriculeAgent = this.reader["matriculeAgent"].ToString();
                            billet.ModeDePaiement = this.reader["modeDePaiement"].ToString();
                            try
                            {
                                billet.Montant = double.Parse(this.reader["montant"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                billet.Niveau = int.Parse(this.reader["niveau"].ToString());
                            }
                            catch (Exception) { }
                            billet.NumCarteReduction = this.reader["numCarteReduction"].ToString();
                            billet.NumAbonnementNV   = this.reader["numAbonnementNV"].ToString();
                            billet.NumBillet         = this.reader["numBillet"].ToString();
                            billet.NumLieuD          = this.reader["numLieuD"].ToString();
                            billet.NumLieuF          = this.reader["numLieuF"].ToString();
                            billet.NumZoneD          = this.reader["numZoneD"].ToString();
                            billet.NumZoneF          = this.reader["numZoneF"].ToString();
                            try
                            {
                                billet.ValideAu = Convert.ToDateTime(this.reader["valideAu"].ToString());
                            }
                            catch (Exception) { }
                            billet.NumCategorieBillet = this.reader["numCategorieBillet"].ToString();
                            billet.NumReductionBillet = this.reader["numReductionBillet"].ToString();
                            billet.NumTicket          = this.reader["numTicket"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (billet != null)
                {
                    if (billet.NumZoneD != "")
                    {
                        billet.zoneD = serviceUSZone.selectUSZone(billet.NumZoneD);
                    }
                    if (billet.NumZoneF != "")
                    {
                        billet.zoneF = serviceUSZone.selectUSZone(billet.NumZoneF);
                    }
                }
            }
            #endregion

            return(billet);
        }
Пример #7
0
        DataTable IntfDalUSAbonnementNVDevis.getDataTableAbonnementNVDevisProforma(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalUSZone  serviceUSZone  = new ImplDalUSZone();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            crlUSZone      zoneD          = null;
            crlUSZone      zoneF          = null;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numAbonnementNVDevis", typeof(string));
            dataTable.Columns.Add("Zone", typeof(string));
            dataTable.Columns.Add("prixUnitaireNV", typeof(string));
            dataTable.Columns.Add("nombreVoyage", typeof(string));
            dataTable.Columns.Add("montantNV", typeof(string));
            dataTable.Columns.Add("montantCarte", typeof(string));
            DataRow dr;
            #endregion

            this.serviceConnectBase.openConnection();
            this.reader = this.serviceConnectBase.select(strRqst);
            if (this.reader != null)
            {
                if (this.reader.HasRows)
                {
                    while (this.reader.Read())
                    {
                        dr = dataTable.NewRow();

                        dr["numAbonnementNVDevis"] = reader["numAbonnementNVDevis"].ToString();

                        zoneD = serviceUSZone.selectUSZone(this.reader["numZoneD"].ToString());
                        zoneF = serviceUSZone.selectUSZone(this.reader["numZoneF"].ToString());

                        if (zoneD != null && zoneF != null)
                        {
                            dr["Zone"] = zoneD.NomZone + "-" + zoneF.NomZone;
                        }
                        else
                        {
                            dr["Zone"] = this.reader["numZoneD"].ToString() + "-" + this.reader["numZoneF"].ToString();
                        }

                        dr["prixUnitaireNV"] = serviceGeneral.separateurDesMilles(reader["prixUnitaireNV"].ToString()) + " Ar";
                        dr["nombreVoyage"]   = reader["nombrePasse"].ToString();
                        dr["montantNV"]      = serviceGeneral.separateurDesMilles(reader["montantNV"].ToString()) + " Ar";
                        dr["montantCarte"]   = serviceGeneral.separateurDesMilles(reader["montantCarte"].ToString()) + " Ar";

                        dataTable.Rows.Add(dr);
                    }
                }
                this.reader.Dispose();
            }
            this.serviceConnectBase.closeConnection();

            #endregion

            return(dataTable);
        }
Пример #8
0
        crlUSAbonnementNVDevis IntfDalUSAbonnementNVDevis.selectUSAbonnementNVDevis(string numAbonnementNVDevis)
        {
            #region declaration
            crlUSAbonnementNVDevis abonnementNVDevis  = null;
            IntfDalUSInfoPasse     serviceUSInfoPasse = new ImplDalUSInfoPasse();
            IntfDalUSZone          serviceUSZone      = new ImplDalUSZone();
            #endregion

            #region implementation
            if (numAbonnementNVDevis != "")
            {
                this.strCommande = "SELECT * FROM `usabonnementnvdevis` WHERE `numAbonnementNVDevis`='" + numAbonnementNVDevis + "'";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            abonnementNVDevis = new crlUSAbonnementNVDevis();

                            abonnementNVDevis.NumProforma = this.reader["numProforma"].ToString();
                            try
                            {
                                abonnementNVDevis.MontantNV = double.Parse(this.reader["montantNV"].ToString());
                            }
                            catch (Exception) { }

                            try
                            {
                                abonnementNVDevis.PrixUnitaireNV = double.Parse(this.reader["prixUnitaireNV"].ToString());
                            }
                            catch (Exception) { }
                            abonnementNVDevis.NumAbonnement        = this.reader["numAbonnement"].ToString();
                            abonnementNVDevis.NumAbonnementNVDevis = this.reader["numAbonnementNVDevis"].ToString();
                            abonnementNVDevis.NumCategorieBillet   = this.reader["numCategorieBillet"].ToString();
                            abonnementNVDevis.NumReductionBillet   = this.reader["numReductionBillet"].ToString();
                            abonnementNVDevis.NumZoneD             = this.reader["numZoneD"].ToString();
                            abonnementNVDevis.NumZoneF             = this.reader["numZoneF"].ToString();
                            abonnementNVDevis.NumInfoPasse         = this.reader["numInfoPasse"].ToString();
                            abonnementNVDevis.NumCarte             = this.reader["numCarte"].ToString();
                            try
                            {
                                abonnementNVDevis.MontantCarte = double.Parse(this.reader["montantCarte"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                abonnementNVDevis.DateAbonnementNVDevis = Convert.ToDateTime(this.reader["dateAbonnementNVDevis"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            abonnementNVDevis.NumAbonnementNV = this.reader["numAbonnementNV"].ToString();
                            try
                            {
                                abonnementNVDevis.NombreVoyage = int.Parse(this.reader["nombreVoyage"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (abonnementNVDevis != null)
                {
                    if (abonnementNVDevis.NumInfoPasse != "")
                    {
                        abonnementNVDevis.infoPasse = serviceUSInfoPasse.selectUSInfoPasse(abonnementNVDevis.NumInfoPasse);
                    }
                    if (abonnementNVDevis.NumZoneD != "")
                    {
                        abonnementNVDevis.zoneD = serviceUSZone.selectUSZone(abonnementNVDevis.NumZoneD);
                    }
                    if (abonnementNVDevis.NumZoneF != "")
                    {
                        abonnementNVDevis.zoneF = serviceUSZone.selectUSZone(abonnementNVDevis.NumZoneF);
                    }
                }
            }
            #endregion

            return(abonnementNVDevis);
        }
Пример #9
0
        DataTable IntfDalUSAbonnementNV.getDataTableAbonnementNV(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalUSZone serviceUSZone = new ImplDalUSZone();
            crlUSZone     zoneD         = null;
            crlUSZone     zoneF         = null;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numAbonnementNV", typeof(string));
            dataTable.Columns.Add("dateValideAu", typeof(DateTime));
            dataTable.Columns.Add("nombreVoyage", typeof(string));
            dataTable.Columns.Add("zone", typeof(string));
            dataTable.Columns.Add("numCarte", typeof(string));

            DataRow dr;
            #endregion

            this.serviceConnectBase.openConnection();
            this.reader = this.serviceConnectBase.select(strRqst);
            if (this.reader != null)
            {
                if (this.reader.HasRows)
                {
                    while (this.reader.Read())
                    {
                        dr = dataTable.NewRow();

                        dr["numAbonnementNV"] = reader["numAbonnementNV"].ToString();
                        dr["dateValideAu"]    = Convert.ToDateTime(reader["dateValideAu"].ToString());
                        dr["nombreVoyage"]    = reader["nbVoyage"].ToString();

                        zoneD = serviceUSZone.selectUSZone(reader["numZoneD"].ToString());
                        zoneF = serviceUSZone.selectUSZone(reader["numZoneF"].ToString());

                        if (zoneD != null && zoneF != null)
                        {
                            dr["zone"] = zoneD.NomZone + "-" + zoneF.NomZone;
                        }
                        else
                        {
                            dr["zone"] = reader["numZoneD"].ToString() + "-" + reader["numZoneF"].ToString();
                        }

                        dr["numCarte"] = reader["numCarte"].ToString();


                        dataTable.Rows.Add(dr);
                    }
                }
                this.reader.Dispose();
            }
            this.serviceConnectBase.closeConnection();

            #endregion

            return(dataTable);
        }
Пример #10
0
        List <crlUSAbonnementNVDevis> IntfDalUSAbonnementNV.getAbonnementNVDevisValide(string numAbonnementNV)
        {
            #region declaration
            List <crlUSAbonnementNVDevis> abonnementNVDevisValide = null;
            crlUSAbonnementNVDevis        abonnementNVDevisTemp   = null;
            IntfDalUSZone      serviceUSZone      = new ImplDalUSZone();
            IntfDalUSInfoPasse serviceUSInfoPasse = new ImplDalUSInfoPasse();
            #endregion

            #region implementation
            if (numAbonnementNV != "")
            {
                this.strCommande  = "SELECT usabonnementnvdevis.numAbonnementNVDevis, usabonnementnvdevis.numAbonnement,";
                this.strCommande += " usabonnementnvdevis.prixUnitaireNV, usabonnementnvdevis.montantNV,";
                this.strCommande += " usabonnementnvdevis.numZoneD, usabonnementnvdevis.numZoneF,";
                this.strCommande += " usabonnementnvdevis.numReductionBillet, usabonnementnvdevis.numCategorieBillet,";
                this.strCommande += " usabonnementnvdevis.numProforma, usabonnementnvdevis.numInfoPasse,";
                this.strCommande += " usabonnementnvdevis.numCarte, usabonnementnvdevis.montantCarte,";
                this.strCommande += " usabonnementnvdevis.dateAbonnementNVDevis, usabonnementnvdevis.numAbonnementNV,";
                this.strCommande += " usabonnementnvdevis.nombreVoyage FROM usabonnementnvdevis";
                this.strCommande += " WHERE usabonnementnvdevis.numAbonnementNV = '" + numAbonnementNV + "' AND";
                this.strCommande += " usabonnementnvdevis.nombreVoyage > '0'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        abonnementNVDevisValide = new List <crlUSAbonnementNVDevis>();
                        while (this.reader.Read())
                        {
                            abonnementNVDevisTemp = new crlUSAbonnementNVDevis();
                            try
                            {
                                abonnementNVDevisTemp.DateAbonnementNVDevis = Convert.ToDateTime(this.reader["dateAbonnementNVDevis"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                abonnementNVDevisTemp.MontantCarte = double.Parse(this.reader["montantCarte"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                abonnementNVDevisTemp.MontantNV = double.Parse(this.reader["montantNV"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                abonnementNVDevisTemp.NombreVoyage = int.Parse(this.reader["nombreVoyage"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            abonnementNVDevisTemp.NumAbonnement        = this.reader["numAbonnement"].ToString();
                            abonnementNVDevisTemp.NumAbonnementNV      = this.reader["numAbonnementNV"].ToString();
                            abonnementNVDevisTemp.NumAbonnementNVDevis = this.reader["numAbonnementNVDevis"].ToString();
                            abonnementNVDevisTemp.NumCarte             = this.reader["numCarte"].ToString();
                            abonnementNVDevisTemp.NumCategorieBillet   = this.reader["numCategorieBillet"].ToString();
                            abonnementNVDevisTemp.NumInfoPasse         = this.reader["numInfoPasse"].ToString();
                            abonnementNVDevisTemp.NumProforma          = this.reader["numProforma"].ToString();
                            abonnementNVDevisTemp.NumReductionBillet   = this.reader["numReductionBillet"].ToString();
                            abonnementNVDevisTemp.NumZoneD             = this.reader["numZoneD"].ToString();
                            abonnementNVDevisTemp.NumZoneF             = this.reader["numZoneF"].ToString();
                            try
                            {
                                abonnementNVDevisTemp.PrixUnitaireNV = double.Parse(this.reader["prixUnitaireNV"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            if (abonnementNVDevisTemp.NumInfoPasse != "")
                            {
                                abonnementNVDevisTemp.infoPasse = serviceUSInfoPasse.selectUSInfoPasse(abonnementNVDevisTemp.NumInfoPasse);
                            }
                            if (abonnementNVDevisTemp.NumZoneD != "")
                            {
                                abonnementNVDevisTemp.zoneD = serviceUSZone.selectUSZone(abonnementNVDevisTemp.NumZoneD);
                            }
                            if (abonnementNVDevisTemp.NumZoneF != "")
                            {
                                abonnementNVDevisTemp.zoneF = serviceUSZone.selectUSZone(abonnementNVDevisTemp.NumZoneF);
                            }


                            abonnementNVDevisValide.Add(abonnementNVDevisTemp);
                            abonnementNVDevisTemp = null;
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(abonnementNVDevisValide);
        }