예제 #1
0
        string IntfDalAgent.insertAgent(crlAgent Agent)
        {
            #region declaration
            IntfDalAgent serviceAgent    = new ImplDalAgent();
            int          nombreInsertion = 0;
            string       matriculeAgent  = "";
            #endregion

            #region implementation
            if (Agent != null)
            {
                if (Agent.agence != null)
                {
                    Agent.matriculeAgent = serviceAgent.getMatriculeAgent(Agent.agence.SigleAgence);
                    this.strCommande     = "INSERT INTO `agent` (`matriculeAgent`,`numAgence`,`typeAgent`,`nomAgent`,`prenomAgent`,";
                    this.strCommande    += "`dateNaissanceAgent`, `lieuNaissanceAgent`,`loginAgent`,`motDePasseAgent`,`cinAgent`,`adresseAgent`,";
                    this.strCommande    += "`telephoneAgent`,`telephoneMobileAgent`,`imageAgent`,`situationFamilialeAgent`) VALUES ('" + Agent.matriculeAgent + "','" + Agent.numAgence + "',";
                    this.strCommande    += "'" + Agent.typeAgent + "', '" + Agent.nomAgent + "', '" + Agent.prenomAgent + "', '" + Agent.dateNaissanceAgent.ToString("yyyy-MM-dd") + "',";
                    this.strCommande    += "'" + Agent.lieuNaissanceAgent + "', '" + Agent.loginAgent + "', '" + Agent.motDePasseAgent + "', '" + Agent.cinAgent + "',";
                    this.strCommande    += "'" + Agent.adresseAgent + "', '" + Agent.telephoneAgent + "', '" + Agent.telephoneMobileAgent + "','" + Agent.ImageAgent + "',";
                    this.strCommande    += "'" + Agent.SituationFamilialeAgent + "')";

                    this.serviceConnectBase.openConnection();
                    nombreInsertion = this.serviceConnectBase.requete(this.strCommande);
                    if (nombreInsertion == 1)
                    {
                        matriculeAgent = Agent.matriculeAgent;
                    }
                    this.serviceConnectBase.closeConnection();
                }
            }
            #endregion

            return(matriculeAgent);
        }
예제 #2
0
        bool IntfDalAgent.updateAgent(crlAgent Agent)
        {
            #region declaration
            bool isUpdate     = false;
            int  nombreUpdate = 0;
            #endregion

            #region implementation
            if (Agent != null)
            {
                if (Agent.matriculeAgent != "")
                {
                    this.strCommande  = "UPDATE `agent` SET `adresseAgent`='" + Agent.adresseAgent + "', `cinAgent`='" + Agent.cinAgent + "',";
                    this.strCommande += " `dateNaissanceAgent`='" + Agent.dateNaissanceAgent.ToString("yyyy-MM-dd") + "', `lieuNaissanceAgent`='" + Agent.lieuNaissanceAgent + "',";
                    this.strCommande += " `loginAgent`='" + Agent.loginAgent + "', `motDePasseAgent`='" + Agent.motDePasseAgent + "',";
                    this.strCommande += " `nomAgent`='" + Agent.nomAgent + "', `numAgence`='" + Agent.numAgence + "', `prenomAgent`='" + Agent.prenomAgent + "',";
                    this.strCommande += " `telephoneAgent`='" + Agent.telephoneAgent + "', `telephoneMobileAgent`='" + Agent.telephoneMobileAgent + "', `typeAgent`='" + Agent.typeAgent + "',";
                    this.strCommande += " `imageAgent`='" + Agent.ImageAgent + "', `situationFamilialeAgent`='" + Agent.SituationFamilialeAgent + "'";
                    this.strCommande += " WHERE (`matriculeAgent`='" + Agent.matriculeAgent + "')";

                    this.serviceConnectBase.openConnection();
                    nombreUpdate = this.serviceConnectBase.requete(this.strCommande);
                    if (nombreUpdate == 1)
                    {
                        isUpdate = true;
                    }
                    this.serviceConnectBase.closeConnection();
                }
            }
            #endregion

            return(isUpdate);
        }
