Ejemplo n.º 1
0
        string IntfDalClient.insertClient(crlClient Client, string sigleAgence)
        {
            #region declaration
            IntfDalClient serviceClient   = new ImplDalClient();
            int           nombreInsertion = 0;
            string        numClient       = "";
            #endregion

            #region implementation
            if (Client != null)
            {
                Client.NumClient  = serviceClient.getNumClient(sigleAgence);
                this.strCommande  = "INSERT INTO `client` (`numClient`,`nomClient`";
                this.strCommande += ",`prenomClient`,`adresseClient`,`cinClient`,`telephoneClient`,`mobileClient`";
                this.strCommande += ",`isCheque`,`isBonCommande`)";
                this.strCommande += " VALUES ('" + Client.NumClient + "','" + Client.NomClient + "'";
                this.strCommande += ",'" + Client.PrenomClient + "','" + Client.AdresseClient + "'";
                this.strCommande += ",'" + Client.CinClient + "','" + Client.TelephoneClient + "','" + Client.MobileClient + "'";
                this.strCommande += ",'" + Client.IsCheque + "','" + Client.IsBonCommande + "')";

                this.serviceConnectBase.openConnection();
                nombreInsertion = this.serviceConnectBase.requete(this.strCommande);
                if (nombreInsertion == 1)
                {
                    numClient = Client.NumClient;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numClient);
        }
Ejemplo n.º 2
0
        void IntfDalClient.insertToGridClient(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalClient serviceClient = new ImplDalClient();
            #endregion

            #region implementation
            this.strCommande  = "SELECT client.numClient, client.nomClient, client.prenomClient, client.adresseClient,";
            this.strCommande += " client.cinClient, client.telephoneClient, client.mobileClient FROM client";
            this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param + " ASC";

            gridView.DataSource = serviceClient.getDataTableClient(this.strCommande);
            gridView.DataBind();
            #endregion
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
0
        List <crlCommission> IntfDalFicheBord.getCommission(string numerosFB)
        {
            #region declaration
            List <crlCommission>         Commissions     = new List <crlCommission>();
            crlCommission                tempCommission  = null;
            IntfDalReceptionnaire        servicePersonne = new ImplDalReceptionnaire();
            IntfDalRecu                  serviceRecu     = new ImplDalRecu();
            IntfDalClient                serviceClient   = new ImplDalClient();
            IntfDalDesignationCommission serviceDesignationCommission = new ImplDalDesignationCommission();
            IntfDalAgent                 serviceAgent = new ImplDalAgent();
            #endregion

            #region implementation
            if (numerosFB != "")
            {
                this.strCommande  = "SELECT * FROM commission";
                this.strCommande += " Inner Join associationfichebordcommission ON associationfichebordcommission.idCommission = commission.idCommission";
                this.strCommande += " WHERE (associationfichebordcommission.numerosFB ='" + numerosFB + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        while (this.reader.Read())
                        {
                            tempCommission = new crlCommission();
                            tempCommission.IdCommission = reader["idCommission"].ToString();
                            tempCommission.Destination  = reader["destination"].ToString();
                            tempCommission.Poids        = reader["poids"].ToString();
                            try
                            {
                                tempCommission.Nombre = int.Parse(reader["nombre"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                tempCommission.IsRecu = int.Parse(reader["isRecu"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            tempCommission.PieceJustificatif = reader["pieceJustificatif"].ToString();
                            tempCommission.FraisEnvoi        = reader["fraisEnvoi"].ToString();
                            tempCommission.NumExpediteur     = reader["numExpediteur"].ToString();
                            tempCommission.NumRecepteur      = reader["numRecepteur"].ToString();
                            tempCommission.NumDesignation    = reader["numDesignation"].ToString();
                            tempCommission.TypeCommission    = reader["typeCommission"].ToString();
                            tempCommission.NumTrajet         = reader["numTrajet"].ToString();
                            try
                            {
                                tempCommission.DateCommission = Convert.ToDateTime(reader["dateCommission"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                tempCommission.DateLivraison = Convert.ToDateTime(reader["dateLivraison"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            tempCommission.MatriculeAgent          = reader["matriculeAgent"].ToString();
                            tempCommission.MatriculeAgentDelivreur = reader["matriculeAgentDelivreur"].ToString();
                            tempCommission.ModePaiement            = reader["modePaiement"].ToString();


                            Commissions.Add(tempCommission);
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                for (int i = 0; i < Commissions.Count; i++)
                {
                    if (Commissions[i] != null)
                    {
                        Commissions[i].expediteur                        = serviceClient.selectClient(Commissions[i].NumExpediteur);
                        Commissions[i].recepteur                         = servicePersonne.selectPersonne(Commissions[i].NumRecepteur);
                        Commissions[i].designationCommission             = serviceDesignationCommission.selectDesignationCommission(Commissions[i].NumDesignation);
                        Commissions[i].typeCommssionObjet                = new crlTypeCommssion();
                        Commissions[i].typeCommssionObjet.TypeCommission = Commissions[i].TypeCommission;
                        Commissions[i].agent          = serviceAgent.selectAgent(Commissions[i].MatriculeAgent);
                        Commissions[i].agentDelivreur = serviceAgent.selectAgent(Commissions[i].MatriculeAgentDelivreur);
                    }
                }
            }
            #endregion

            return(Commissions);
        }
Ejemplo n.º 5
0
        crlCommissionDevis IntfDalCommissionDevis.selectCommissionDevis(string idCommissionDevis)
        {
            #region initialisation
            IntfDalDesignationCommission serviceDesignationCommission = new ImplDalDesignationCommission();
            IntfDalTrajet         serviceTrajet         = new ImplDalTrajet();
            IntfDalClient         serviceClient         = new ImplDalClient();
            IntfDalReceptionnaire serviceReceptionnaire = new ImplDalReceptionnaire();

            crlCommissionDevis CommissionDevis = null;
            #endregion

            #region implementation
            if (idCommissionDevis != "")
            {
                this.strCommande = "SELECT * FROM `commissiondevis` WHERE (`idCommissionDevis`='" + idCommissionDevis + "')";
                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        reader.Read();
                        CommissionDevis             = new crlCommissionDevis();
                        CommissionDevis.Destination = reader["destination"].ToString();
                        try
                        {
                            CommissionDevis.FraisEnvoi = double.Parse(reader["fraisEnvoi"].ToString());
                        }
                        catch (Exception) { }
                        CommissionDevis.IdCommissionDevis = reader["idCommissionDevis"].ToString();
                        CommissionDevis.PieceJustificatif = reader["pieceJustificatif"].ToString();
                        try
                        {
                            CommissionDevis.Poids = double.Parse(reader["poids"].ToString());
                        }
                        catch (Exception) { }
                        CommissionDevis.TypeCommission = reader["typeCommission"].ToString();
                        CommissionDevis.NumDesignation = reader["numDesignation"].ToString();
                        try
                        {
                            CommissionDevis.Nombre = int.Parse(reader["nombre"].ToString());
                        }
                        catch (Exception) { }
                        CommissionDevis.NumTrajet     = reader["numTrajet"].ToString();
                        CommissionDevis.NumProforma   = reader["numProforma"].ToString();
                        CommissionDevis.NumExpediteur = reader["numExpediteur"].ToString();
                        CommissionDevis.NumRecepteur  = reader["numRecepteur"].ToString();
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (CommissionDevis != null)
                {
                    if (CommissionDevis.NumDesignation != "")
                    {
                        CommissionDevis.designationCommission = serviceDesignationCommission.selectDesignationCommission(CommissionDevis.NumDesignation);
                    }
                    if (CommissionDevis.NumTrajet != "")
                    {
                        CommissionDevis.trajet = serviceTrajet.selectTrajet(CommissionDevis.NumTrajet);
                    }
                    if (CommissionDevis.NumExpediteur != "")
                    {
                        CommissionDevis.expediteur = serviceClient.selectClient(CommissionDevis.NumExpediteur);
                    }
                    if (CommissionDevis.NumRecepteur != "")
                    {
                        CommissionDevis.recepteur = serviceReceptionnaire.selectPersonne(CommissionDevis.NumRecepteur);
                    }
                }
            }
            #endregion

            return(CommissionDevis);
        }
Ejemplo n.º 6
0
        crlUSCarteReduction IntfDalUSCarteReduction.selectUSCarteReduction(string numCarteReduction)
        {
            #region declaration
            crlUSCarteReduction carteReduction = null;
            IntfDalClient serviceClient = new ImplDalClient();
            IntfDalUSCategorieBillet serviceUSCategorieBillet = new ImplDalUSCategorieBillet();
            #endregion

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

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            carteReduction = new crlUSCarteReduction();
                            try
                            {
                                carteReduction.DateValideAu = Convert.ToDateTime(this.reader["dateValideAu"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.DateValideDu = Convert.ToDateTime(this.reader["dateValideDu"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsDimanche = int.Parse(this.reader["isDimanche"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsJeudi = int.Parse(this.reader["isJeudi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsLundi = int.Parse(this.reader["isLundi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsMardi = int.Parse(this.reader["isMardi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsMercredi = int.Parse(this.reader["isMercredi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsSamedi = int.Parse(this.reader["isSamedi"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.IsVendredi = int.Parse(this.reader["isVendredi"].ToString());
                            }
                            catch (Exception) { }
                            carteReduction.NumCarteReduction = this.reader["numCarteReduction"].ToString();
                            carteReduction.NumCategorieBillet = this.reader["numCategorieBillet"].ToString();
                            carteReduction.NumClient = this.reader["numClient"].ToString();
                            carteReduction.EtatCivil = this.reader["etatCivil"].ToString();
                            try
                            {
                                carteReduction.DateNaissance = Convert.ToDateTime(this.reader["dateNaissance"].ToString());
                            }
                            catch (Exception) { }
                            try
                            {
                                carteReduction.DateDelivranceCertificatScolarite = Convert.ToDateTime(this.reader["dateDelivranceCertificatScolarite"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            try
                            {
                                carteReduction.DateAtestationEmployeur = Convert.ToDateTime(this.reader["dateAtestationEmployeur"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            carteReduction.ImageCarteReduction = this.reader["imageCarteReduction"].ToString();
                            carteReduction.NumEtablissementScolaire = this.reader["numEtablissementScolaire"].ToString();
                            carteReduction.NumSociete = this.reader["numSociete"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (carteReduction != null) 
                {
                    if (carteReduction.NumCategorieBillet != "") 
                    {
                        carteReduction.categorieBillet = serviceUSCategorieBillet.selectUSCategorieBillet(carteReduction.NumCategorieBillet);
                    }
                    if (carteReduction.NumClient != "") 
                    {
                        carteReduction.client = serviceClient.selectClient(carteReduction.NumClient);
                    }
                }
            }
            #endregion

            return carteReduction;
        }