Example #1
0
        string IntfDalUSPlageNombreBillet.insertUSPlageNombreBillet(crlUSPlageNombreBillet plageNombreBillet, string sigleAgence)
        {
            #region declaration
            string numPlageNombreBillet = "";
            IntfDalUSPlageNombreBillet serviceUSPlageNombreBillet = new ImplDalUSPlageNombreBillet();
            IntfDalGeneral             serviceGeneral             = new ImplDalGeneral();
            int nbInsert = 0;
            #endregion

            #region implementation
            if (plageNombreBillet != null)
            {
                plageNombreBillet.NumPlageNombreBillet = serviceUSPlageNombreBillet.getNumUSPlageNombreBillet(sigleAgence);
                this.strCommande  = "INSERT INTO `usplagenombrebillet` (`numPlageNombreBillet`,`nombreD`,`nombreF`,`numReductionBillet`,`dureeDeValidite`)";
                this.strCommande += " VALUES ('" + plageNombreBillet.NumPlageNombreBillet + "','" + plageNombreBillet.NombreD + "',";
                this.strCommande += " '" + plageNombreBillet.NombreF + "','" + plageNombreBillet.NumReductionBillet + "',";
                this.strCommande += " '" + serviceGeneral.getStringTimeSpan(plageNombreBillet.DureeDeValidite) + "')";
                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numPlageNombreBillet = plageNombreBillet.NumPlageNombreBillet;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numPlageNombreBillet);
        }
