コード例 #1
0
ファイル: ImplDalBonDeCommande.cs プロジェクト: Natolotra/App
        void IntfDalBonDeCommande.insertToGridBonDeCommandeNonPaieDateDF(GridView gridView, string param, string paramLike, string valueLike, DateTime datePaiementDebut, DateTime datePaiementFin)
        {
            #region declaration
            IntfDalBonDeCommande serviceBonDeCommande = new ImplDalBonDeCommande();
            #endregion

            #region implementation

            this.strCommande  = "SELECT bondecommande.numBonDeCommande, bondecommande.matriculeAgent, bondecommande.dateBC, bondecommande.datePaiementBC,";
            this.strCommande += " bondecommande.montantBC, bondecommande.descriptionBC, bondecommande.numProforma, proforma.numProforma, proforma.numSociete,";
            this.strCommande += " proforma.numOrganisme, proforma.numClient, proforma.dateProforma, proforma.matriculeAgent, proforma.modePaiement FROM bondecommande";
            this.strCommande += " Inner Join proforma ON proforma.numProforma = bondecommande.numProforma";
            this.strCommande += " Left Join client ON client.numClient = proforma.numClient";
            this.strCommande += " Left Join organisme ON organisme.numOrganisme = proforma.numOrganisme";
            this.strCommande += " Left Join societe ON societe.numSociete = proforma.numSociete";
            this.strCommande += " Left Join assocrecuencaisserproformabondecommande ON assocrecuencaisserproformabondecommande.numBonDeCommande = bondecommande.numBonDeCommande";
            this.strCommande += " WHERE " + paramLike + " LIKE '%" + valueLike + "%' AND";
            this.strCommande += " assocrecuencaisserproformabondecommande.numBonDeCommande IS NULL AND";
            this.strCommande += " bondecommande.datePaiementBC >= '" + datePaiementDebut.ToString("yyyy-MM-dd") + "' AND";
            this.strCommande += " bondecommande.datePaiementBC <= '" + datePaiementFin.ToString("yyyy-MM-dd") + "'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceBonDeCommande.getDataTableBonDeCommandeNonPaieDateDF(this.strCommande);
            gridView.DataBind();

            #endregion
        }
コード例 #2
0
ファイル: ImplDalBonDeCommande.cs プロジェクト: Natolotra/App
        string IntfDalBonDeCommande.insertBonDeCommande(crlBonDeCommande bonDeCommande, string sigleAgence)
        {
            #region declaration
            string numBonDeCommande = "";
            int    nombreInsert     = 0;
            IntfDalBonDeCommande serviceBonDeCommande = new ImplDalBonDeCommande();

            string numProforma = "";
            #endregion

            #region implementation
            if (bonDeCommande != null)
            {
                if (sigleAgence != "")
                {
                    if (bonDeCommande.NumProforma != "")
                    {
                        numProforma = "'" + bonDeCommande.NumProforma + "'";
                    }
                    else
                    {
                        numProforma = "NULL";
                    }

                    bonDeCommande.NumBonDeCommande = serviceBonDeCommande.getNumBonDeCommande(sigleAgence);
                    this.strCommande  = "INSERT INTO `bondecommande` (`numBonDeCommande`,`matriculeAgent`,`descriptionBC`,";
                    this.strCommande += " `dateBC`,`datePaiementBC`,`montantBC`,`numProforma`)";
                    this.strCommande += " VALUES ('" + bonDeCommande.NumBonDeCommande + "','" + bonDeCommande.MatriculeAgent + "',";
                    this.strCommande += " '" + bonDeCommande.DescriptionBC + "',";
                    this.strCommande += " '" + bonDeCommande.DateBC.ToString("yyyy-MM-dd") + "','" + bonDeCommande.DatePaiementBC.ToString("yyyy-MM-dd") + "',";
                    this.strCommande += " '" + bonDeCommande.MontantBC + "'," + numProforma + ")";

                    this.serviceConnectBase.openConnection();
                    nombreInsert = this.serviceConnectBase.requete(this.strCommande);
                    if (nombreInsert == 1)
                    {
                        numBonDeCommande = bonDeCommande.NumBonDeCommande;
                    }
                    this.serviceConnectBase.closeConnection();
                }
            }
            #endregion

            return(numBonDeCommande);
        }