예제 #3
0
        bool IntfDalAgent.deleteAgent(crlAgent Agent)
        {
            #region declaration
            bool isDelete     = false;
            int  nombreDelete = 0;
            #endregion

            #region implementation
            if (Agent != null)
            {
                if (Agent.matriculeAgent != "")
                {
                    this.strCommande = "DELETE FROM `agent` WHERE (`matriculeAgent` = '" + Agent.matriculeAgent + "')";
                    this.serviceConnectBase.openConnection();
                    nombreDelete = this.serviceConnectBase.requete(this.strCommande);
                    if (nombreDelete == 1)
                    {
                        isDelete = true;
                    }
                    this.serviceConnectBase.closeConnection();
                }
            }
            #endregion

            return(isDelete);
        }
예제 #4
0
        private void afficheAgent(string matriculeAgent)
        {
            #region declaration
            crlAgent agent = null;
            #endregion

            #region implementation
            if (matriculeAgent != "")
            {
                agent = serviceAgent.selectAgent(matriculeAgent);

                if (agent != null)
                {
                    LabelNomAgent.Text       = agent.nomAgent;
                    LabelPrenomAgent.Text    = agent.prenomAgent;
                    LabelAdresseAgent.Text   = agent.adresseAgent;
                    LabelMatriculeAgent.Text = agent.matriculeAgent;
                    LabelContactAgent.Text   = agent.telephoneAgent + " " + agent.telephoneMobileAgent;

                    ImageAgent.ImageUrl = ConfigurationManager.AppSettings["urlImageAgent"] + agent.ImageAgent;

                    LabelNomAgentObservation.Text = " / " + agent.prenomAgent + " " + agent.nomAgent;


                    this.initialiseGridObservation();
                    this.initialiseFormulaireObs();
                }
            }
            #endregion
        }
