예제 #1
0
        string IntfDalSociete.insertSociete(crlSociete societe, string sigleAgence)
        {
            #region declaration
            string         numSociete     = "";
            int            nbInsert       = 0;
            IntfDalSociete serviceSociete = new ImplDalSociete();
            #endregion

            #region impelementation
            if (societe != null && sigleAgence != "")
            {
                societe.NumSociete = serviceSociete.getNumSociete(sigleAgence);
                this.strCommande   = "INSERT INTO `societe` (`numSociete`,`nomSociete`,`adresseSociete`,`numQuartier`,";
                this.strCommande  += " `telephoneFixeSociete`,`telephoneMobileSociete`,`mailSociete`,";
                this.strCommande  += " `secteurActiviteSociete`,`isReductionUS`,`numIndividuResponsable`,";
                this.strCommande  += " `isCheque`,`isBonCommande`) VALUES";
                this.strCommande  += " ('" + societe.NumSociete + "','" + societe.NomSociete + "',";
                this.strCommande  += " '" + societe.AdresseSociete + "','" + societe.NumQuartier + "',";
                this.strCommande  += " '" + societe.TelephoneFixeSociete + "','" + societe.TelephoneMobileSociete + "',";
                this.strCommande  += " '" + societe.MailSociete + "','" + societe.SecteurActiviteSociete + "',";
                this.strCommande  += " '" + societe.IsReductionUS + "','" + societe.NumIndividuResponsable + "',";
                this.strCommande  += " '" + societe.IsCheque + "','" + societe.IsBonCommande + "')";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numSociete = societe.NumSociete;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numSociete);
        }
예제 #2
0
        void IntfDalSociete.insertToGridSocieteReduction(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalSociete serviceSociete = new ImplDalSociete();
            #endregion

            #region implementation

            this.strCommande  = "SELECT societe.numSociete, societe.nomSociete, societe.adresseSociete,";
            this.strCommande += " societe.numQuartier, societe.telephoneFixeSociete, societe.telephoneMobileSociete,";
            this.strCommande += " societe.mailSociete, societe.secteurActiviteSociete, societe.numIndividuResponsable,";
            this.strCommande += " societe.isReductionUS, individu.numIndividu, individu.civiliteIndividu,";
            this.strCommande += " individu.nomIndividu, individu.prenomIndividu, individu.cinIndividu,";
            this.strCommande += " individu.adresse, individu.profession, individu.telephoneFixeIndividu,";
            this.strCommande += " individu.telephoneMobileIndividu, individu.dateNaissanceIndividu,";
            this.strCommande += " individu.lieuNaissanceIndividu, individu.mailIndividu, individu.numQuartier,";
            this.strCommande += " quartier.quartier FROM societe";
            this.strCommande += " Inner Join individu ON individu.numIndividu = societe.numIndividuResponsable";
            this.strCommande += " Inner Join quartier ON quartier.numQuartier = societe.numQuartier";
            this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%' AND";
            this.strCommande += " societe.isReductionUS > '0'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceSociete.getDataTableSocieteReduction(this.strCommande);
            gridView.DataBind();

            #endregion
        }
예제 #3
0
        string IntfDalSociete.insertSociete(crlSociete societe, string sigleAgence, HtmlGenericControl divIndication)
        {
            #region declaration
            string          numSociete      = "";
            string          strIndication   = "";
            IntfDalIndividu serviceIndividu = new ImplDalIndividu();
            IntfDalSociete  serviceSociete  = new ImplDalSociete();
            #endregion

            #region implementation
            divIndication.Style.Add("font-size", "14px");
            divIndication.Style.Add("color", "Red");
            if (societe != null)
            {
                if (societe.individuResponsable != null)
                {
                    societe.NumIndividuResponsable = serviceIndividu.insertIndividu(societe.individuResponsable, sigleAgence, divIndication);
                    if (societe.NumIndividuResponsable != "")
                    {
                        societe.NumSociete = serviceSociete.isSociete(societe);
                        if (societe.NumSociete.Equals(""))
                        {
                            societe.NumSociete = serviceSociete.insertSociete(societe, sigleAgence);
                            if (societe.NumSociete.Equals(""))
                            {
                                strIndication           = "Une erreur ce produit durant l'enregistrement!";
                                divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                            }
                            else
                            {
                                numSociete = societe.NumSociete;
                            }
                        }
                        else
                        {
                            if (serviceSociete.updateSociete(societe))
                            {
                                numSociete = societe.NumSociete;
                            }
                            else
                            {
                                strIndication           = "Une erreur ce produit durant l'enregistrement!";
                                divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                            }
                        }
                    }
                }
                else
                {
                    strIndication           = "Une erreur ce produit durant l'enregistrement!";
                    divIndication.InnerHtml = "<p>" + strIndication + "</p>";
                }
            }
            #endregion

            return(numSociete);
        }