コード例 #3
0
ファイル: ImplDalBonDeCommande.cs プロジェクト: Natolotra/App
        void IntfDalBonDeCommande.insertToGridBonDeCommande(GridView gridView, string param, string paramLike, string valueLike)
        {
            #region declaration
            IntfDalBonDeCommande serviceBonDeCommande = new ImplDalBonDeCommande();
            #endregion

            #region implementation

            this.strCommande  = "SELECT bondecommande.numBonDeCommande, bondecommande.matriculeAgent, bondecommande.descriptionBC,";
            this.strCommande += " bondecommande.numerosBC, bondecommande.dateBC, bondecommande.datePaiementBC,";
            this.strCommande += " bondecommande.montantBC FROM bondecommande";
            this.strCommande += " Left Join recuabonnement ON recuabonnement.numBonDeCommande = bondecommande.numBonDeCommande";
            this.strCommande += " WHERE recuabonnement.numBonDeCommande IS NULL AND";
            this.strCommande += " " + paramLike + " LIKE '%" + valueLike + "%'";
            this.strCommande += " ORDER BY " + param;

            gridView.DataSource = serviceBonDeCommande.getDataTableBonDeCommande(this.strCommande);
            gridView.DataBind();

            #endregion
        }
コード例 #4
0
        crlRecuAbonnement IntfDalRecuAbonnement.selectRecuAbonnement(string numRecuAbonnement)
        {
            #region declaration
            crlRecuAbonnement recuAbonnement = null;

            IntfDalAgent            serviceAgent            = new ImplDalAgent();
            IntfDalCheque           serviceCheque           = new ImplDalCheque();
            IntfDalBonDeCommande    serviceBonDeCommande    = new ImplDalBonDeCommande();
            IntfDalVoyageAbonnement serviceVoyageAbonnement = new ImplDalVoyageAbonnement();
            IntfDalDureeAbonnement  serviceDureeAbonnement  = new ImplDalDureeAbonnement();
            #endregion

            #region implementation
            if (numRecuAbonnement != "")
            {
                this.strCommande = "SELECT * FROM `recuabonnement` WHERE (`numRecuAbonnement`='" + numRecuAbonnement + "')";
                this.serviceConnectBase.openConnection();
                this.reader = this.serviceConnectBase.select(this.strCommande);
                if (this.reader != null)
                {
                    if (this.reader.HasRows)
                    {
                        if (this.reader.Read())
                        {
                            recuAbonnement = new crlRecuAbonnement();
                            try
                            {
                                recuAbonnement.DateRecuAbonnement = Convert.ToDateTime(this.reader["dateRecuAbonnement"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            recuAbonnement.MatriculeAgent = this.reader["matriculeAgent"].ToString();
                            recuAbonnement.ModePaiement   = this.reader["modePaiement"].ToString();
                            try
                            {
                                recuAbonnement.MontantRecuAbonnement = double.Parse(this.reader["montantRecuAbonnement"].ToString());
                            }
                            catch (Exception)
                            {
                            }
                            recuAbonnement.NumBonDeCommande    = this.reader["numBonDeCommande"].ToString();
                            recuAbonnement.NumCheque           = this.reader["numCheque"].ToString();
                            recuAbonnement.NumDureeAbonnement  = this.reader["numDureeAbonnement"].ToString();
                            recuAbonnement.NumRecuAbonnement   = this.reader["numRecuAbonnement"].ToString();
                            recuAbonnement.NumVoyageAbonnement = this.reader["numVoyageAbonnement"].ToString();
                        }
                    }
                    this.reader.Dispose();
                }
                this.serviceConnectBase.closeConnection();

                if (recuAbonnement != null)
                {
                    if (recuAbonnement.MatriculeAgent != "")
                    {
                        recuAbonnement.agent = serviceAgent.selectAgent(recuAbonnement.MatriculeAgent);
                    }
                    if (recuAbonnement.NumBonDeCommande != "")
                    {
                        recuAbonnement.bonDeCommande = serviceBonDeCommande.selectBonDeCommande(recuAbonnement.NumBonDeCommande);
                    }
                    if (recuAbonnement.NumCheque != "")
                    {
                        recuAbonnement.cheque = serviceCheque.selectCheque(recuAbonnement.NumCheque);
                    }
                    if (recuAbonnement.NumDureeAbonnement != "")
                    {
                        recuAbonnement.dureeAbonnement = serviceDureeAbonnement.selectDureeAbonnement(recuAbonnement.NumDureeAbonnement);
                    }
                    if (recuAbonnement.NumVoyageAbonnement != "")
                    {
                        recuAbonnement.voyageAbonnement = serviceVoyageAbonnement.selectVoyageAbonnement(recuAbonnement.NumVoyageAbonnement);
                    }
                }
            }
            #endregion

            return(recuAbonnement);
        }