Example #2
0
        bool IntfDalUSPlageNombreBillet.updateUSPlageNombreBillet(crlUSPlageNombreBillet plageNombreBillet)
        {
            #region declaration
            bool           isUpdate       = false;
            int            nbUpdate       = 0;
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation
            if (plageNombreBillet != null)
            {
                this.strCommande  = "UPDATE `usplagenombrebillet` SET `nombreD`='" + plageNombreBillet.NombreD + "',";
                this.strCommande += " `nombreF`='" + plageNombreBillet.NombreF + "',`numReductionBillet`='" + plageNombreBillet.NumReductionBillet + "',";
                this.strCommande += " `dureeDeValidite`='" + serviceGeneral.getStringTimeSpan(plageNombreBillet.DureeDeValidite) + "'";
                this.strCommande += " WHERE `numPlageNombreBillet`='" + plageNombreBillet.NumPlageNombreBillet + "'";
                this.serviceConnectBase.openConnection();
                nbUpdate = this.serviceConnectBase.requete(this.strCommande);
                if (nbUpdate == 1)
                {
                    isUpdate = true;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(isUpdate);
        }
Example #3
0
        DataTable IntfDalFacture.getDataTableFactureNotRecu(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();
            //IntfDalVille serviceVille = new ImplDalVille();
            //IntfDalFicheBord serviceFicheBord = new ImplDalFicheBord();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();

            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numFacture", typeof(string));
            dataTable.Columns.Add("montant", typeof(string));
            dataTable.Columns.Add("dateFacturation", typeof(DateTime));
            dataTable.Columns.Add("Individu", typeof(string));
            dataTable.Columns.Add("societe", typeof(string));
            dataTable.Columns.Add("organisme", 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["numFacture"] = reader["numFacture"].ToString();
                        dr["montant"]    = serviceGeneral.separateurDesMilles(reader["montant"].ToString()) + "Ar";
                        try
                        {
                            dr["dateFacturation"] = Convert.ToDateTime(reader["dateFacturation"].ToString());
                        }
                        catch (Exception)
                        {
                        }
                        dr["Individu"] = reader["prenomIndividu"].ToString() + " " + reader["nomIndividu"].ToString() + " / " + reader["cinIndividu"] + " / " + reader["adresse"].ToString();

                        dr["societe"] = reader["nomSociete"] + " / " + reader["adresseSociete"].ToString();

                        dr["organisme"] = reader["nomOrganisme"].ToString() + " / " + reader["adresseOrganisme"].ToString();


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

            #endregion

            return(dataTable);
        }
Example #4
0
        bool IntfDalUSAbonnementNVDevis.deleteUSAbonnementNVDevis(string numAbonnementNVDevis)
        {
            #region declaration
            bool           isUpdate       = false;
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation
            if (numAbonnementNVDevis != "")
            {
                this.strCommande  = "UPDATE `uscarte` SET `numAbonnementNVDevis`=NULL";
                this.strCommande += " WHERE `numAbonnementNVDevis`='" + numAbonnementNVDevis + "'";

                this.serviceConnectBase.openConnection();
                this.serviceConnectBase.requete(this.strCommande);
                this.serviceConnectBase.closeConnection();

                if (serviceGeneral.delete("usabonnementnvdevis", "numAbonnementNVDevis", numAbonnementNVDevis) == 1)
                {
                    isUpdate = true;
                }
            }
            #endregion

            return(isUpdate);
        }
        DataTable IntfDalDesignationCommission.getDataTableDesignationCommission(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numDesignation", typeof(string));
            dataTable.Columns.Add("designation", typeof(string));
            dataTable.Columns.Add("typeCommission", typeof(string));
            dataTable.Columns.Add("paiement", 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["numDesignation"] = reader["numDesignation"].ToString();
                        dr["designation"]    = reader["designation"].ToString();
                        dr["typeCommission"] = reader["typeCommission"].ToString();

                        if (reader["paiement"].ToString().Equals("0"))
                        {
                            dr["paiement"] = "Interne";
                        }
                        else if (reader["paiement"].ToString().Equals("1"))
                        {
                            dr["paiement"] = "Par Kg";
                        }
                        else if (reader["paiement"].ToString().Equals("2"))
                        {
                            dr["paiement"] = "Par pièce";
                        }
                        else
                        {
                            dr["paiement"] = "";
                        }

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

            #endregion

            return(dataTable);
        }
Example #6
0
        crlUSPlageNombreBillet IntfDalUSPlageNombreBillet.getPlageNombreBillet(int nombreBillet)
        {
            #region declaration
            crlUSPlageNombreBillet plageNombreBillet = null;
            IntfDalGeneral         serviceGeneral    = new ImplDalGeneral();
            #endregion

            #region implementation
            if (nombreBillet > 0)
            {
                this.strCommande  = "SELECT usplagenombrebillet.numPlageNombreBillet, usplagenombrebillet.nombreD,";
                this.strCommande += " usplagenombrebillet.nombreF, usplagenombrebillet.numReductionBillet,";
                this.strCommande += " usplagenombrebillet.dureeDeValidite FROM usplagenombrebillet";
                this.strCommande += " WHERE usplagenombrebillet.nombreD <= '" + nombreBillet.ToString("0") + "' AND";
                this.strCommande += " usplagenombrebillet.nombreF >= '" + nombreBillet.ToString("0") + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            plageNombreBillet = new crlUSPlageNombreBillet();
                            try
                            {
                                plageNombreBillet.DureeDeValidite = serviceGeneral.getTimeSpan(this.reader["dureeDeValidite"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                plageNombreBillet.NombreD = int.Parse(this.reader["nombreD"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                plageNombreBillet.NombreF = int.Parse(this.reader["nombreF"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            plageNombreBillet.NumPlageNombreBillet = this.reader["numPlageNombreBillet"].ToString();
                            plageNombreBillet.NumReductionBillet   = this.reader["numReductionBillet"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion


            return(plageNombreBillet);
        }
Example #7
0
        DataTable IntfDalCommissionDevis.getDataTableCommissionDevis(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            IntfDalTrajet  serviceTrajet  = new ImplDalTrajet();
            crlTrajet      trajet         = null;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("idCommissionDevis", typeof(string));
            dataTable.Columns.Add("destination", typeof(string));
            dataTable.Columns.Add("prixTotalfraisEnvoi", typeof(string));
            dataTable.Columns.Add("trajet", 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["idCommissionDevis"] = reader["idCommissionDevis"].ToString();
                        dr["destination"]       = reader["destination"].ToString();

                        dr["prixTotalfraisEnvoi"] = serviceGeneral.separateurDesMilles(this.reader["fraisEnvoi"].ToString()) + "Ar";

                        trajet = serviceTrajet.selectTrajet(this.reader["numTrajet"].ToString());
                        if (trajet != null)
                        {
                            dr["trajet"] = trajet.villeD.NomVille + "-" + trajet.villeF.NomVille;
                        }
                        else
                        {
                            dr["trajet"] = "";
                        }
                        trajet = null;
                        dataTable.Rows.Add(dr);
                    }
                }
                this.reader.Dispose();
            }
            this.serviceConnectBase.closeConnection();

            #endregion

            return(dataTable);
        }
Example #8
0
        DataTable IntfDalCheque.getDataTableCheque(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numCheque", typeof(string));
            dataTable.Columns.Add("numerosCheque", typeof(string));
            dataTable.Columns.Add("banque", typeof(string));
            dataTable.Columns.Add("dateCheque", typeof(DateTime));
            dataTable.Columns.Add("montantCheque", 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["numCheque"]     = reader["numCheque"].ToString();
                        dr["numerosCheque"] = reader["numerosCheque"].ToString();
                        dr["banque"]        = reader["banque"].ToString();
                        try
                        {
                            dr["dateCheque"] = Convert.ToDateTime(this.reader["dateCheque"].ToString());
                        }
                        catch (Exception)
                        {
                        }

                        dr["montantCheque"] = serviceGeneral.separateurDesMilles(this.reader["montantCheque"].ToString()) + "Ar";


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

            #endregion

            return(dataTable);
        }
Example #9
0
        DataTable IntfDalVoyage.getDataTableVoyageFB(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation
            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("idVoyage", typeof(string));
            dataTable.Columns.Add("client", typeof(string));
            dataTable.Columns.Add("pieceIdentite", typeof(string));
            dataTable.Columns.Add("destination", typeof(string));
            dataTable.Columns.Add("numPlace", typeof(string));
            dataTable.Columns.Add("poidBagage", typeof(string));
            dataTable.Columns.Add("prixTrajet", typeof(string));
            dataTable.Columns.Add("numBillet", 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["idVoyage"]      = reader["idVoyage"].ToString();
                        dr["client"]        = reader["nomIndividu"].ToString() + " " + reader["prenomIndividu"].ToString();
                        dr["pieceIdentite"] = reader["pieceIdentite"].ToString();
                        dr["destination"]   = reader["destination"].ToString();
                        dr["numPlace"]      = reader["numPlace"].ToString();
                        dr["poidBagage"]    = reader["poidBagage"].ToString() + "Kg";
                        dr["prixTrajet"]    = serviceGeneral.separateurDesMilles(reader["prixBillet"].ToString()) + "Ar";
                        dr["numBillet"]     = reader["numBillet"].ToString();

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

            return(dataTable);
        }
Example #10
0
        DataTable IntfDalUSPlageNombreBillet.getDataTablePlageNombreBillet(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numPlageNombreBillet", typeof(string));
            dataTable.Columns.Add("plage", typeof(string));
            dataTable.Columns.Add("dureeDeValidite", typeof(string));
            dataTable.Columns.Add("reductionBillet", typeof(string));
            dataTable.Columns.Add("reductionPourcentage", typeof(string));
            dataTable.Columns.Add("reductionMontant", 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["numPlageNombreBillet"] = reader["numPlageNombreBillet"].ToString();
                        dr["plage"]                = reader["nombreD"].ToString() + " à " + reader["nombreF"].ToString();
                        dr["dureeDeValidite"]      = serviceGeneral.getTextTimeSpan(reader["dureeDeValidite"].ToString());
                        dr["reductionBillet"]      = reader["reductionBillet"].ToString();
                        dr["reductionPourcentage"] = reader["reductionPourcentage"].ToString() + " %";
                        dr["reductionMontant"]     = reader["reductionMontant"].ToString() + " Ar";

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

            #endregion

            return(dataTable);
        }
Example #11
0
        DataTable IntfDalRecu.getDataTableRecuEncaisser(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numRecu", typeof(string));
            dataTable.Columns.Add("libele", typeof(string));
            dataTable.Columns.Add("montant", typeof(string));
            dataTable.Columns.Add("dateRecu", typeof(DateTime));
            dataTable.Columns.Add("modePaiement", 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["numRecu"]      = reader["numRecu"].ToString();
                        dr["libele"]       = reader["libele"].ToString();
                        dr["montant"]      = serviceGeneral.separateurDesMilles(reader["montant"].ToString()) + "Ar";
                        dr["dateRecu"]     = Convert.ToDateTime(reader["dateRecu"].ToString());
                        dr["modePaiement"] = reader["modePaiement"].ToString();

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

            #endregion

            return(dataTable);
        }
Example #12
0
        DataTable IntfDalUSCarte.getDataTableCarte(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numCarte", typeof(string));
            dataTable.Columns.Add("prixCarte", typeof(string));
            dataTable.Columns.Add("numCarteReduction", typeof(string));
            dataTable.Columns.Add("numAbonnement", 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["numCarte"]          = reader["numCarte"].ToString();
                        dr["prixCarte"]         = serviceGeneral.separateurDesMilles(reader["prixCarte"].ToString()) + " Ar";
                        dr["numCarteReduction"] = reader["numCarteReduction"].ToString();
                        dr["numAbonnement"]     = reader["numAbonnement"].ToString();

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

            #endregion

            return(dataTable);
        }
Example #13
0
        crlUSPlageNombreBillet IntfDalUSPlageNombreBillet.selectUSPlageNombreBillet(string numPlageNombreBillet)
        {
            #region declaration
            crlUSPlageNombreBillet plageNombreBillet = null;
            IntfDalGeneral         serviceGeneral    = new ImplDalGeneral();
            #endregion

            #region impementation
            if (numPlageNombreBillet != "")
            {
                this.strCommande  = "SELECT * FROM `usplagenombrebillet` WHERE ";
                this.strCommande += " `numPlageNombreBillet`='" + numPlageNombreBillet + "'";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            plageNombreBillet = new crlUSPlageNombreBillet();
                            plageNombreBillet.NumPlageNombreBillet = this.reader["numPlageNombreBillet"].ToString();
                            try
                            {
                                plageNombreBillet.NombreD = int.Parse(this.reader["nombreD"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                plageNombreBillet.NombreF = int.Parse(this.reader["nombreF"].ToString());
                            }
                            catch (Exception) { }
                            plageNombreBillet.NumReductionBillet = this.reader["numReductionBillet"].ToString();
                            plageNombreBillet.DureeDeValidite    = serviceGeneral.getTimeSpan(this.reader["dureeDeValidite"].ToString());
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(plageNombreBillet);
        }
        DataTable IntfDalTarifDeveloppement.getDataTableTarifDeveloppement(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region initialise table
            dataTable.Columns.Add("numTarifDeveloppement", typeof(string));
            dataTable.Columns.Add("zone", typeof(string));
            dataTable.Columns.Add("montantTarifDeveloppement", typeof(string));
            dataTable.Columns.Add("commentaireTarifDeveloppement", typeof(string));

            DataRow dr = null;
            #endregion

            #region implementation
            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["numTarifDeveloppement"] = this.reader["numTarifDeveloppement"].ToString();
                        dr["zone"] = this.reader["zone"].ToString();
                        dr["montantTarifDeveloppement"]     = serviceGeneral.separateurDesMilles(this.reader["montantTarifDeveloppement"].ToString()) + "Ar";
                        dr["commentaireTarifDeveloppement"] = this.reader["commentaireTarifDeveloppement"].ToString();

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

            return(dataTable);
        }
Example #15
0
        bool IntfDalRouteNationale.deleteRouteNationale(string routeNationale)
        {
            #region declaration
            bool           isDelete       = false;
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation
            if (routeNationale != null)
            {
                serviceGeneral.delete("assovilleroutenationale", "routeNationale", routeNationale);
                if (serviceGeneral.delete("routenationale", "routeNationale", routeNationale) == 1)
                {
                    isDelete = true;
                }
            }
            #endregion

            return(isDelete);
        }
Example #16
0
        DataTable IntfDalTypeCommission.getDataTableTypeCommission(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("typeCommission", typeof(string));
            dataTable.Columns.Add("commentaireTypeCommission", typeof(string));
            DataRow dr;
            #endregion

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

                        dr["typeCommission"]            = reader["typeCommission"].ToString();
                        dr["commentaireTypeCommission"] = reader["commentaireTypeCommission"].ToString();

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

            #endregion

            return(dataTable);
        }
Example #17
0
        DataTable IntfDalVoyage.getDataTableVoyageAutorisationDepart(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            #endregion

            #region implementation
            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("passager", typeof(string));
            dataTable.Columns.Add("pieceIdentite", typeof(string));
            dataTable.Columns.Add("destination", typeof(string));
            dataTable.Columns.Add("numPlace", typeof(string));
            dataTable.Columns.Add("poidBagage", typeof(string));
            dataTable.Columns.Add("prixTrajet", typeof(string));
            dataTable.Columns.Add("numBillet", typeof(string));
            dataTable.Columns.Add("excedent", typeof(string));
            dataTable.Columns.Add("somme", 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["passager"]      = reader["nomIndividu"].ToString() + " " + reader["prenomIndividu"].ToString();
                        dr["pieceIdentite"] = reader["pieceIdentite"].ToString();
                        dr["destination"]   = reader["destination"].ToString();
                        dr["numPlace"]      = reader["numPlace"].ToString();
                        dr["poidBagage"]    = reader["poidBagage"].ToString() + "Kg";
                        dr["prixTrajet"]    = serviceGeneral.separateurDesMilles(reader["prixBillet"].ToString()) + "Ar";
                        dr["numBillet"]     = reader["numBillet"].ToString();
                        if (reader["excedentPoid"].ToString().Trim() != "" && reader["prixExcedent"].ToString().Trim() != "")
                        {
                            dr["excedent"] = serviceGeneral.separateurDesMilles(reader["prixExcedent"].ToString()) + "Ar (" + reader["excedentPoid"] + "Kg)";

                            try
                            {
                                dr["somme"] = serviceGeneral.separateurDesMilles((double.Parse(reader["prixBillet"].ToString()) + double.Parse(reader["prixExcedent"].ToString())).ToString()) + "Ar";
                            }
                            catch (Exception)
                            {
                            }
                        }
                        else
                        {
                            dr["excedent"] = "-";
                            dr["somme"]    = serviceGeneral.separateurDesMilles(reader["prixBillet"].ToString()) + "Ar";
                        }


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

            return(dataTable);
        }
        DataTable IntfDalDureeAbonnementDevis.getDataTableDureeAbonnementDevis(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            IntfDalTrajet  serviceTrajet  = new ImplDalTrajet();
            crlTrajet      trajet         = null;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numDureeAbonnementDevis", typeof(string));
            dataTable.Columns.Add("zone", typeof(string));
            dataTable.Columns.Add("valideDu", typeof(DateTime));
            dataTable.Columns.Add("valideAu", typeof(DateTime));
            dataTable.Columns.Add("prixTotal", typeof(string));
            dataTable.Columns.Add("nombre", typeof(string));
            dataTable.Columns.Add("trajet", 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["numDureeAbonnementDevis"] = reader["numDureeAbonnementDevis"].ToString();
                        dr["zone"] = reader["zone"].ToString();
                        try
                        {
                            dr["valideDu"] = Convert.ToDateTime(reader["valideDu"].ToString());
                        }
                        catch (Exception)
                        {
                        }

                        try
                        {
                            dr["valideAu"] = Convert.ToDateTime(this.reader["valideAu"].ToString());
                        }
                        catch (Exception)
                        {
                        }

                        dr["prixTotal"] = serviceGeneral.separateurDesMilles(this.reader["prixTotal"].ToString()) + "Ar";
                        dr["nombre"]    = this.reader["nombreDureeAbonnement"].ToString();

                        trajet = serviceTrajet.selectTrajet(this.reader["numTrajet"].ToString());
                        if (trajet != null)
                        {
                            dr["trajet"] = trajet.villeD.NomVille + "-" + trajet.villeF.NomVille;
                        }
                        else
                        {
                            dr["trajet"] = "";
                        }
                        trajet = null;
                        dataTable.Rows.Add(dr);
                    }
                }
                this.reader.Dispose();
            }
            this.serviceConnectBase.closeConnection();

            #endregion

            return(dataTable);
        }
Example #19
0
        DataTable IntfDalUSInfoPasse.getDataTableInfoPasse(string strRqst)
        {
            #region declaration
            DataTable                  dataTable                  = new DataTable();
            IntfDalGeneral             serviceGeneral             = new ImplDalGeneral();
            IntfDalUSPlageNombreBillet serviceUSPlageNombreBillet = new ImplDalUSPlageNombreBillet();
            IntfDalUSReductionBillet   serviceUSReductionBillet   = new ImplDalUSReductionBillet();
            IntfDalUSPrixBase          serviceUSPrixBase          = new ImplDalUSPrixBase();
            crlUSReductionBillet       reduction                  = null;
            crlUSPlageNombreBillet     plageNombreBillet          = null;
            crlUSPrixBase              prixBase = null;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numInfoPasse", typeof(string));
            dataTable.Columns.Add("nombrePasse", typeof(string));
            dataTable.Columns.Add("niveau", typeof(string));
            dataTable.Columns.Add("prixUnitaire", typeof(string));
            dataTable.Columns.Add("dureeValidite", 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["numInfoPasse"] = reader["numInfoPasse"].ToString();
                        dr["nombrePasse"]  = reader["nombrePasse"].ToString();
                        dr["niveau"]       = reader["niveau"].ToString();

                        reduction = serviceUSReductionBillet.selectUSReductionBillet(this.reader["numReductionBillet"].ToString());
                        try
                        {
                            prixBase = serviceUSPrixBase.selectUSPrixBase(int.Parse(reader["niveau"].ToString()));
                        }
                        catch (Exception) { }
                        try
                        {
                            plageNombreBillet = serviceUSPlageNombreBillet.getPlageNombreBillet(int.Parse(reader["nombrePasse"].ToString()));
                        }
                        catch (Exception) { }


                        if (prixBase != null)
                        {
                            if (reduction != null)
                            {
                                if (reduction.ReductionMontant > 0)
                                {
                                    dr["prixUnitaire"] = serviceGeneral.separateurDesMilles((prixBase.MontantPrixBase - reduction.ReductionMontant).ToString("0")) + " Ar";
                                }
                                else
                                {
                                    dr["prixUnitaire"] = serviceGeneral.separateurDesMilles((prixBase.MontantPrixBase - (prixBase.MontantPrixBase * reduction.ReductionPourcentage / 100)).ToString("0")) + " Ar";
                                }
                            }
                            else
                            {
                                dr["prixUnitaire"] = serviceGeneral.separateurDesMilles(prixBase.MontantPrixBase.ToString("0")) + " Ar";
                            }
                        }
                        else
                        {
                            dr["prixUnitaire"] = "";
                        }

                        if (plageNombreBillet != null)
                        {
                            dr["dureeValidite"] = serviceGeneral.getTextTimeSpan(serviceGeneral.getStringTimeSpan(plageNombreBillet.DureeDeValidite));
                        }
                        else
                        {
                            dr["dureeValidite"] = "";
                        }


                        reduction         = null;
                        prixBase          = null;
                        plageNombreBillet = null;


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

            #endregion

            return(dataTable);
        }
Example #20
0
        DataTable IntfDalAutorisationDepart.getDataTableAutorisationDepart(string strRqst)
        {
            #region declaration
            DataTable        dataTable        = new DataTable();
            IntfDalVille     serviceVille     = new ImplDalVille();
            IntfDalFicheBord serviceFicheBord = new ImplDalFicheBord();
            IntfDalGeneral   serviceGeneral   = new ImplDalGeneral();

            crlVille villeD = new crlVille();
            crlVille villeF = new crlVille();

            double montant = 0.00;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numAutorisationDepart", typeof(string));
            dataTable.Columns.Add("dateDepart", typeof(DateTime));
            dataTable.Columns.Add("itineraire", typeof(string));
            dataTable.Columns.Add("chauffeur", typeof(string));
            dataTable.Columns.Add("voiture", typeof(string));
            dataTable.Columns.Add("montant", typeof(string));
            dataTable.Columns.Add("montantRecu", 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["numAutorisationDepart"] = reader["numAutorisationDepart"].ToString();
                        dr["dateDepart"]            = Convert.ToDateTime(reader["dateHeurDepart"].ToString());

                        villeD = serviceVille.selectVille(reader["numVilleItineraireDebut"].ToString());
                        villeF = serviceVille.selectVille(reader["numVilleItineraireFin"].ToString());
                        if (villeD != null && villeF != null)
                        {
                            dr["itineraire"] = villeD.NomVille + "-" + villeF.NomVille;
                        }
                        else
                        {
                            dr["itineraire"] = reader["numVilleItineraireDebut"].ToString() + "-" + reader["numVilleItineraireFin"].ToString();
                        }

                        dr["chauffeur"] = reader["nomChauffeur"].ToString() + " " + reader["prenomChauffeur"].ToString();
                        dr["voiture"]   = reader["matriculeVehicule"].ToString() + " " + reader["marqueVehicule"].ToString() + " " + reader["couleurVehicule"].ToString();

                        montant = serviceFicheBord.getPrixTotalBagage(reader["numerosFB"].ToString()) + serviceFicheBord.getPrixTotalBillet(reader["numerosFB"].ToString()) + serviceFicheBord.getPrixTotalCommission(reader["numerosFB"].ToString());

                        dr["montant"]     = serviceGeneral.separateurDesMilles(montant.ToString("0")) + "Ar";
                        dr["montantRecu"] = serviceGeneral.separateurDesMilles(reader["sommeRecu"].ToString()) + "Ar";

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

            #endregion

            return(dataTable);
        }
Example #21
0
        DataTable IntfDalUSLigne.getDataTableLigne(string strRqst)
        {
            #region declaration
            DataTable   dataTable = new DataTable();
            crlUSArret  arretD    = null;
            crlUSArret  arretF    = null;
            crlUSLieu   lieuD     = null;
            crlUSLieu   lieuF     = null;
            crlQuartier quartierD = null;
            crlQuartier quartierF = null;

            IntfDalUSArret  serviceUSArret  = new ImplDalUSArret();
            IntfDalUSLieu   serviceUSLieu   = new ImplDalUSLieu();
            IntfDalGeneral  serviceGeneral  = new ImplDalGeneral();
            IntfDalQuartier serviceQuartier = new ImplDalQuartier();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numLigne", typeof(string));
            dataTable.Columns.Add("nomLigne", typeof(string));
            dataTable.Columns.Add("nomCooperative", typeof(string));
            dataTable.Columns.Add("zone", typeof(string));
            dataTable.Columns.Add("trajet", 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["numLigne"]       = reader["numLigne"].ToString();
                        dr["nomLigne"]       = reader["nomLigne"].ToString();
                        dr["nomCooperative"] = reader["nomCooperative"].ToString();
                        dr["zone"]           = reader["zone"].ToString();

                        arretD = serviceUSArret.selectUSArret(this.reader["numArretD"].ToString());
                        arretF = serviceUSArret.selectUSArret(this.reader["numArretF"].ToString());

                        if (arretD != null && arretF != null)
                        {
                            lieuD = serviceUSLieu.selectUSLieu(arretD.NumLieu);
                            lieuF = serviceUSLieu.selectUSLieu(arretF.NumLieu);

                            if (lieuD != null && lieuF != null)
                            {
                                quartierD = serviceQuartier.selectQuartier(lieuD.NumQuartier);
                                quartierF = serviceQuartier.selectQuartier(lieuF.NumQuartier);

                                if (quartierF != null && quartierF != null)
                                {
                                    dr["trajet"] = quartierD.Quartier + "/" + arretD.NomArret + "-" + quartierF.Quartier + "/" + arretF.NomArret;
                                }
                                else
                                {
                                    dr["trajet"] = arretD.NomArret + "-" + arretF.NomArret;
                                }
                            }
                            else
                            {
                                dr["trajet"] = arretD.NomArret + "-" + arretF.NomArret;
                            }
                        }
                        else
                        {
                            dr["trajet"] = this.reader["numArretD"].ToString() + "-" + this.reader["numArretF"].ToString();
                        }


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

            #endregion

            return(dataTable);
        }
Example #22
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);
        }
Example #23
0
        DataTable IntfDalProprietaire.getDataTableVoyageVoitureProprietaire(string strRqst)
        {
            #region declaration
            DataTable                 dataTable                 = new DataTable();
            IntfDalVille              serviceVille              = new ImplDalVille();
            IntfDalFicheBord          serviceFicheBord          = new ImplDalFicheBord();
            IntfDalAutorisationDepart serviceAutorisationDepart = new ImplDalAutorisationDepart();
            IntfDalGeneral            serviceGeneral            = new ImplDalGeneral();

            crlVille villeD = new crlVille();
            crlVille villeF = new crlVille();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("vehicule", typeof(string));
            dataTable.Columns.Add("chauffeur", typeof(string));
            dataTable.Columns.Add("dateVoyage", typeof(DateTime));
            dataTable.Columns.Add("Itineraire", typeof(string));
            dataTable.Columns.Add("recette", typeof(string));
            dataTable.Columns.Add("reste", typeof(string));
            DataRow dr;
            #endregion

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

                        dr["vehicule"]   = reader["matriculeVehicule"].ToString() + " " + reader["marqueVehicule"];
                        dr["chauffeur"]  = reader["nomChauffeur"].ToString() + " " + reader["prenomChauffeur"].ToString();
                        dr["dateVoyage"] = Convert.ToDateTime(reader["dateHeurDepart"].ToString());

                        villeD = serviceVille.selectVille(reader["numVilleItineraireDebut"].ToString());
                        villeF = serviceVille.selectVille(reader["numVilleItineraireFin"].ToString());
                        if (villeD != null && villeF != null)
                        {
                            dr["Itineraire"] = villeD.NomVille + "-" + villeF.NomVille;
                        }
                        else
                        {
                            dr["Itineraire"] = reader["numVilleItineraireDebut"].ToString() + "-" + reader["numVilleItineraireFin"].ToString();
                        }


                        dr["recette"] = serviceGeneral.separateurDesMilles(reader["recetteTotale"].ToString()) + "Ar";

                        dr["reste"] = serviceGeneral.separateurDesMilles(reader["resteRegle"].ToString()) + "Ar";

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

            #endregion

            return(dataTable);
        }
Example #24
0
        DataTable IntfDalTrajet.getDataTableTrajetNotItineraire(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalVille   serviceVille   = new ImplDalVille();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();

            crlVille villeD    = null;
            crlVille villeF    = null;
            string   strTrajet = "";
            #endregion

            #region initialise table
            dataTable.Columns.Add("numTrajet", typeof(string));
            dataTable.Columns.Add("distanceTrajet", typeof(string));
            dataTable.Columns.Add("dureeTrajet", typeof(string));
            dataTable.Columns.Add("trajet", typeof(string));

            DataRow dr = null;
            #endregion

            #region implementation
            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["numTrajet"]      = this.reader["numTrajet"].ToString();
                        dr["distanceTrajet"] = this.reader["distanceTrajet"].ToString() + "Km";
                        dr["dureeTrajet"]    = serviceGeneral.getTextTimeSpan(this.reader["dureeTrajet"].ToString());

                        villeD = serviceVille.selectVille(this.reader["numVilleD"].ToString());
                        villeF = serviceVille.selectVille(this.reader["numVilleF"].ToString());

                        if (villeD != null)
                        {
                            strTrajet += villeD.NomVille;
                        }
                        else
                        {
                            strTrajet += this.reader["numVilleD"].ToString();
                        }

                        if (villeF != null)
                        {
                            strTrajet += "-" + villeF.NomVille;
                        }
                        else
                        {
                            strTrajet += "-" + this.reader["numVilleF"].ToString();
                        }

                        dr["trajet"] = strTrajet;
                        strTrajet    = "";

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

            return(dataTable);
        }
Example #25
0
        DataTable IntfDalBonDeCommande.getDataTableBonDeCommandeNonPaieDateDF(string strRqst)
        {
            #region declaration
            DataTable    dataTable = new DataTable();
            crlOrganisme organisme = null;
            crlSociete   societe   = null;
            crlClient    client    = null;

            IntfDalGeneral   serviceGeneral   = new ImplDalGeneral();
            IntfDalSociete   serviceSociete   = new ImplDalSociete();
            IntfDalOrganisme serviceOrganisme = new ImplDalOrganisme();
            IntfDalClient    serviceClient    = new ImplDalClient();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numBonDeCommande", typeof(string));
            dataTable.Columns.Add("datePaiement", typeof(DateTime));
            dataTable.Columns.Add("montant", typeof(string));
            dataTable.Columns.Add("client", typeof(string));
            dataTable.Columns.Add("adresse", typeof(string));
            dataTable.Columns.Add("contact", typeof(string));
            dataTable.Columns.Add("respSociete", typeof(string));
            dataTable.Columns.Add("respContact", 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["numBonDeCommande"] = reader["numBonDeCommande"].ToString();

                        dr["datePaiement"] = Convert.ToDateTime(this.reader["datePaiementBC"].ToString());

                        dr["montant"] = serviceGeneral.separateurDesMilles(this.reader["montantBC"].ToString()) + "Ar";

                        if (reader["numClient"].ToString() != "")
                        {
                            client = serviceClient.selectClient(reader["numClient"].ToString());
                        }
                        if (reader["numOrganisme"].ToString() != "")
                        {
                            organisme = serviceOrganisme.selectOrganisme(reader["numOrganisme"].ToString());
                        }
                        if (reader["numSociete"].ToString() != "")
                        {
                            societe = serviceSociete.selectSociete(reader["numSociete"].ToString());
                        }

                        if (client != null)
                        {
                            dr["client"] = client.PrenomClient + " " + client.NomClient;

                            dr["adresse"] = client.AdresseClient;

                            dr["contact"] = client.TelephoneClient + " / " + client.MobileClient;

                            dr["respSociete"] = "-";

                            dr["respContact"] = "-";
                        }
                        else if (societe != null)
                        {
                            dr["client"] = societe.NomSociete;

                            dr["adresse"] = societe.AdresseSociete;

                            dr["contact"] = societe.TelephoneFixeSociete + " / " + societe.TelephoneMobileSociete;
                            if (societe.individuResponsable != null)
                            {
                                dr["respSociete"] = societe.individuResponsable.PrenomIndividu + " " + societe.individuResponsable.NomIndividu;

                                dr["respContact"] = societe.individuResponsable.TelephoneFixeIndividu + " / " + societe.individuResponsable.TelephoneMobileIndividu;
                            }
                        }
                        else if (organisme != null)
                        {
                            dr["client"] = organisme.NomOrganisme;

                            dr["adresse"] = organisme.AdresseOrganisme;

                            dr["contact"] = organisme.TelephoneFixeOrganisme + " / " + organisme.TelephoneMobileOrganisme;

                            if (organisme.individuResponsable != null)
                            {
                                dr["respSociete"] = organisme.individuResponsable.PrenomIndividu + " " + organisme.individuResponsable.NomIndividu;

                                dr["respContact"] = organisme.individuResponsable.TelephoneFixeIndividu + " / " + organisme.individuResponsable.TelephoneMobileIndividu;
                            }
                        }

                        client    = null;
                        societe   = null;
                        organisme = null;
                        dataTable.Rows.Add(dr);
                    }
                }
                this.reader.Dispose();
            }
            this.serviceConnectBase.closeConnection();

            #endregion

            return(dataTable);
        }
Example #26
0
        DataTable IntfDalVehicule.getDataTableADForVehicule(string strRqst)
        {
            #region declaration
            DataTable         dataTable         = new DataTable();
            crlItineraire     itineraire        = null;
            IntfDalItineraire serviceItineraire = new ImplDalItineraire();
            IntfDalGeneral    serviceGeneral    = new ImplDalGeneral();
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("vehicule", typeof(string));
            dataTable.Columns.Add("chauffeur", typeof(string));
            dataTable.Columns.Add("date", typeof(DateTime));
            dataTable.Columns.Add("itineraire", typeof(string));
            dataTable.Columns.Add("recette", typeof(string));
            dataTable.Columns.Add("reste", typeof(string));
            DataRow dr;
            #endregion

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

                        itineraire = serviceItineraire.selectItineraire(this.reader["idItineraire"].ToString());

                        dr["vehicule"]  = this.reader["matriculeVehicule"].ToString() + " " + this.reader["marqueVehicule"].ToString() + " " + this.reader["couleurVehicule"].ToString();
                        dr["chauffeur"] = this.reader["prenomChauffeur"].ToString() + " " + this.reader["nomChauffeur"].ToString();
                        try
                        {
                            dr["date"] = Convert.ToDateTime(this.reader["dateHeurDepart"].ToString());
                        }
                        catch (Exception)
                        {
                            dr["date"] = DateTime.Now;
                        }
                        if (itineraire != null)
                        {
                            dr["itineraire"] = itineraire.villeD.NomVille + "-" + itineraire.villeF.NomVille;
                        }
                        else
                        {
                            dr["itineraire"] = "-";
                        }
                        dr["recette"] = serviceGeneral.separateurDesMilles(this.reader["recetteTotale"].ToString()) + "Ar";
                        dr["reste"]   = serviceGeneral.separateurDesMilles(this.reader["resteRegle"].ToString()) + "Ar";


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

            #endregion

            return(dataTable);
        }
        DataTable IntfDalVoyageAbonnementDevis.getDataTableVoyageAbonnementDevis(string strRqst)
        {
            #region declaration
            DataTable      dataTable      = new DataTable();
            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            IntfDalTrajet  serviceTrajet  = new ImplDalTrajet();
            crlTrajet      trajet         = null;
            double         montantTotal   = 0;
            double         prixUnitaire   = 0;
            int            nbVoyage       = 0;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numVoyageAbonnementDevis", typeof(string));
            dataTable.Columns.Add("zone", typeof(string));
            dataTable.Columns.Add("nbVoyageAbonnement", typeof(string));
            dataTable.Columns.Add("prixTotal", typeof(string));
            dataTable.Columns.Add("trajet", 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["numVoyageAbonnementDevis"] = reader["numVoyageAbonnementDevis"].ToString();
                        dr["zone"] = reader["zone"].ToString();


                        try
                        {
                            nbVoyage = int.Parse(this.reader["nbVoyageAbonnement"].ToString());
                        }
                        catch (Exception)
                        {
                        }
                        try
                        {
                            prixUnitaire = double.Parse(this.reader["prixUnitaire"].ToString());
                        }
                        catch (Exception)
                        {
                        }

                        dr["nbVoyageAbonnement"] = this.reader["nbVoyageAbonnement"].ToString();

                        montantTotal    = prixUnitaire * nbVoyage;
                        dr["prixTotal"] = serviceGeneral.separateurDesMilles(montantTotal.ToString("0")) + "Ar";

                        trajet = serviceTrajet.selectTrajet(this.reader["numTrajet"].ToString());
                        if (trajet != null)
                        {
                            dr["trajet"] = trajet.villeD.NomVille + "-" + trajet.villeF.NomVille;
                        }
                        else
                        {
                            dr["trajet"] = "";
                        }

                        nbVoyage     = 0;
                        montantTotal = 0;
                        prixUnitaire = 0;
                        trajet       = null;
                        dataTable.Rows.Add(dr);
                    }
                }
                this.reader.Dispose();
            }
            this.serviceConnectBase.closeConnection();

            #endregion

            return(dataTable);
        }
Example #28
0
        DataTable IntfDalBillet.getDataTableBilletAbonnement(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalGeneral serviceGeneral = new ImplDalGeneral();
            IntfDalVille   serviceVille   = new ImplDalVille();

            crlVille VilleD    = null;
            crlVille VilleF    = null;
            string   strTrajet = "";
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numBillet", typeof(string));
            dataTable.Columns.Add("dateValidite", typeof(DateTime));
            dataTable.Columns.Add("modePaiement", typeof(string));
            dataTable.Columns.Add("prixBillet", typeof(string));
            dataTable.Columns.Add("trajet", 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["numBillet"]    = reader["numBillet"].ToString();
                        dr["dateValidite"] = Convert.ToDateTime(reader["dateDeValidite"].ToString());
                        dr["modePaiement"] = reader["modePaiement"].ToString();
                        dr["prixBillet"]   = serviceGeneral.separateurDesMilles(reader["prixBillet"].ToString()) + "Ar";

                        VilleD = serviceVille.selectVille(reader["numVilleD"].ToString());
                        VilleF = serviceVille.selectVille(reader["numVilleF"].ToString());

                        if (VilleD != null)
                        {
                            strTrajet = VilleD.NomVille + "-";
                        }
                        else
                        {
                            strTrajet = reader["numVilleD"].ToString() + "-";
                        }

                        if (VilleF != null)
                        {
                            strTrajet += VilleF.NomVille;
                        }
                        else
                        {
                            strTrajet += reader["numVilleF"].ToString();
                        }

                        dr["trajet"] = strTrajet;

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

            #endregion

            return(dataTable);
        }