コード例 #1
0
        string IntfDalCooperative.insertCooperative(crlCooperative cooperative, string sigleAgence)
        {
            #region decalration
            string             numCooperative     = "";
            int                nombreInsert       = 0;
            IntfDalCooperative serviceCooperative = new ImplDalCooperative();
            #endregion

            #region implementation
            if (cooperative != null && sigleAgence != "")
            {
                cooperative.NumCooperative = serviceCooperative.getNumCooperative(sigleAgence);
                this.strCommande           = "INSERT INTO `cooperative` (`numCooperative`, `nomCooperative`,";
                this.strCommande          += " `sigleCooperative`,`adresseCooperative`, `zone`,`telephoneFixeCooperative`,";
                this.strCommande          += " `telephoneMobileCooperative`,`numVille`,`nomResponsable`,`prenomResponsable`,";
                this.strCommande          += " `cinResponsable`,`adressseResponsable`,`telephoneFixeResponsable`,";
                this.strCommande          += " `telephoneMobileResponsable`) VALUES";
                this.strCommande          += " ('" + cooperative.NumCooperative + "','" + cooperative.NomCooperative + "',";
                this.strCommande          += " '" + cooperative.SigleCooperative + "','" + cooperative.AdresseCooperative + "',";
                this.strCommande          += " '" + cooperative.Zone + "','" + cooperative.TelephoneFixeCooperative + "',";
                this.strCommande          += " '" + cooperative.TelephoneMobileCooperative + "','" + cooperative.NumVille + "',";
                this.strCommande          += " '" + cooperative.NomResponsable + "','" + cooperative.PrenomResponsable + "',";
                this.strCommande          += " '" + cooperative.CinResponsable + "','" + cooperative.AdressseResponsable + "',";
                this.strCommande          += " '" + cooperative.TelephoneFixeResponsable + "','" + cooperative.TelephoneMobileResponsable + "')";

                this.serviceConnection.openConnection();
                nombreInsert = this.serviceConnection.requete(this.strCommande);
                if (nombreInsert == 1)
                {
                    numCooperative = cooperative.NumCooperative;
                }
                this.serviceConnection.closeConnection();
            }
            #endregion

            return(numCooperative);
        }