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);
        }
Exemple #2
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);
        }
Exemple #3
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);
        }
Exemple #4
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);
        }