Esempio n. 1
0
        string IntfDalUSCarte.insertUSCarte(crlUSCarte carte, string sigleAgence)
        {
            #region declaration
            string         numCarte                  = "";
            IntfDalUSCarte serviceUSCarte            = new ImplDalUSCarte();
            string         numAbonnement             = "NULL";
            string         numAbonnementNV           = "NULL";
            string         numAbonnementNVDevis      = "NULL";
            string         numUSReductionParticulier = "NULL";
            string         numUSValidationReduction  = "NULL";
            int            nbInsert                  = 0;
            #endregion

            #region implementation
            if (carte != null && sigleAgence != "")
            {
                if (carte.NumAbonnement != "")
                {
                    numAbonnement = "'" + carte.NumAbonnement + "'";
                }
                if (carte.NumUSReductionParticulier != "")
                {
                    numUSReductionParticulier = "'" + carte.NumUSReductionParticulier + "'";
                }
                if (carte.NumUSValidationReduction != "")
                {
                    numUSValidationReduction = "'" + carte.NumUSValidationReduction + "'";
                }
                if (carte.NumAbonnementNV != "")
                {
                    numAbonnementNV = "'" + carte.NumAbonnementNV + "'";
                }
                if (carte.NumAbonnementNVDevis != "")
                {
                    numAbonnementNVDevis = "'" + carte.NumAbonnementNVDevis + "'";
                }
                carte.NumCarte = serviceUSCarte.getNumUSCarte(sigleAgence);

                this.strCommande  = "INSERT INTO `uscarte` (`numCarte`,`prixCarte`,`numUSReductionParticulier`,";
                this.strCommande += " `numAbonnement`,`numAgence`, `numAbonnementNV`, `numAbonnementNVDevis`,";
                this.strCommande += " `numUSValidationReduction`)";
                this.strCommande += " VALUES ('" + carte.NumCarte + "','" + carte.PrixCarte.ToString("0") + "',";
                this.strCommande += " " + numUSReductionParticulier + "," + numAbonnement + ",'" + carte.NumAgence + "',";
                this.strCommande += " " + numAbonnementNV + ", " + numAbonnementNVDevis + "," + numUSValidationReduction + ")";

                this.serviceConnectBase.openConnection();
                nbInsert = this.serviceConnectBase.requete(this.strCommande);
                if (nbInsert == 1)
                {
                    numCarte = carte.NumCarte;
                }
                this.serviceConnectBase.closeConnection();
            }
            #endregion

            return(numCarte);
        }
Esempio n. 2
0
        void IntfDalUSCarte.insertToGridCarte(GridView gridView, string param, string paramLike, string valueLike, string numAgence)
        {
            #region declaration
            IntfDalUSCarte serviceUSCarte = new ImplDalUSCarte();
            #endregion

            #region implementation

            this.strCommande  = "SELECT uscarte.numCarte, uscarte.prixCarte, uscarte.numUSReductionParticulier,";
            this.strCommande += " uscarte.numAbonnement, uscarte.numAgence, uscarte.numUSValidationReduction";
            this.strCommande += " FROM uscarte WHERE " + paramLike + " LIKE  '%" + valueLike + "%' AND";
            this.strCommande += " uscarte.numAgence LIKE '%" + numAgence + "%'";
            this.strCommande += " ORDER BY " + param;


            gridView.DataSource = serviceUSCarte.getDataTableCarte(this.strCommande);
            gridView.DataBind();
            #endregion
        }