예제 #4
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);
        }
예제 #5
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);
        }
예제 #6
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);
        }
예제 #7
0
        bool IntfDalAbonnement.updateAbonnementAll(crlAbonnement Abonnement)
        {
            #region declaration
            bool              isUpdate          = false;
            string            numAbonnement     = "";
            string            numSociete        = "";
            string            numOrganisme      = "";
            string            numClient         = "";
            IntfDalAbonnement serviceAbonnement = new ImplDalAbonnement();
            IntfDalSociete    serviceSociete    = new ImplDalSociete();
            IntfDalOrganisme  serviceOrganisme  = new ImplDalOrganisme();
            IntfDalIndividu   serviceIndividu   = new ImplDalIndividu();
            #endregion

            #region implementation
            if (Abonnement != null)
            {
                if (Abonnement.agent != null)
                {
                    #region client
                    if (Abonnement.individu != null)
                    {
                        if (Abonnement.individu.NumIndividu != "")
                        {
                            numClient = serviceIndividu.isIndividu(Abonnement.individu);
                            if (numClient == "")
                            {
                                serviceIndividu.updateIndividu(Abonnement.individu);
                            }
                        }
                        else
                        {
                            Abonnement.individu.NumIndividu = serviceIndividu.isIndividu(Abonnement.individu);
                            if (Abonnement.individu.NumIndividu == "")
                            {
                                Abonnement.individu.NumIndividu = serviceIndividu.insertIndividu(Abonnement.individu, Abonnement.agent.agence.SigleAgence);
                            }
                            else
                            {
                                serviceIndividu.updateIndividu(Abonnement.individu);
                            }
                        }

                        if (Abonnement.individu.NumIndividu != "")
                        {
                            Abonnement.NumIndividu = Abonnement.individu.NumIndividu;
                        }
                    }
                    #endregion

                    #region SOciete
                    if (Abonnement.societe != null)
                    {
                        if (Abonnement.societe.NumSociete != "")
                        {
                            numSociete = serviceSociete.isSociete(Abonnement.societe);
                            if (numSociete == "")
                            {
                                serviceSociete.updateSociete(Abonnement.societe);
                            }
                        }
                        else
                        {
                            Abonnement.societe.NumSociete = serviceSociete.isSociete(Abonnement.societe);
                            if (Abonnement.societe.NumSociete == "")
                            {
                                Abonnement.societe.NumSociete = serviceSociete.insertSociete(Abonnement.societe, Abonnement.agent.agence.SigleAgence);
                            }
                            else
                            {
                                serviceSociete.updateSociete(Abonnement.societe);
                            }
                        }



                        if (Abonnement.societe.NumSociete != "")
                        {
                            Abonnement.NumSociete = Abonnement.societe.NumSociete;
                        }
                    }

                    #endregion

                    #region Organisme
                    if (Abonnement.organisme != null)
                    {
                        if (Abonnement.organisme.NumOrganisme != "")
                        {
                            numOrganisme = serviceOrganisme.isOrganisme(Abonnement.organisme);
                            if (numOrganisme == "")
                            {
                                serviceOrganisme.updateOrganisme(Abonnement.organisme);
                            }
                        }
                        else
                        {
                            Abonnement.organisme.NumOrganisme = serviceOrganisme.isOrganisme(Abonnement.organisme);
                            if (Abonnement.organisme.NumOrganisme == "")
                            {
                                Abonnement.organisme.NumOrganisme = serviceOrganisme.insertOrganisme(Abonnement.organisme, Abonnement.agent.agence.SigleAgence);
                            }
                            else
                            {
                                serviceOrganisme.updateOrganisme(Abonnement.organisme);
                            }
                        }

                        if (Abonnement.organisme.NumOrganisme != "")
                        {
                            Abonnement.NumOrganisme = Abonnement.organisme.NumOrganisme;
                        }
                    }
                    #endregion

                    if (Abonnement.MatriculeAgent != "")
                    {
                        numAbonnement = serviceAbonnement.isAbonnement(Abonnement);

                        if (numAbonnement == "")
                        {
                            isUpdate = serviceAbonnement.updateAbonnement(Abonnement);
                        }
                    }
                }
            }
            #endregion

            return(isUpdate);
        }
예제 #8
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);
        }