Example #1
0
        crlOrganisme IntfDalOrganisme.selectOrganisme(string numOrganisme)
        {
            #region declaration
            crlOrganisme    organisme       = null;
            IntfDalIndividu serviceIndividu = new ImplDalIndividu();
            #endregion

            #region implementation
            if (numOrganisme != "")
            {
                this.strCommande = "SELECT * FROM organisme WHERE `numOrganisme`='" + numOrganisme + "'";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            organisme = new crlOrganisme();
                            organisme.AdresseOrganisme         = this.reader["adresseOrganisme"].ToString();
                            organisme.MailOrganisme            = this.reader["mailOrganisme"].ToString();
                            organisme.NomOrganisme             = this.reader["nomOrganisme"].ToString();
                            organisme.NumOrganisme             = this.reader["numOrganisme"].ToString();
                            organisme.TelephoneFixeOrganisme   = this.reader["telephoneFixeOrganisme"].ToString();
                            organisme.TelephoneMobileOrganisme = this.reader["telephoneMobileOrganisme"].ToString();
                            organisme.NumQuartier            = this.reader["numQuartier"].ToString();
                            organisme.NumIndividuResponsable = this.reader["numIndividuResponsable"].ToString();
                            try
                            {
                                organisme.IsCheque = int.Parse(this.reader["isCheque"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                organisme.IsBonCommande = int.Parse(this.reader["isBonCommande"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (organisme != null)
                {
                    if (organisme.NumIndividuResponsable != "")
                    {
                        organisme.individuResponsable = serviceIndividu.selectIndividu(organisme.NumIndividuResponsable);
                    }
                }
            }
            #endregion

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

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

            return(Voyage);
        }
Example #3
0
        bool IntfDalIndividu.updateIndividu(crlIndividu Individu, HtmlGenericControl divIndication)
        {
            #region declaration
            bool            isUpdate           = false;
            string          numIndividu        = "";
            string          strIndication      = "";
            crlIndividu     individuIndication = null;
            IntfDalIndividu serviceIndividu    = new ImplDalIndividu();
            #endregion

            #region implementation
            divIndication.Style.Add("font-size", "14px");
            divIndication.Style.Add("color", "Red");
            if (Individu != null)
            {
                if (Individu.CinIndividu != "")
                {
                    numIndividu = serviceIndividu.isAllIndividu(Individu);
                    if (numIndividu.Equals(""))
                    {
                        isUpdate = serviceIndividu.updateIndividu(Individu);
                        if (!isUpdate)
                        {
                            strIndication           = "Une erreur ce produit durant la modification!";
                            divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                        }
                    }
                    else
                    {
                        strIndication      = "CIN déjà enregistrer dans la base de données!<br/>";
                        individuIndication = serviceIndividu.selectIndividu(numIndividu);
                        if (individuIndication != null)
                        {
                            strIndication += "Nom:" + individuIndication.NomIndividu + "<br/>";
                            strIndication += "Prénom:" + individuIndication.PrenomIndividu + "<br/>";
                        }
                        divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                    }
                }
                else
                {
                    isUpdate = serviceIndividu.updateIndividu(Individu);
                    if (!isUpdate)
                    {
                        strIndication           = "Une erreur ce produit durant la modification!";
                        divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                    }
                }
            }
            #endregion

            return(isUpdate);
        }
Example #4
0
        crlUSReductionParticulier IntfDalUSReductionParticulier.selectUSReductionParticulier(string numUSReductionParticulier)
        {
            #region declaration
            crlUSReductionParticulier reductionParticulier     = null;
            IntfDalIndividu           serviceIndividu          = new ImplDalIndividu();
            IntfDalUSCategorieBillet  serviceUSCategorieBillet = new ImplDalUSCategorieBillet();
            #endregion

            #region implementation
            if (numUSReductionParticulier != "")
            {
                this.strCommande  = "SELECT * FROM `usreductionparticulier` WHERE";
                this.strCommande += " usreductionparticulier.numUSReductionParticulier = '" + numUSReductionParticulier + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            reductionParticulier = new crlUSReductionParticulier();
                            reductionParticulier.NumCategorieBillet       = this.reader["numCategorieBillet"].ToString();
                            reductionParticulier.NumIndividu              = this.reader["numIndividu"].ToString();
                            reductionParticulier.NumEtablissementScolaire = this.reader["numEtablissementScolaire"].ToString();
                            reductionParticulier.NumSociete = this.reader["numSociete"].ToString();
                            reductionParticulier.NumUSReductionParticulier = this.reader["numUSReductionParticulier"].ToString();
                            reductionParticulier.ImageReductionParticulier = this.reader["imageReductionParticulier"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (reductionParticulier != null)
                {
                    if (reductionParticulier.NumIndividu != "")
                    {
                        reductionParticulier.individu = serviceIndividu.selectIndividu(reductionParticulier.NumIndividu);
                    }
                    if (reductionParticulier.NumCategorieBillet != "")
                    {
                        reductionParticulier.categorieBillet = serviceUSCategorieBillet.selectUSCategorieBillet(reductionParticulier.NumCategorieBillet);
                    }
                }
            }
            #endregion

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

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

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

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

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

            return(Voyages);
        }
Example #6
0
        string IntfDalIndividu.insertIndividu(crlIndividu Individu, string sigleAgence, HtmlGenericControl divIndication)
        {
            #region declaration
            string          strNumIndividuTemp = "";
            string          numIndividu        = "";
            string          strIndication      = "";
            crlIndividu     individuIndication = null;
            IntfDalIndividu serviceIndividu    = new ImplDalIndividu();
            #endregion

            #region implementation
            divIndication.Style.Add("font-size", "14px");
            divIndication.Style.Add("color", "Red");
            if (Individu != null)
            {
                if (Individu.CinIndividu != "")
                {
                    Individu.NumIndividu = serviceIndividu.isCINIndividu(Individu);
                    if (Individu.NumIndividu.Equals(""))
                    {
                        Individu.NumIndividu = serviceIndividu.insertIndividu(Individu, sigleAgence);
                        if (Individu.NumIndividu != "")
                        {
                            numIndividu = Individu.NumIndividu;
                        }
                        else
                        {
                            strIndication           = "Une erreur ce produit durant l'enregistrement!";
                            divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                        }
                    }
                    else
                    {
                        strNumIndividuTemp   = Individu.NumIndividu;
                        Individu.NumIndividu = "";
                        Individu.NumIndividu = serviceIndividu.isAllIndividu(Individu);
                        if (Individu.NumIndividu.Equals(""))
                        {
                            strIndication      = "CIN déjà enregistrer dans la base de données!<br/>";
                            individuIndication = serviceIndividu.selectIndividu(strNumIndividuTemp);
                            if (individuIndication != null)
                            {
                                strIndication += "Nom:" + individuIndication.NomIndividu + "<br/>";
                                strIndication += "Prénom:" + individuIndication.PrenomIndividu + "<br/>";
                            }
                            divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                        }
                        else
                        {
                            if (serviceIndividu.updateIndividu(Individu))
                            {
                                numIndividu = Individu.NumIndividu;
                            }
                            else
                            {
                                strIndication           = "Une erreur ce produit durant l'enregistrement!";
                                divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                            }
                        }
                    }
                }
                else
                {
                    Individu.NumIndividu = serviceIndividu.isNotCINIndividu(Individu);
                    if (individuIndication.NumIndividu.Equals(""))
                    {
                        Individu.NumIndividu = serviceIndividu.insertIndividu(Individu, sigleAgence);
                        if (Individu.NumIndividu != "")
                        {
                            numIndividu = Individu.NumIndividu;
                        }
                        else
                        {
                            strIndication           = "Une erreur ce produit durant l'enregistrement!";
                            divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                        }
                    }
                    else
                    {
                        if (serviceIndividu.updateIndividu(Individu))
                        {
                            numIndividu = Individu.NumIndividu;
                        }
                        else
                        {
                            strIndication           = "Une erreur ce produit durant l'enregistrement!";
                            divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                        }
                    }
                }
            }
            #endregion

            return(numIndividu);
        }
Example #7
0
        crlBilletCommande IntfDalBilletCommande.selectBilletCommande(string numBilletCommande)
        {
            #region declaration
            crlBilletCommande            billetCommande  = null;
            IntfDalTrajet                serviceTrajet   = new ImplDalTrajet();
            IntfDalProforma              serviceProforma = new ImplDalProforma();
            IntfDalCalculCategorieBillet serviceCalculCategorieBillet = new ImplDalCalculCategorieBillet();
            IntfDalCalculReductionBillet serviceCalculReductionBillet = new ImplDalCalculReductionBillet();
            IntfDalIndividu              serviceIndividu = new ImplDalIndividu();
            #endregion

            #region implementation
            if (numBilletCommande != "")
            {
                this.strCommande = "SELECT * FROM `billetcommande` WHERE (`numBilletCommande`='" + numBilletCommande + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            billetCommande = new crlBilletCommande();
                            billetCommande.NumBilletCommande = this.reader["numBilletCommande"].ToString();
                            billetCommande.NumTrajet         = this.reader["numTrajet"].ToString();

                            billetCommande.NumProforma = this.reader["numProforma"].ToString();
                            try
                            {
                                billetCommande.MontantBilletCommande = double.Parse(this.reader["montantBilletCommande"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                billetCommande.NombreBilletCommande = int.Parse(this.reader["nombreBilletCommande"].ToString());
                            }
                            catch (Exception) { }
                            billetCommande.NumCalculCategorieBillet = this.reader["numCalculCategorieBillet"].ToString();
                            billetCommande.NumCalculReductionBillet = this.reader["numCalculReductionBillet"].ToString();
                            billetCommande.NumIndividu = this.reader["numIndividu"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (billetCommande != null)
                {
                    if (billetCommande.NumTrajet != "")
                    {
                        billetCommande.trajet = serviceTrajet.selectTrajet(billetCommande.NumTrajet);
                    }
                    if (billetCommande.NumCalculCategorieBillet != "")
                    {
                        billetCommande.calculCategorieBillet = serviceCalculCategorieBillet.selectCalculCategorieBillet(billetCommande.NumCalculCategorieBillet);
                    }
                    if (billetCommande.NumCalculReductionBillet != "")
                    {
                        billetCommande.calculReductionBillet = serviceCalculReductionBillet.selectCalculReductionBillet(billetCommande.NumCalculReductionBillet);
                    }
                    if (billetCommande.NumIndividu != "")
                    {
                        billetCommande.individu = serviceIndividu.selectIndividu(billetCommande.NumIndividu);
                    }
                }
            }
            #endregion

            return(billetCommande);
        }
Example #8
0
        DataTable IntfDalAbonnement.getDataTableAbonnement(string strRqst)
        {
            #region declaration
            DataTable    dataTable = new DataTable();
            crlOrganisme organisme = null;
            crlSociete   societe   = null;
            crlIndividu  individu  = null;

            IntfDalSociete   serviceSociete   = new ImplDalSociete();
            IntfDalOrganisme serviceOrganisme = new ImplDalOrganisme();
            IntfDalIndividu  serviceIndividu  = new ImplDalIndividu();
            string           telephone        = "";
            string           mobile           = "";
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numAbonnement", 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["numAbonnement"] = reader["numAbonnement"].ToString();

                        if (reader["numIndividu"].ToString() != "")
                        {
                            individu = serviceIndividu.selectIndividu(reader["numIndividu"].ToString());
                        }
                        if (reader["numOrganisme"].ToString() != "")
                        {
                            organisme = serviceOrganisme.selectOrganisme(reader["numOrganisme"].ToString());
                        }
                        if (reader["numSociete"].ToString() != "")
                        {
                            societe = serviceSociete.selectSociete(reader["numSociete"].ToString());
                        }

                        if (individu != null)
                        {
                            dr["client"] = individu.PrenomIndividu + " " + individu.NomIndividu;

                            dr["adresse"] = individu.Adresse;

                            dr["contact"] = individu.TelephoneFixeIndividu + " / " + individu.TelephoneMobileIndividu;

                            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;
                            }
                        }

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

            #endregion

            return(dataTable);
        }
Example #9
0
        crlAbonnement IntfDalAbonnement.selectAbonnement(string numAbonnement)
        {
            #region declaration
            IntfDalIndividu  serviceIndividu  = new ImplDalIndividu();
            IntfDalAgent     serviceAgent     = new ImplDalAgent();
            IntfDalOrganisme serviceOrganisme = new ImplDalOrganisme();
            IntfDalSociete   serviceSociete   = new ImplDalSociete();
            crlAbonnement    Abonnement       = null;
            #endregion

            #region implementation
            if (numAbonnement != "")
            {
                this.strCommande  = "SELECT * FROM `abonnement` WHERE `numAbonnement`='" + numAbonnement + "' OR";
                this.strCommande += " `numIndividu`='" + numAbonnement + "' OR `numSociete`='" + numAbonnement + "' OR";
                this.strCommande += " `numOrganisme`='" + numAbonnement + "'";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        Abonnement = new crlAbonnement();
                        if (this.reader.Read())
                        {
                            Abonnement.NumAbonnement  = this.reader["numAbonnement"].ToString();
                            Abonnement.NumIndividu    = this.reader["numIndividu"].ToString();
                            Abonnement.MatriculeAgent = this.reader["matriculeAgent"].ToString();
                            Abonnement.NumOrganisme   = this.reader["numOrganisme"].ToString();
                            Abonnement.NumSociete     = this.reader["numSociete"].ToString();
                            try
                            {
                                Abonnement.DateAbonnement = Convert.ToDateTime(this.reader["dateAbonnement"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            Abonnement.ImageAbonner = this.reader["imageAbonner"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (Abonnement != null)
                {
                    if (Abonnement.NumIndividu != "")
                    {
                        Abonnement.individu = serviceIndividu.selectIndividu(Abonnement.NumIndividu);
                    }
                    if (Abonnement.MatriculeAgent != "")
                    {
                        Abonnement.agent = serviceAgent.selectAgent(Abonnement.MatriculeAgent);
                    }
                    if (Abonnement.NumOrganisme != "")
                    {
                        Abonnement.organisme = serviceOrganisme.selectOrganisme(Abonnement.NumOrganisme);
                    }
                    if (Abonnement.NumSociete != "")
                    {
                        Abonnement.societe = serviceSociete.selectSociete(Abonnement.NumSociete);
                    }
                }
            }
            #endregion

            return(Abonnement);
        }
Example #10
0
        crlSociete IntfDalSociete.selectSociete(string numSociete)
        {
            #region declaration
            crlSociete      societe         = null;
            IntfDalIndividu serviceIndividu = new ImplDalIndividu();
            #endregion

            #region implementation
            if (numSociete != "")
            {
                this.strCommande = "SELECT * FROM `societe` WHERE `numSociete`='" + numSociete + "'";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            societe = new crlSociete();
                            societe.AdresseSociete         = this.reader["adresseSociete"].ToString();
                            societe.NumQuartier            = this.reader["numQuartier"].ToString();
                            societe.MailSociete            = this.reader["mailSociete"].ToString();
                            societe.NomSociete             = this.reader["nomSociete"].ToString();
                            societe.NumSociete             = this.reader["numSociete"].ToString();
                            societe.SecteurActiviteSociete = this.reader["secteurActiviteSociete"].ToString();
                            societe.TelephoneFixeSociete   = this.reader["telephoneFixeSociete"].ToString();
                            societe.TelephoneMobileSociete = this.reader["telephoneMobileSociete"].ToString();
                            try
                            {
                                societe.IsReductionUS = int.Parse(this.reader["isReductionUS"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            societe.NumIndividuResponsable = this.reader["numIndividuResponsable"].ToString();
                            try
                            {
                                societe.IsCheque = int.Parse(this.reader["isCheque"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                societe.IsBonCommande = int.Parse(this.reader["isBonCommande"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (societe != null)
                {
                    if (societe.NumIndividuResponsable != "")
                    {
                        societe.individuResponsable = serviceIndividu.selectIndividu(societe.NumIndividuResponsable);
                    }
                }
            }
            #endregion

            return(societe);
        }
Example #11
0
        crlEtablissementScolaire IntfDalEtablissementScolaire.selectEtablissementScolaire(string numEtablissementScolaire)
        {
            #region declaration
            crlEtablissementScolaire etablissementScolaire = null;
            IntfDalIndividu          serviceIndividu       = new ImplDalIndividu();
            #endregion

            #region implementation
            if (numEtablissementScolaire != "")
            {
                this.strCommande = "SELECT * FROM `etablissementscolaire` WHERE `numEtablissementScolaire`='" + numEtablissementScolaire + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            etablissementScolaire = new crlEtablissementScolaire();
                            etablissementScolaire.AdresseEtablissementScolaire           = this.reader["adresseEtablissementScolaire"].ToString();
                            etablissementScolaire.EtablissementScolaire                  = this.reader["etablissementScolaire"].ToString();
                            etablissementScolaire.MailEtablissementScolaire              = this.reader["mailEtablissementScolaire"].ToString();
                            etablissementScolaire.NumEtablissementScolaire               = this.reader["numEtablissementScolaire"].ToString();
                            etablissementScolaire.TelephoneFixeEtablissementScolaire     = this.reader["telephoneFixeEtablissementScolaire"].ToString();
                            etablissementScolaire.TelephonePortableEtablissementScolaire = this.reader["telephonePortableEtablissementScolaire"].ToString();
                            etablissementScolaire.TypeEtablissementScolaire              = this.reader["typeEtablissementScolaire"].ToString();
                            etablissementScolaire.SecteurEtablissementScolaire           = this.reader["secteurEtablissementScolaire"].ToString();
                            etablissementScolaire.NumQuartier            = this.reader["numQuartier"].ToString();
                            etablissementScolaire.NumIndividuResponsable = this.reader["numIndividuResponsable"].ToString();
                            try
                            {
                                etablissementScolaire.IsCheque = int.Parse(this.reader["isCheque"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                etablissementScolaire.IsBonCommande = int.Parse(this.reader["isBonCommande"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (etablissementScolaire != null)
                {
                    if (etablissementScolaire.NumIndividuResponsable != "")
                    {
                        etablissementScolaire.individuResponsable = serviceIndividu.selectIndividu(etablissementScolaire.NumIndividuResponsable);
                    }
                }
            }
            #endregion

            return(etablissementScolaire);
        }
Example #12
0
        crlProprietaire IntfDalProprietaire.selectProprietaire(string numProprietaire)
        {
            #region declaration
            crlProprietaire proprietaire = null;

            IntfDalIndividu         serviceIndividu         = new ImplDalIndividu();
            IntfDalTypeProprietaire serviceTypeProprietaire = new ImplDalTypeProprietaire();
            IntfDalAgence           serviceAgence           = new ImplDalAgence();
            IntfDalSociete          serviceSociete          = new ImplDalSociete();
            IntfDalOrganisme        serviceOrganisme        = new ImplDalOrganisme();
            #endregion

            #region implementation
            if (numProprietaire != "")
            {
                this.strCommande = "SELECT * FROM `proprietaire` WHERE (`numProprietaire`='" + numProprietaire + "')";

                this.serviceConnection.openConnection();
                if (this.serviceConnection.IsConnection)
                {
                    this.reader = this.serviceConnection.select(this.strCommande);
                    if (this.reader != null)
                    {
                        if (this.reader.HasRows)
                        {
                            if (this.reader.Read())
                            {
                                proprietaire = new crlProprietaire();
                                proprietaire.NumProprietaire  = this.reader["numProprietaire"].ToString();
                                proprietaire.NumIndividu      = this.reader["numIndividu"].ToString();
                                proprietaire.NumOrganisme     = this.reader["numOrganisme"].ToString();
                                proprietaire.NumSociete       = this.reader["numSociete"].ToString();
                                proprietaire.TypeProprietaire = this.reader["typeProprietaire"].ToString();
                                proprietaire.NumAgence        = this.reader["numAgence"].ToString();
                            }
                        }
                        this.reader.Dispose();
                    }

                    while (this.serviceConnection.IsConnection)
                    {
                        this.serviceConnection.closeConnection();
                    }
                }

                if (proprietaire != null)
                {
                    if (proprietaire.NumIndividu != "")
                    {
                        proprietaire.Individu = serviceIndividu.selectIndividu(proprietaire.NumIndividu);
                    }
                    if (proprietaire.TypeProprietaire != "")
                    {
                        proprietaire.typeProprietaireObj = serviceTypeProprietaire.selectTypeProprietaire(proprietaire.TypeProprietaire);
                    }
                    if (proprietaire.NumAgence != "")
                    {
                        proprietaire.agence = serviceAgence.selectAgence(proprietaire.NumAgence);
                    }
                    if (proprietaire.NumOrganisme != "")
                    {
                        proprietaire.organisme = serviceOrganisme.selectOrganisme(proprietaire.NumOrganisme);
                    }
                    if (proprietaire.NumSociete != "")
                    {
                        proprietaire.societe = serviceSociete.selectSociete(proprietaire.NumSociete);
                    }
                }
            }
            #endregion

            return(proprietaire);
        }
Example #13
0
        crlBillet IntfDalBillet.isValide(string numBillet, string idItineraire)
        {
            #region declaration
            crlBillet       Billet          = null;
            IntfDalTrajet   serviceTrajet   = new ImplDalTrajet();
            IntfDalIndividu serviceIndividu = new ImplDalIndividu();
            IntfDalAgent    serviceAgent    = new ImplDalAgent();
            IntfDalCalculCategorieBillet serviceCalculCategorieBillet = new ImplDalCalculCategorieBillet();
            IntfDalCalculReductionBillet serviceCalculReductionBillet = new ImplDalCalculReductionBillet();
            #endregion

            #region implementation
            if (numBillet != "")
            {
                this.strCommande  = "SELECT billet.numBillet, billet.dateDeValidite, billet.numTrajet,";
                this.strCommande += " billet.modePaiement, billet.numIndividu, billet.matriculeAgent, billet.prixBillet,";
                this.strCommande += " billet.numCalculCategorieBillet, billet.numCalculReductionBillet, billet.dateBillet,";
                this.strCommande += " billet.numDureeAbonnement, billet.numVoyageAbonnement, billet.numBilletCommande FROM billet";
                this.strCommande += " Left Join voyage ON voyage.numBillet = billet.numBillet";
                this.strCommande += " Inner Join trajet ON trajet.numTrajet = billet.numTrajet";
                this.strCommande += " Inner Join associationtrajetitineraire ON associationtrajetitineraire.numTrajet = trajet.numTrajet";
                this.strCommande += " WHERE voyage.numBillet IS NULL  AND";
                this.strCommande += " billet.numBillet =  '" + numBillet + "' AND";
                this.strCommande += " billet.dateDeValidite >=  '" + DateTime.Now.ToString("yyyyMMdd") + "' AND";
                this.strCommande += " associationtrajetitineraire.idItineraire = '" + idItineraire + "'";

                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        if (reader.Read())
                        {
                            Billet                          = new crlBillet();
                            Billet.NumBillet                = reader["numBillet"].ToString();
                            Billet.DateDeValidite           = Convert.ToDateTime(reader["dateDeValidite"].ToString());
                            Billet.NumTrajet                = reader["numTrajet"].ToString();
                            Billet.ModePaiement             = reader["modePaiement"].ToString();
                            Billet.NumIndividu              = reader["numIndividu"].ToString();
                            Billet.MatriculeAgent           = reader["matriculeAgent"].ToString();
                            Billet.PrixBillet               = reader["prixBillet"].ToString();
                            Billet.NumCalculCategorieBillet = reader["numCalculCategorieBillet"].ToString();
                            Billet.NumCalculReductionBillet = reader["numCalculReductionBillet"].ToString();
                            Billet.DateBillet               = Convert.ToDateTime(reader["dateBillet"].ToString());
                            Billet.NumDureeAbonnement       = reader["numDureeAbonnement"].ToString();
                            Billet.NumVoyageAbonnement      = reader["numVoyageAbonnement"].ToString();
                            Billet.NumBilletCommande        = reader["numBilletCommande"].ToString();
                        }
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (Billet != null)
                {
                    if (Billet.NumTrajet != "")
                    {
                        Billet.trajet = serviceTrajet.selectTrajet(Billet.NumTrajet);
                    }
                    if (Billet.NumIndividu != "")
                    {
                        Billet.individu = serviceIndividu.selectIndividu(Billet.NumIndividu);
                    }
                    if (Billet.MatriculeAgent != "")
                    {
                        Billet.agent = serviceAgent.selectAgent(Billet.MatriculeAgent);
                    }
                    if (Billet.NumCalculCategorieBillet != "")
                    {
                        Billet.calculCategorieBillet = serviceCalculCategorieBillet.selectCalculCategorieBillet(Billet.NumCalculCategorieBillet);
                    }
                    if (Billet.NumCalculReductionBillet != "")
                    {
                        Billet.calculReductionBillet = serviceCalculReductionBillet.selectCalculReductionBillet(Billet.NumCalculReductionBillet);
                    }
                }
            }
            #endregion

            return(Billet);
        }
Example #14
0
        crlBillet IntfDalBillet.selectBillet(string numBillet)
        {
            #region declaration
            crlBillet       Billet          = null;
            IntfDalTrajet   serviceTrajet   = new ImplDalTrajet();
            IntfDalIndividu serviceIndividu = new ImplDalIndividu();
            IntfDalAgent    serviceAgent    = new ImplDalAgent();
            IntfDalCalculCategorieBillet serviceCalculCategorieBillet = new ImplDalCalculCategorieBillet();
            IntfDalCalculReductionBillet serviceCalculReductionBillet = new ImplDalCalculReductionBillet();
            #endregion

            #region implementation
            if (numBillet != "")
            {
                this.strCommande = "SELECT * FROM `billet` WHERE (`numBillet`='" + numBillet + "')";

                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        if (reader.Read())
                        {
                            Billet                          = new crlBillet();
                            Billet.NumBillet                = reader["numBillet"].ToString();
                            Billet.DateDeValidite           = Convert.ToDateTime(reader["dateDeValidite"].ToString());
                            Billet.NumTrajet                = reader["numTrajet"].ToString();
                            Billet.ModePaiement             = reader["modePaiement"].ToString();
                            Billet.NumIndividu              = reader["numIndividu"].ToString();
                            Billet.MatriculeAgent           = reader["matriculeAgent"].ToString();
                            Billet.PrixBillet               = reader["prixBillet"].ToString();
                            Billet.NumCalculCategorieBillet = reader["numCalculCategorieBillet"].ToString();
                            Billet.NumCalculReductionBillet = reader["numCalculReductionBillet"].ToString();
                            Billet.DateBillet               = Convert.ToDateTime(reader["dateBillet"].ToString());
                            Billet.NumDureeAbonnement       = reader["numDureeAbonnement"].ToString();
                            Billet.NumVoyageAbonnement      = reader["numVoyageAbonnement"].ToString();
                            Billet.NumBilletCommande        = reader["numBilletCommande"].ToString();
                        }
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (Billet != null)
                {
                    if (Billet.NumTrajet != "")
                    {
                        Billet.trajet = serviceTrajet.selectTrajet(Billet.NumTrajet);
                    }
                    if (Billet.NumIndividu != "")
                    {
                        Billet.individu = serviceIndividu.selectIndividu(Billet.NumIndividu);
                    }
                    if (Billet.MatriculeAgent != "")
                    {
                        Billet.agent = serviceAgent.selectAgent(Billet.MatriculeAgent);
                    }
                    if (Billet.NumCalculCategorieBillet != "")
                    {
                        Billet.calculCategorieBillet = serviceCalculCategorieBillet.selectCalculCategorieBillet(Billet.NumCalculCategorieBillet);
                    }
                    if (Billet.NumCalculReductionBillet != "")
                    {
                        Billet.calculReductionBillet = serviceCalculReductionBillet.selectCalculReductionBillet(Billet.NumCalculReductionBillet);
                    }
                }
            }
            #endregion

            return(Billet);
        }