Example #1
0
        bool IntfDalRecuAD.isValideMontant(double montant, string numAutorisationDepart)
        {
            #region declaration
            bool isValide = false;
            IntfDalAutorisationDepart serviceAutorisationDepart = new ImplDalAutorisationDepart();
            IntfDalFicheBord          serviceFicheBord          = new ImplDalFicheBord();
            crlAutorisationDepart     autorisationDepart        = null;

            double montantFacture = 0.00;
            double montantReste   = 0.00;
            #endregion

            #region implementation
            if (numAutorisationDepart != "")
            {
                autorisationDepart = serviceAutorisationDepart.selectAutorisationDepart(numAutorisationDepart);

                if (autorisationDepart != null)
                {
                    /*montantFacture = serviceFicheBord.getPrixTotalBagage(autorisationDepart.NumerosFB) +
                     *                          serviceFicheBord.getPrixTotalBillet(autorisationDepart.NumerosFB) +
                     *                          serviceFicheBord.getPrixTotalCommission(autorisationDepart.NumerosFB);
                     *
                     * montantReste = montantFacture - serviceAutorisationDepart.getMontanRecu(numAutorisationDepart);*/
                    if (autorisationDepart.ResteRegle >= montant)
                    {
                        isValide = true;
                    }
                }
            }
            #endregion

            return(isValide);
        }
Example #2
0
        List <crlAutorisationDepart> IntfDalFacture.selectADForFacture(string numFacture)
        {
            #region declaration
            List <crlAutorisationDepart> autorisationDeparts = null;

            IntfDalAutorisationDepart serviceAutorisationDepart = new ImplDalAutorisationDepart();
            #endregion

            #region implementation
            if (numFacture != "")
            {
                this.strCommande  = "SELECT autorisationdepart.numAutorisationDepart FROM autorisationdepart";
                this.strCommande += " Inner Join assocautorisationdepartfacture ON assocautorisationdepartfacture.numAutorisationDepart = autorisationdepart.numAutorisationDepart";
                this.strCommande += " WHERE assocautorisationdepartfacture.numFacture = '" + numFacture + "'";

                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        autorisationDeparts = new List <crlAutorisationDepart>();
                        while (this.reader.Read())
                        {
                            autorisationDeparts.Add(serviceAutorisationDepart.selectAutorisationDepart(this.reader["numAutorisationDepart"].ToString()));
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(autorisationDeparts);
        }
Example #3
0
        crlPrelevement IntfDalPrelevement.selectPrelevement(string numPrelevement)
        {
            #region declaration
            crlPrelevement            Prelevement               = null;
            IntfDalAgent              serviceAgent              = new ImplDalAgent();
            IntfDalTypePrelevement    serviceTypePrelevement    = new ImplDalTypePrelevement();
            IntfDalAutorisationDepart serviceAutorisationDepart = new ImplDalAutorisationDepart();
            #endregion

            #region implementation
            if (numPrelevement != "")
            {
                this.strCommande = "SELECT * FROM `prelevement` WHERE (`numPrelevement`='" + numPrelevement + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            Prelevement = new crlPrelevement();
                            Prelevement.NumPrelevement        = this.reader["numPrelevement"].ToString();
                            Prelevement.DatePrelevement       = Convert.ToDateTime(this.reader["datePrelevement"].ToString());
                            Prelevement.MatriculeAgent        = this.reader["matriculeAgent"].ToString();
                            Prelevement.MontantPrelevement    = double.Parse(this.reader["montantPrelevement"].ToString());
                            Prelevement.NumAutorisationDepart = this.reader["numAutorisationDepart"].ToString();
                            Prelevement.TypePrelevement       = this.reader["typePrelevement"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();
                if (Prelevement != null)
                {
                    if (Prelevement.MatriculeAgent != "")
                    {
                        Prelevement.agent = serviceAgent.selectAgent(Prelevement.MatriculeAgent);
                    }
                    if (Prelevement.NumAutorisationDepart != "")
                    {
                        Prelevement.autorisationDepart = serviceAutorisationDepart.selectAutorisationDepart(Prelevement.NumAutorisationDepart);
                    }
                    if (Prelevement.TypePrelevement != "")
                    {
                        Prelevement.objTypePrelevement = serviceTypePrelevement.selectTypePrelevement(Prelevement.TypePrelevement);
                    }
                }
            }
            #endregion

            return(Prelevement);
        }
Example #4
0
        List <crlAutorisationDepart> IntfDalVehicule.getAutorisationDepartsForFacture(string numVehicule)
        {
            #region declaration
            List <crlAutorisationDepart> autorisationDepart        = null;
            IntfDalAutorisationDepart    serviceAutorisationDepart = new ImplDalAutorisationDepart();
            #endregion

            #region implementation
            if (numVehicule != "")
            {
                this.strCommande  = "SELECT autorisationdepart.numAutorisationDepart FROM autorisationdepart";
                this.strCommande += " Inner Join fichebord ON fichebord.numerosFB = autorisationdepart.numerosFB";
                this.strCommande += " Inner Join autorisationvoyage ON autorisationvoyage.numerosAV = fichebord.numerosAV";
                this.strCommande += " Inner Join verification ON verification.idVerification = autorisationvoyage.idVerification";
                this.strCommande += " Inner Join licence ON licence.numLicence = verification.numLicence";
                this.strCommande += " WHERE licence.numVehicule = '" + numVehicule + "' AND";
                this.strCommande += " autorisationdepart.resteRegle > '0'";

                this.serviceConnection.openConnection();
                this.reader = this.serviceConnection.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        autorisationDepart = new List <crlAutorisationDepart>();
                        while (this.reader.Read())
                        {
                            autorisationDepart.Add(serviceAutorisationDepart.selectAutorisationDepart(this.reader["numAutorisationDepart"].ToString()));
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnection.closeConnection();
            }
            #endregion

            return(autorisationDepart);
        }