예제 #5
0
        DataTable IntfDalAgent.getDataTableAgent(string strRqst)
        {
            #region declaration
            DataTable    dataTable    = new DataTable();
            crlAgent     agent        = null;
            IntfDalAgent serviceAgent = new ImplDalAgent();
            #endregion

            #region implemntation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("matriculeAgent", typeof(string));
            dataTable.Columns.Add("agent", typeof(string));
            dataTable.Columns.Add("adresse", typeof(string));
            dataTable.Columns.Add("contact", typeof(string));
            dataTable.Columns.Add("statut", 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();

                        agent = serviceAgent.selectAgent(this.reader["matriculeAgent"].ToString());

                        dr["matriculeAgent"] = this.reader["matriculeAgent"].ToString();
                        dr["agent"]          = this.reader["prenomAgent"].ToString() + " " + this.reader["nomAgent"].ToString();
                        dr["adresse"]        = this.reader["adresseAgent"].ToString();
                        dr["contact"]        = this.reader["telephoneAgent"].ToString() + " / " + this.reader["telephoneMobileAgent"].ToString();

                        if (agent.sessionCaisse != null)
                        {
                            dr["statut"] = "vert16.png";
                        }
                        else
                        {
                            dr["statut"] = "rouge16.png";
                        }

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

            this.serviceConnectBase.closeConnection();


            #endregion

            return(dataTable);
        }
예제 #6
0
        int IntfDalAgent.isAgent(crlAgent Agent)
        {
            #region declaration
            int isAgent = 0;
            #endregion

            #region implementation
            if (Agent != null)
            {
                if (Agent.loginAgent != "")
                {
                    this.strCommande  = "SELECT * FROM `agent` WHERE (`matriculeAgent`<>'" + Agent.matriculeAgent + "') AND";
                    this.strCommande += " (`cinAgent`='" + Agent.cinAgent + "' OR `loginAgent`='" + Agent.loginAgent + "')";
                }
                else
                {
                    this.strCommande  = "SELECT * FROM `agent` WHERE (`matriculeAgent`<>'" + Agent.matriculeAgent + "') AND";
                    this.strCommande += " (`cinAgent`='" + Agent.cinAgent + "')";
                }
                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        while (reader.Read())
                        {
                            if (Agent.loginAgent != "")
                            {
                                if (Agent.cinAgent.Trim().ToLower().Equals(reader["cinAgent"].ToString().Trim().ToLower()))
                                {
                                    isAgent = 1;
                                    break;
                                }
                                else if (Agent.loginAgent.Trim().ToLower().Equals(reader["loginAgent"].ToString().Trim().ToLower()))
                                {
                                    isAgent = 2;
                                    break;
                                }
                            }
                            else
                            {
                                if (Agent.cinAgent.Trim().ToLower().Equals(reader["cinAgent"].ToString().Trim().ToLower()))
                                {
                                    isAgent = 1;
                                    break;
                                }
                            }
                        }
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(isAgent);
        }
예제 #7
0
 private void isSession()
 {
     if (Session["agent"] != null)
     {
         agent              = (crlAgent)Session["agent"];
         LabSession.Text    = agent.prenomAgent + " " + agent.nomAgent;
         LabLieuAgence.Text = ConfigurationManager.AppSettings["localiteServeur"];
     }
 }
예제 #8
0
        crlAgent IntfDalAgent.login(string login, string motDePasse)
        {
            #region declaration
            crlAgent agent = new crlAgent();

            IntfDalAgence        serviceAgence        = new ImplDalAgence();
            IntfDalSessionCaisse serviceSessionCaisse = new ImplDalSessionCaisse();
            #endregion

            #region implementation
            if (login != "" && motDePasse != "")
            {
                this.strCommande = "SELECT * FROM `agent` WHERE (`loginAgent`='" + login + "' AND `motDePasseAgent`='" + motDePasse + "')";
                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        reader.Read();
                        agent.adresseAgent            = reader["adresseAgent"].ToString();
                        agent.cinAgent                = reader["cinAgent"].ToString();
                        agent.dateNaissanceAgent      = Convert.ToDateTime(reader["dateNaissanceAgent"].ToString());
                        agent.lieuNaissanceAgent      = reader["lieuNaissanceAgent"].ToString();
                        agent.loginAgent              = reader["loginAgent"].ToString();
                        agent.matriculeAgent          = reader["matriculeAgent"].ToString();
                        agent.motDePasseAgent         = reader["motDePasseAgent"].ToString();
                        agent.nomAgent                = reader["nomAgent"].ToString();
                        agent.numAgence               = reader["numAgence"].ToString();
                        agent.prenomAgent             = reader["prenomAgent"].ToString();
                        agent.telephoneAgent          = reader["telephoneAgent"].ToString();
                        agent.telephoneMobileAgent    = reader["telephoneMobileAgent"].ToString();
                        agent.typeAgent               = reader["typeAgent"].ToString();
                        agent.ImageAgent              = reader["imageAgent"].ToString();
                        agent.SituationFamilialeAgent = reader["situationFamilialeAgent"].ToString();
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (agent != null)
                {
                    if (agent.numAgence != "")
                    {
                        agent.agence = serviceAgence.selectAgence(agent.numAgence);
                    }
                    if (agent.matriculeAgent != "")
                    {
                        agent.sessionCaisse = serviceSessionCaisse.getSessionCaisseEncours(agent.matriculeAgent);
                    }
                }
            }
            #endregion

            return(agent);
        }
예제 #9
0
        protected void btnModifier_Click(object sender, EventArgs e)
        {
            #region declaration
            crlObservationAgent observationAgent = null;
            crlAgent            agentObj         = null;
            string strIndicationText             = "";
            #endregion

            #region implementation
            if (hfObservationAgent.Value != "")
            {
                observationAgent = serviceObservationAgent.selectObservationAgent(hfObservationAgent.Value);
                if (observationAgent != null)
                {
                    if (LabelMatriculeAgent.Text != "")
                    {
                        this.insertToObjObservationAgent(observationAgent);
                        if (serviceObservationAgent.updateObservationAgent(observationAgent))
                        {
                            this.initialiseGridObservation();
                            this.initialiseGridAgentListeNoire();
                            this.initialiseFormulaireObs();

                            agentObj = serviceAgent.selectAgent(observationAgent.MatriculeAgent);


                            strIndicationText = "Observation bien modifier!";
                            if (agentObj != null)
                            {
                                strIndicationText += " Agent: " + agentObj.prenomAgent + " " + agentObj.nomAgent;
                            }
                            this.divIndicationText(strIndicationText, "Black");
                        }
                        else
                        {
                            strIndicationText = "Une erreur ce produit durant la modification!";
                            this.divIndicationText(strIndicationText, "Red");
                        }
                    }
                    else
                    {
                        //
                    }
                }
                else
                {
                    //
                }
            }
            else
            {
                //
            }
            #endregion
        }
예제 #10
0
        protected void btnFermerSession_Click(object sender, EventArgs e)
        {
            #region declaration
            crlAgent agent = null;
            #endregion

            #region implementation
            if (hfMatriculeAgent.Value != "")
            {
                agent = serviceAgent.selectAgent(hfMatriculeAgent.Value);
                if (agent != null)
                {
                    if (agent.sessionCaisse != null)
                    {
                        if (this.agent.agence.sessionAgence != null)
                        {
                            agent.sessionCaisse.DateHeureFinSession     = DateTime.Now;
                            agent.sessionCaisse.MatriculeAgentFermeture = this.agent.matriculeAgent;
                            agent.sessionCaisse.NumSessionAgence        = this.agent.agence.sessionAgence.NumSessionAgence;

                            if (serviceSessionCaisse.updateSessionCaisse(agent.sessionCaisse))
                            {
                                agent = serviceAgent.selectAgent(hfMatriculeAgent.Value);
                                if (agent != null)
                                {
                                    this.afficheAgent(agent.matriculeAgent);
                                    this.initialiseGridAgent();
                                }
                                else
                                {
                                    //
                                }
                            }
                            else
                            {
                                //
                            }
                        }
                        else
                        {
                            //
                        }
                    }
                    else
                    {
                        //
                    }
                }
            }
            else
            {
                //
            }
            #endregion
        }
예제 #11
0
        private void afficheAgent(string matriculeAgent)
        {
            #region declaration
            crlAgent agent = null;
            #endregion

            #region implementation
            if (matriculeAgent != "")
            {
                agent = serviceAgent.selectAgent(matriculeAgent);
                if (agent != null)
                {
                    hfMatriculeAgent.Value   = agent.matriculeAgent;
                    ImageAgent.ImageUrl      = ConfigurationManager.AppSettings["urlImageAgent"] + agent.ImageAgent;
                    LabelMatriculeAgent.Text = agent.matriculeAgent;
                    LabelNomPrenomAgent.Text = agent.prenomAgent + " " + agent.nomAgent;
                    LabelAdresseAgent.Text   = agent.adresseAgent;
                    LabelContactAgent.Text   = agent.telephoneAgent + " / " + agent.telephoneMobileAgent;
                    LabelCINAgent.Text       = agent.cinAgent;
                    LabelTypeAgent.Text      = "Agent " + agent.typeAgent;

                    if (agent.sessionCaisse != null)
                    {
                        LabelSessionStatu.Text    = "Session ouverte";
                        imageStatut.ImageUrl      = "~/CssStyle/images/vert.png";
                        TextFondCaisse.Text       = agent.sessionCaisse.FondCaisse.ToString("0");
                        btnSessionValider.Enabled = false;
                        btnFermerSession.Enabled  = true;

                        this.afficheMontantTotal(agent.sessionCaisse.NumSessionCaisse);
                    }
                    else
                    {
                        LabelSessionStatu.Text    = "Session fermée";
                        imageStatut.ImageUrl      = "~/CssStyle/images/rouge.png";
                        TextFondCaisse.Text       = "0";
                        btnSessionValider.Enabled = true;
                        btnFermerSession.Enabled  = false;

                        Panel_BilletMontantTotal.Visible           = false;
                        Panel_CommissionMontantTotal.Visible       = false;
                        Panel_DureeAbonnementMontantTotal.Visible  = false;
                        Panel_MontantTotalSessionCaisse.Visible    = false;
                        Panel_RecuEncaisserMontantTotal.Visible    = false;
                        Panel_VoyageAbonnementMontantTotal.Visible = false;
                        Panel_RecuADTotal.Visible          = false;
                        Panel_AbonnementNbVoyageUS.Visible = false;
                        Panel_BilletUS.Visible             = false;
                    }
                }
            }
            #endregion
        }
예제 #12
0
        public List <crlBillet> getBillet(crlBilletCommande billetCommande, crlAgent agent)
        {
            #region declaration
            List <crlBillet> billets    = null;
            crlBillet        tempBillet = null;
            #endregion

            #region implementation
            if (billetCommande != null && agent != null)
            {
                if (billetCommande.NombreBilletCommande > 0)
                {
                    billets = new List <crlBillet>();

                    for (int i = 0; i < billetCommande.NombreBilletCommande; i++)
                    {
                        tempBillet       = new crlBillet();
                        tempBillet.agent = agent;
                        tempBillet.calculCategorieBillet = billetCommande.calculCategorieBillet;
                        tempBillet.calculReductionBillet = billetCommande.calculReductionBillet;
                        try
                        {
                            tempBillet.DateDeValidite = DateTime.Now.AddMonths(int.Parse(ReGlobalParam.nbValiditeBillet));
                        }
                        catch (Exception)
                        {
                            tempBillet.DateDeValidite = DateTime.Now.AddMonths(1);
                        }
                        tempBillet.MatriculeAgent           = agent.matriculeAgent;
                        tempBillet.ModePaiement             = "Commande";
                        tempBillet.NumCalculCategorieBillet = billetCommande.NumCalculCategorieBillet;
                        tempBillet.NumCalculReductionBillet = billetCommande.NumCalculReductionBillet;
                        tempBillet.NumTrajet         = billetCommande.NumTrajet;
                        tempBillet.PrixBillet        = billetCommande.MontantBilletCommande.ToString("0");
                        tempBillet.trajet            = billetCommande.trajet;
                        tempBillet.NumIndividu       = billetCommande.NumIndividu;
                        tempBillet.individu          = billetCommande.individu;
                        tempBillet.NumBilletCommande = billetCommande.NumBilletCommande;

                        billets.Add(tempBillet);
                        tempBillet = null;
                    }
                }
            }
            #endregion

            return(billets);
        }
예제 #13
0
        private void verification()
        {
            if (!serviceRessource.testBase(serviceRessource.getDefaultStrConnection()))
            {
                Session.Clear();
                Response.Redirect("ConfigurationBD.aspx");
            }
            else
            {
                if (Session["agent"] != null)
                {
                    agent = (crlAgent)Session["agent"];

                    Response.Redirect("LGTrans.aspx");
                }
            }
        }
예제 #14
0
        protected void btnValider_Click(object sender, EventArgs e)
        {
            #region declaration
            crlObservationAgent observation = null;
            crlAgent            agentObj    = null;
            string strIndicationText        = "";
            #endregion

            #region implementation
            observation = new crlObservationAgent();
            this.insertToObjObservationAgent(observation);

            if (LabelMatriculeAgent.Text != "")
            {
                observation.NumObservation = serviceObservationAgent.insertObservationAgent(observation, this.agent.agence.SigleAgence);
                if (observation.NumObservation != "")
                {
                    this.initialiseGridObservation();
                    this.initialiseGridAgentListeNoire();
                    this.initialiseFormulaireObs();

                    agentObj = serviceAgent.selectAgent(observation.MatriculeAgent);


                    strIndicationText = "Observation bien enregistrer!";
                    if (agentObj != null)
                    {
                        strIndicationText += " Agent: " + agentObj.prenomAgent + " " + agentObj.nomAgent;
                    }
                    this.divIndicationText(strIndicationText, "Black");
                }
                else
                {
                    strIndicationText = "Une erreur ce produit durant l'enregistrement!";
                    this.divIndicationText(strIndicationText, "Red");
                }
            }
            else
            {
                //
            }
            #endregion
        }
예제 #15
0
        private void afficheObservation(string numObservation)
        {
            #region declaration
            crlObservationAgent observationAgent = null;
            crlAgent            agent            = null;
            string strConfirm = "";
            #endregion

            #region implementation
            if (numObservation != "")
            {
                observationAgent = serviceObservationAgent.selectObservationAgent(numObservation);

                if (observationAgent != null)
                {
                    this.afficheAgent(observationAgent.MatriculeAgent);
                    TextObservation.Text = observationAgent.TextObesvation;

                    rbAvertissement.SelectedValue = observationAgent.IsListeNoire.ToString();

                    hfObservationAgent.Value = observationAgent.NumObservation;
                    agent = serviceAgent.selectAgent(observationAgent.MatriculeAgent);

                    btnModifier.Enabled = true;
                    btnValider.Enabled  = false;


                    strConfirm = "Voulez vous vraiment modifier l'observation?\n";

                    if (agent != null)
                    {
                        strConfirm += "Chauffeur: " + agent.prenomAgent + " " + agent.nomAgent + "\n";
                        strConfirm += "Date: " + observationAgent.DateObservation.ToString("dd MMMM yyyy");
                    }

                    ConfirmButtonExtender_btnModifier.ConfirmText = strConfirm;
                }
            }
            #endregion
        }
예제 #16
0
 protected void btnConnection_Click(object sender, EventArgs e)
 {
     #region implementation
     if (this.testFormulaire())
     {
         agent = serviceAgent.login(TextLogin.Text, TextMotDePasse.Text);
         if (agent.matriculeAgent != "")
         {
             Session["agent"] = agent;
             this.verification();
         }
         else
         {
             this.divIndicationText(ReAuthentification.ErreurLogin, "red");
         }
     }
     else
     {
         this.indicationFormulaire();
     }
     #endregion
 }
예제 #17
0
        protected void btnSessionValider_Click(object sender, EventArgs e)
        {
            #region declaration
            crlSessionCaisse sessionCaisse = null;
            crlAgent         agent         = null;
            #endregion

            #region implementation
            if (hfMatriculeAgent.Value != "")
            {
                agent = serviceAgent.selectAgent(hfMatriculeAgent.Value);
                if (agent != null)
                {
                    if (agent.sessionCaisse != null)
                    {
                        //session deja ouvert
                    }
                    else
                    {
                        sessionCaisse = new crlSessionCaisse();
                        this.insertToObjetSessionCaisse(sessionCaisse);

                        sessionCaisse.NumSessionCaisse = serviceSessionCaisse.insertSessionCaisse(sessionCaisse, this.agent.agence.SigleAgence);

                        if (sessionCaisse.NumSessionCaisse != "")
                        {
                            this.afficheAgent(sessionCaisse.MatriculeAgent);
                            this.initialiseGridAgent();
                        }
                        else
                        {
                            //
                        }
                    }
                }
            }
            #endregion
        }
예제 #18
0
 private void verification()
 {
     if (!serviceRessource.testBase(serviceRessource.getDefaultStrConnection()))
     {
         Session.Clear();
         Response.Redirect("~/ihmActeur/ConfigurationBD.aspx");
     }
     else
     {
         if (Session["agent"] != null)
         {
             agent = (crlAgent)Session["agent"];
             if (!serviceLien.isPageAgent(agent.matriculeAgent, "211"))
             {
                 Response.Redirect("~/ihmActeur/Authentification.aspx");
             }
         }
         else
         {
             Response.Redirect("~/ihmActeur/Authentification.aspx");
         }
     }
 }
예제 #19
0
        crlAgent IntfDalAgent.selectAgent(string param, string paramValue)
        {
            #region declaration
            crlAgent             agent                = null;
            crlTypeAgent         typeAgence           = null;
            crlProvince          province             = null;
            IntfDalAgence        serviceAgence        = new ImplDalAgence();
            IntfDalSessionCaisse serviceSessionCaisse = new ImplDalSessionCaisse();
            #endregion

            #region implementation
            if (param != "" && paramValue != "")
            {
                this.strCommande  = "SELECT agent.matriculeAgent, agent.numAgence, agent.typeAgent,";
                this.strCommande += " agent.nomAgent, agent.prenomAgent, agent.dateNaissanceAgent, agent.lieuNaissanceAgent,";
                this.strCommande += " agent.loginAgent, agent.motDePasseAgent, agent.cinAgent, agent.adresseAgent,";
                this.strCommande += " agent.telephoneAgent, agent.telephoneMobileAgent, agent.imageAgent";
                this.strCommande += " FROM agent WHERE (`" + param + "`='" + paramValue + "')";

                this.serviceConnectBase.openConnection();
                reader = this.serviceConnectBase.select(this.strCommande);
                if (reader != null)
                {
                    if (reader.HasRows)
                    {
                        agent      = new crlAgent();
                        province   = new crlProvince();
                        typeAgence = new crlTypeAgent();

                        reader.Read();
                        agent.adresseAgent = reader["adresseAgent"].ToString();
                        agent.cinAgent     = reader["cinAgent"].ToString();
                        try
                        {
                            agent.dateNaissanceAgent = Convert.ToDateTime(reader["dateNaissanceAgent"].ToString());
                        }
                        catch (Exception)
                        {
                        }
                        agent.lieuNaissanceAgent      = reader["lieuNaissanceAgent"].ToString();
                        agent.loginAgent              = reader["loginAgent"].ToString();
                        agent.matriculeAgent          = reader["matriculeAgent"].ToString();
                        agent.motDePasseAgent         = reader["motDePasseAgent"].ToString();
                        agent.nomAgent                = reader["nomAgent"].ToString();
                        agent.numAgence               = reader["numAgence"].ToString();
                        agent.prenomAgent             = reader["prenomAgent"].ToString();
                        agent.telephoneAgent          = reader["telephoneAgent"].ToString();
                        agent.telephoneMobileAgent    = reader["telephoneMobileAgent"].ToString();
                        agent.typeAgent               = reader["typeAgent"].ToString();
                        agent.ImageAgent              = reader["imageAgent"].ToString();
                        agent.SituationFamilialeAgent = reader["situationFamilialeAgent"].ToString();

                        typeAgence.typeAgent = reader["typeAgent"].ToString();
                        agent.typeAgentObj   = typeAgence;
                    }
                    reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (agent != null)
                {
                    if (agent.numAgence != "")
                    {
                        agent.agence = serviceAgence.selectAgence(agent.numAgence);
                    }
                    if (agent.matriculeAgent != "")
                    {
                        agent.sessionCaisse = serviceSessionCaisse.getSessionCaisseEncours(agent.matriculeAgent);
                    }
                }
            }
            #endregion

            return(agent);
        }
예제 #20
0
        List <crlDureeAbonnement> IntfDalDureeAbonnementDevis.getDureeAbonnement(crlDureeAbonnementDevis dureeAbonnementDevis, crlAgent agent)
        {
            #region declaration
            List <crlDureeAbonnement> dureeAbonnement     = null;
            crlDureeAbonnement        tempDureeAbonnement = null;
            #endregion

            #region implementation
            if (dureeAbonnementDevis != null && agent != null)
            {
                if (dureeAbonnementDevis.NombreDureeAbonnement > 0)
                {
                    dureeAbonnement = new List <crlDureeAbonnement>();
                    for (int i = 0; i < dureeAbonnementDevis.NombreDureeAbonnement; i++)
                    {
                        tempDureeAbonnement = new crlDureeAbonnement();
                        tempDureeAbonnement.MatriculeAgent           = agent.matriculeAgent;
                        tempDureeAbonnement.agent                    = agent;
                        tempDureeAbonnement.calculCategorieBillet    = dureeAbonnementDevis.calculCategorieBillet;
                        tempDureeAbonnement.calculReductionBillet    = dureeAbonnementDevis.calculReductionBillet;
                        tempDureeAbonnement.ModePaiement             = "Commande";
                        tempDureeAbonnement.NumAbonnement            = dureeAbonnementDevis.NumAbonnement;
                        tempDureeAbonnement.NumCalculCategorieBillet = dureeAbonnementDevis.NumCalculCategorieBillet;
                        tempDureeAbonnement.NumCalculReductionBillet = dureeAbonnementDevis.NumCalculReductionBillet;
                        tempDureeAbonnement.NumTrajet                = dureeAbonnementDevis.NumTrajet;
                        tempDureeAbonnement.PrixTotal                = dureeAbonnementDevis.PrixTotal;
                        tempDureeAbonnement.PrixUnitaire             = dureeAbonnementDevis.PrixUnitaire;
                        tempDureeAbonnement.ValideAu                 = dureeAbonnementDevis.ValideAu;
                        tempDureeAbonnement.ValideDu                 = dureeAbonnementDevis.ValideDu;
                        tempDureeAbonnement.Zone    = dureeAbonnementDevis.Zone;
                        tempDureeAbonnement.zoneObj = dureeAbonnementDevis.zoneObj;
                        tempDureeAbonnement.trajet  = dureeAbonnementDevis.trajet;

                        dureeAbonnement.Add(tempDureeAbonnement);
                        tempDureeAbonnement = null;
                    }
                }
            }
            #endregion

            return(dureeAbonnement);
        }
예제 #21
0
        crlCommission IntfDalCommissionDevis.getCommission(crlCommissionDevis CommissionDevis, crlAgent agent)
        {
            #region declaration
            crlCommission commission = null;
            #endregion

            #region implementation
            if (CommissionDevis != null && agent != null)
            {
                commission       = new crlCommission();
                commission.agent = agent;
                commission.designationCommission = CommissionDevis.designationCommission;
                commission.Destination           = CommissionDevis.Destination;
                commission.expediteur            = CommissionDevis.expediteur;
                commission.FraisEnvoi            = CommissionDevis.FraisEnvoi.ToString();
                commission.MatriculeAgent        = agent.matriculeAgent;
                commission.ModePaiement          = "Commande";
                commission.Nombre             = CommissionDevis.Nombre;
                commission.NumDesignation     = CommissionDevis.NumDesignation;
                commission.NumExpediteur      = CommissionDevis.NumExpediteur;
                commission.NumRecepteur       = CommissionDevis.NumRecepteur;
                commission.NumTrajet          = CommissionDevis.NumTrajet;
                commission.PieceJustificatif  = CommissionDevis.PieceJustificatif;
                commission.Poids              = CommissionDevis.Poids.ToString("0.00");
                commission.recepteur          = CommissionDevis.recepteur;
                commission.TypeCommission     = CommissionDevis.TypeCommission;
                commission.typeCommssionObjet = CommissionDevis.typeCommssionObjet;
            }
            #endregion

            return(commission);
        }
예제 #22
0
        DataTable IntfDalUSVoyage.getDataTableUSVoyageNonArrive(string strRqst)
        {
            #region declaration
            DataTable dataTable = new DataTable();

            IntfDalAgent serviceAgent    = new ImplDalAgent();
            crlAgent     agentChauffeur  = null;
            crlAgent     agentReceveur   = null;
            crlAgent     agentControleur = null;
            #endregion

            #region implementation

            #region initialisation du dataTable
            dataTable = new DataTable();
            dataTable.Columns.Add("numVoyage", typeof(string));
            dataTable.Columns.Add("nomLigne", typeof(string));
            dataTable.Columns.Add("vehicule", typeof(string));
            dataTable.Columns.Add("chauffeur", typeof(string));
            dataTable.Columns.Add("receveur", typeof(string));
            dataTable.Columns.Add("controleur", 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["numVoyage"] = reader["numVoyage"].ToString();
                        dr["nomLigne"]  = reader["nomLigne"].ToString();
                        dr["vehicule"]  = reader["matriculeVehicule"].ToString() + " " + reader["marqueVehicule"].ToString() + " " + reader["couleurVehicule"].ToString();

                        agentChauffeur  = serviceAgent.selectAgent(reader["matriculeAgentChauffeur"].ToString());
                        agentReceveur   = serviceAgent.selectAgent(reader["matriculeAgentReceveur"].ToString());
                        agentControleur = serviceAgent.selectAgent(reader["matriculeAgentControleur"].ToString());

                        if (agentChauffeur != null)
                        {
                            dr["chauffeur"] = agentChauffeur.nomAgent + " " + agentChauffeur.prenomAgent;
                        }
                        else
                        {
                            dr["chauffeur"] = "";
                        }
                        if (agentReceveur != null)
                        {
                            dr["receveur"] = agentReceveur.nomAgent + " " + agentReceveur.prenomAgent;
                        }
                        else
                        {
                            dr["receveur"] = "";
                        }
                        if (agentControleur != null)
                        {
                            dr["controleur"] = agentControleur.nomAgent + " " + agentControleur.prenomAgent;
                        }
                        else
                        {
                            dr["controleur"] = "";
                        }


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

            #endregion

            return(dataTable);
        }
예제 #23
0
        crlVoyageAbonnement IntfDalVoyageAbonnementDevis.getVoyageAbonnement(crlVoyageAbonnementDevis voyageAbonnementDevis, crlAgent agent)
        {
            #region declaration
            crlVoyageAbonnement abonnementVoyage = null;
            #endregion

            #region implementation
            if (voyageAbonnementDevis != null && agent != null)
            {
                abonnementVoyage       = new crlVoyageAbonnement();
                abonnementVoyage.agent = agent;
                abonnementVoyage.calculCategorieBillet    = voyageAbonnementDevis.calculCategorieBillet;
                abonnementVoyage.calculReductionBillet    = voyageAbonnementDevis.calculReductionBillet;
                abonnementVoyage.MatriculeAgent           = agent.matriculeAgent;
                abonnementVoyage.ModePaiement             = "Commande";
                abonnementVoyage.NbVoyageAbonnement       = voyageAbonnementDevis.NbVoyageAbonnement;
                abonnementVoyage.NumAbonnement            = voyageAbonnementDevis.NumAbonnement;
                abonnementVoyage.NumCalculCategorieBillet = voyageAbonnementDevis.NumCalculCategorieBillet;
                abonnementVoyage.NumCalculReductionBillet = voyageAbonnementDevis.NumCalculReductionBillet;
                abonnementVoyage.NumTrajet    = voyageAbonnementDevis.NumTrajet;
                abonnementVoyage.PrixUnitaire = voyageAbonnementDevis.PrixUnitaire;
                abonnementVoyage.trajet       = voyageAbonnementDevis.trajet;
                abonnementVoyage.Zone         = voyageAbonnementDevis.Zone;
                abonnementVoyage.zoneObj      = voyageAbonnementDevis.zoneObj;
            }
            #endregion

            return(abonnementVoyage);
        }