Beispiel #1
0
        public static string BusinessName(string businessKey)
        {
            string name = null;

            Debug.Enter();

            SqlCommand cmd = new SqlCommand("net_businessEntity_names_get", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Transaction = ConnectionManager.GetTransaction();

            cmd.Parameters.Add(new SqlParameter("@businessKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetGuidFromString("@businessKey", businessKey);

            SqlDataReaderAccessor reader = new SqlDataReaderAccessor(cmd.ExecuteReader());

            try
            {
                if (reader.Read())
                {
                    name = reader.GetString("name");
                }
            }
            finally
            {
                reader.Close();
            }

            Debug.Leave();

            return(name);
        }
Beispiel #2
0
        public void Save()
        {
            Debug.Enter();

            //
            // Save the taxonomy entry.
            //
            SqlCommand cmd = new SqlCommand("net_taxonomy_save", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Transaction = ConnectionManager.GetTransaction();

            cmd.Parameters.Add(new SqlParameter("@tModelKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@flag", SqlDbType.Int)).Direction       = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@taxonomyID", SqlDbType.Int)).Direction = ParameterDirection.Output;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetGuidFromKey("@tModelKey", tModelKey);
            paramacc.SetInt("@flag", taxonomyFlag);

            cmd.ExecuteNonQuery();

            int taxonomyID = paramacc.GetInt("@taxonomyID");

            foreach (TaxonomyValue tv in TaxonomyValues)
            {
                tv.Save(tModelKey);
            }
        }
Beispiel #3
0
        public static string TModelName(string tModelKey)
        {
            Debug.Enter();

            SqlCommand cmd = new SqlCommand("net_tModel_get", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Transaction = ConnectionManager.GetTransaction();

            cmd.Parameters.Add(new SqlParameter("@tModelKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@operatorName", SqlDbType.NVarChar, UDDI.Constants.Lengths.OperatorName)).Direction     = ParameterDirection.Output;
            cmd.Parameters.Add(new SqlParameter("@authorizedName", SqlDbType.NVarChar, UDDI.Constants.Lengths.AuthorizedName)).Direction = ParameterDirection.Output;
            cmd.Parameters.Add(new SqlParameter("@name", SqlDbType.NVarChar, UDDI.Constants.Lengths.Name)).Direction = ParameterDirection.Output;
            cmd.Parameters.Add(new SqlParameter("@overviewURL", SqlDbType.NVarChar, UDDI.Constants.Lengths.OverviewURL)).Direction = ParameterDirection.Output;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetGuidFromKey("@tModelKey", tModelKey);

            cmd.ExecuteNonQuery();

            Debug.Leave();

            return(paramacc.GetString("@name"));
        }
        public void Save(string businessKey)
        {
            //
            // Create a command object to invoke the stored procedure
            //
            SqlCommand cmd = new SqlCommand("net_businessEntity_discoveryUrl_save", ConnectionManager.GetConnection());

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.CommandType = CommandType.StoredProcedure;

            //
            // Input parameters
            //
            cmd.Parameters.Add(new SqlParameter("@businessKey", SqlDbType.UniqueIdentifier));
            cmd.Parameters.Add(new SqlParameter("@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType));
            cmd.Parameters.Add(new SqlParameter("@discoveryUrl", SqlDbType.NVarChar, UDDI.Constants.Lengths.DiscoveryURL));

            //
            // Set parameters
            //
            SqlParameterAccessor parmacc = new SqlParameterAccessor(cmd.Parameters);

            parmacc.SetGuidFromString("@businessKey", businessKey);
            parmacc.SetString("@useType", UseType);
            parmacc.SetString("@discoveryUrl", Value);

            //
            // Execute save
            //
            cmd.ExecuteNonQuery();
        }
Beispiel #5
0
        public void Save(long contactID)
        {
            //
            // Create a command object to invoke the stored procedure
            //
            SqlCommand cmd = new SqlCommand("net_contact_email_save", ConnectionManager.GetConnection());

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.CommandType = CommandType.StoredProcedure;

            //
            // Input parameters
            //
            cmd.Parameters.Add(new SqlParameter("@contactID", SqlDbType.BigInt)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@email", SqlDbType.NVarChar, UDDI.Constants.Lengths.Email)).Direction     = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType)).Direction = ParameterDirection.Input;

            //
            // Set parameter values
            //
            SqlParameterAccessor parmacc = new SqlParameterAccessor(cmd.Parameters);

            parmacc.SetLong("@contactID", contactID);
            parmacc.SetString("@email", Value);
            parmacc.SetString("@useType", UseType);

            cmd.ExecuteNonQuery();
        }
Beispiel #6
0
        public DispositionReport DiscardAuthToken(DiscardAuthToken dat)
        {
            Debug.Enter();
            DispositionReport dr = new DispositionReport();

            try
            {
                if ((Config.GetInt("Security.AuthenticationMode") == (int)AuthenticationMode.Passport))
                {
                    PassportAuthenticator authenticator = new PassportAuthenticator();
                    authenticator.Authenticate(dat.AuthInfo, Config.GetInt("Security.TimeOut"));

                    //
                    // Call to the database to update the user status to logged off.
                    //
                    SqlCommand cmd = new SqlCommand("ADM_setPublisherStatus", ConnectionManager.GetConnection());

                    cmd.Transaction = ConnectionManager.GetTransaction();
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add(new SqlParameter("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID)).Direction = ParameterDirection.Input;
                    cmd.Parameters.Add(new SqlParameter("@publisherStatus", SqlDbType.NVarChar, UDDI.Constants.Lengths.PublisherStatus)).Direction = ParameterDirection.Input;

                    SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);
                    paramacc.SetString("@PUID", Context.User.ID);
                    paramacc.SetString("@publisherStatus", "loggedOut");
                    cmd.ExecuteNonQuery();
                }
            }
            catch (Exception e)
            {
                DispositionReport.Throw(e);
            }

            return(dr);
        }
Beispiel #7
0
        public static DataView GetTaxonomyChildrenRoot(int taxonomyID)
        {
            Debug.Enter();

            DataSet categories = new DataSet();

            SqlCommand cmd = new SqlCommand("UI_getTaxonomyChildrenRoot", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.Parameters.Add(new SqlParameter("@rowCount", SqlDbType.Int)).Direction   = ParameterDirection.ReturnValue;
            cmd.Parameters.Add(new SqlParameter("@taxonomyID", SqlDbType.Int)).Direction = ParameterDirection.Input;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetInt("@taxonomyID", taxonomyID);

            SqlDataAdapter adapter = new SqlDataAdapter(cmd);

            adapter.Fill(categories, "Categories");

            Debug.Leave();

            return(categories.Tables["Categories"].DefaultView);
        }
Beispiel #8
0
        public void Save(string tModelKey)
        {
            Debug.Enter();

            SqlCommand cmd = new SqlCommand("net_taxonomyValue_save", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Transaction = ConnectionManager.GetTransaction();

            cmd.Parameters.Add(new SqlParameter("@tModelKey", SqlDbType.UniqueIdentifier)).Direction   = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@keyValue", SqlDbType.NVarChar, 128)).Direction       = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@parentKeyValue", SqlDbType.NVarChar, 128)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@keyName", SqlDbType.NVarChar, 128)).Direction        = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@valid", SqlDbType.Bit)).Direction = ParameterDirection.Input;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetGuidFromKey("@tModelKey", tModelKey);
            paramacc.SetString("@keyValue", KeyValue);
            paramacc.SetString("@keyName", KeyNames[0].Name);
            cmd.Parameters["@valid"].Value = ValidForClassification;

            if (Utility.StringEmpty(ParentKeyValue))
            {
                paramacc.SetString("@parentKeyValue", KeyValue);
            }
            else
            {
                paramacc.SetString("@parentKeyValue", ParentKeyValue);
            }

            cmd.ExecuteNonQuery();
        }
        internal void Validate()
        {
            SqlCommand cmd = new SqlCommand("net_categoryBag_validate", ConnectionManager.GetConnection());

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add(new SqlParameter("@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@tModelKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetString("@keyValue", KeyValue);
            paramacc.SetGuidFromKey("@tModelKey", TModelKey);

            cmd.ExecuteNonQuery();
        }
        public void Delete()
        {
            Debug.Enter();

            SqlCommand cmd = new SqlCommand("net_taxonomy_delete", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Transaction = ConnectionManager.GetTransaction();

            cmd.Parameters.Add(new SqlParameter("@tModelKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetGuidFromKey("@tModelKey", tModelKey);

            cmd.ExecuteNonQuery();

            Debug.Leave();
        }
Beispiel #11
0
        public void Save(string businessKey)
        {
            //
            // Create a command object to invoke the stored procedure
            //
            SqlCommand cmd = new SqlCommand("net_businessEntity_contact_save", ConnectionManager.GetConnection());

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.CommandType = CommandType.StoredProcedure;

            //
            // Parameters
            //
            cmd.Parameters.Add(new SqlParameter("@businessKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@useType", SqlDbType.NVarChar, UDDI.Constants.Lengths.UseType)).Direction       = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@personName", SqlDbType.NVarChar, UDDI.Constants.Lengths.PersonName)).Direction = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@contactID", SqlDbType.BigInt)).Direction = ParameterDirection.Output;

            //
            // Set parameter values and execute query
            //
            SqlParameterAccessor parmacc = new SqlParameterAccessor(cmd.Parameters);

            parmacc.SetGuidFromString("@businessKey", businessKey);
            parmacc.SetString("@personName", PersonName);
            parmacc.SetString("@useType", UseType);

            cmd.ExecuteScalar();

            //
            // Move out parameters into local variables
            //
            long ContactID = parmacc.GetLong("@contactID");

            //
            // Save sub-objects
            //
            Descriptions.Save(ContactID, EntityType.Contact);
            Phones.Save(ContactID);
            Emails.Save(ContactID);
            Addresses.Save(ContactID);
        }
        public SqlDataReader GetValues(RelationType relation)
        {
            SqlCommand cmd = new SqlCommand("net_taxonomyValue_get", ConnectionManager.GetConnection());

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.CommandType = CommandType.StoredProcedure;

            //
            // Add parameters and set values
            //
            SqlParameterAccessor populator = new SqlParameterAccessor(cmd.Parameters);

            cmd.Parameters.Add("@tModelKey", SqlDbType.UniqueIdentifier);
            cmd.Parameters.Add("@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue);
            cmd.Parameters.Add("@relation", SqlDbType.Int);

            populator.SetGuidFromKey("@tModelKey", TModelKey);
            populator.SetString("@keyValue", KeyValue);
            populator.SetInt("@relation", (int)relation);

            return(cmd.ExecuteReader());
        }
Beispiel #13
0
        public static string GetTaxonomyParent(int taxonomyID, string ID)
        {
            Debug.Enter();

            SqlCommand cmd = new SqlCommand("UI_getTaxonomyParent", ConnectionManager.GetConnection());

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.Parameters.Add(new SqlParameter("@TaxonomyID", SqlDbType.Int)).Direction   = ParameterDirection.Input;
            cmd.Parameters.Add(new SqlParameter("@ID", SqlDbType.NVarChar, 450)).Direction = ParameterDirection.Input;

            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

            paramacc.SetInt("@TaxonomyID", taxonomyID);
            paramacc.SetString("@ID", ID);

            string parent = (string)cmd.ExecuteScalar();

            Debug.Leave();

            return(parent);
        }
Beispiel #14
0
        internal void Validate(string parentKey, KeyedReferenceType keyedReferenceType)
        {
            Debug.Enter();

            //
            // IN69: 4. When a keyedReference is saved within a categoryBag without specifying
            // a tModelKey (that is no tModelKey attribute at all) the UDDI server MUST
            // assume the urn:uddi-org:general_keywords tModelKey.  The resulting response
            // MUST add to the keyedReference the attribute
            // tModelKey=”uuid:A035A07C-F362-44dd-8F95-E2B134BF43B4” (case does not matter).
            //
            if (KeyedReferenceType.CategoryBag == keyedReferenceType && Utility.StringEmpty(TModelKey))
            {
                TModelKey = Config.GetString("TModelKey.GeneralKeywords");
            }

            //
            // IN69: 3. A UDDI server MUST reject a save_xxx request with a keyedReferences
            // in an identifierBag where no tModelKey attribute is specified.
            //
            if (KeyedReferenceType.IdentifierBag == keyedReferenceType && Utility.StringEmpty(TModelKey))
            {
                throw new UDDIException(
                          ErrorType.E_fatalError,
                          "UDDI_ERROR_FATALERROR_IDBAG_MISSINGTMODELKEY");
            }

            //
            // IN69: 1. A UDDI server MUST reject a save_xxx request with a keyedReference
            // with no keyName when the urn:uddi-org:general_keywords is involved
            //
            // #1718, make sure the comparison is not case sensitive.
            //
            if (Config.GetString("TModelKey.GeneralKeywords").ToLower().Equals(TModelKey) && null == keyname)
            {
                throw new UDDIException(
                          ErrorType.E_fatalError,
                          "UDDI_ERROR_FATALERROR_GENERALKEYWORDS_BLANKNAME");
            }

            //
            // IN69: 2. A UDDI server MUST reject a save_xxx request with a
            // keyedReference where only the keyValue is specified
            //
            if (Utility.StringEmpty(tmodelkey) && Utility.StringEmpty(keyname))
            {
                throw new UDDIException(
                          ErrorType.E_fatalError,
                          "UDDI_ERROR_FATALERROR_ASSERTION_MISSINGTMODELKEYORNAME");
            }

            //
            // Validate TModelKey, KeyName, and KeyValue length.
            //
            if (KeyedReferenceType.Assertion == keyedReferenceType)
            {
                if (Utility.StringEmpty(tmodelkey) ||
                    null == keyname ||
                    null == keyvalue)
                {
                    throw new UDDIException(
                              ErrorType.E_fatalError,
                              "UDDI_ERROR_FATALERROR_ASSERTION_MISSINGKEYNAMEORVALUE");
                }
            }

            Utility.ValidateLength(ref tmodelkey, "tModelKey", UDDI.Constants.Lengths.TModelKey);
            Utility.ValidateLength(ref keyname, "keyName", UDDI.Constants.Lengths.KeyName);
            Utility.ValidateLength(ref keyvalue, "keyValue", UDDI.Constants.Lengths.KeyValue);

            Debug.VerifyKey(tmodelkey);

            //
            // TODO: We are skipping validation of this keyedreference here if the parent entity key is
            // the same as the tModelKey for the identifer bag or category bag. Why???
            //
            // Please insert a comment to describe why this is necessary
            //
            if (parentKey != TModelKey)
            {
                //
                // call net_keyedReference_validate
                //
                SqlCommand cmd = new SqlCommand("net_keyedReference_validate", ConnectionManager.GetConnection());

                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Transaction = ConnectionManager.GetTransaction();

                cmd.Parameters.Add(new SqlParameter("@PUID", SqlDbType.NVarChar, UDDI.Constants.Lengths.UserID)).Direction = ParameterDirection.Input;
                cmd.Parameters.Add(new SqlParameter("@keyedRefType", SqlDbType.TinyInt)).Direction = ParameterDirection.Input;
                cmd.Parameters.Add(new SqlParameter("@keyValue", SqlDbType.NVarChar, UDDI.Constants.Lengths.KeyValue)).Direction = ParameterDirection.Input;
                cmd.Parameters.Add(new SqlParameter("@tModelKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;

                SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

                paramacc.SetString("@PUID", Context.User.ID);
                paramacc.SetShort("@keyedRefType", (short)keyedReferenceType);
                paramacc.SetString("@keyValue", KeyValue);
                paramacc.SetGuidFromKey("@tModelKey", TModelKey);

                cmd.ExecuteNonQuery();
            }

            Debug.Leave();
        }
Beispiel #15
0
        internal void Validate()
        {
            Debug.Enter();

            Utility.ValidateLength(ref UseType, "useType", UDDI.Constants.Lengths.UseType);
            Utility.ValidateLength(ref SortCode, "sortCode", UDDI.Constants.Lengths.SortCode);
            Utility.ValidateLength(ref TModelKey, "tModelKey", UDDI.Constants.Lengths.TModelKey);

            //
            // Verify that if the address is adorned with a tModelKey, each
            // of the address lines specifies a key name and value.
            //
            if (null != TModelKey)
            {
                if (Utility.StringEmpty(TModelKey))
                {
                    //
                    // trying to save a business with empty tModelKey attribute
                    // in the address element should return E_invalidKeyPassed
                    //
                    throw new UDDIException(
                              ErrorType.E_invalidKeyPassed,
                              "UDDI_ERROR_INVALIDKEYPASSED_ADDRESS_BLANKTMODELKEY");
                }
                else
                {
                    foreach (AddressLine addressLine in AddressLines)
                    {
                        if (Utility.StringEmpty(addressLine.KeyName) ||
                            Utility.StringEmpty(addressLine.KeyValue))
                        {
                            throw new UDDIException(
                                      ErrorType.E_fatalError,
                                      "UDDI_ERROR_FATALERROR_ADDRESS_MISSINGKEYNAMEKEYVALUE");
                        }
                    }

                    //
                    // call net_key_validate
                    //
                    SqlCommand cmd = new SqlCommand("net_key_validate", ConnectionManager.GetConnection());

                    cmd.Transaction = ConnectionManager.GetTransaction();
                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.Add(new SqlParameter("@entityTypeID", SqlDbType.TinyInt)).Direction       = ParameterDirection.Input;
                    cmd.Parameters.Add(new SqlParameter("@entityKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;

                    SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);

                    //
                    // TODO: Need enumeration for the entityTypeID
                    //
                    paramacc.SetInt("@entityTypeID", 0);
                    paramacc.SetGuidFromKey("@entityKey", TModelKey);

                    cmd.ExecuteNonQuery();
                }
            }

            AddressLines.Validate();

            Debug.Leave();
        }
        public void Get(string businessKey)
        {
            //
            // This procedure add the discoveryURLs that were persisted to the database
            // this does not include the default discoveryURL, it is added by the the businessEntity.Get()
            // method since it has the visibility of the operator name who owns the entity.
            //

            //
            // Create a command object to invoke the stored procedure
            //
            SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor("net_businessEntity_discoveryURLs_get");

            //
            // Add parameters
            //
            cmd.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier);
            cmd.Parameters.SetGuidFromString("@businessKey", businessKey);

            //
            // Execute query
            //
            SqlDataReaderAccessor reader = cmd.ExecuteReader();

            try
            {
                Read(reader);
            }
            finally
            {
                reader.Close();
            }

#if never
            //
            // This procedure add the discoveryURLs that were persisted to the database
            // this does not include the default discoveryURL, it is added by the the businessEntity.Get()
            // method since it has the visibility of the operator name who owns the entity.
            //
            const int UseTypeIndex = 0;
            const int UrlIndex     = 1;

            //
            // Create a command object to invoke the stored procedure
            //
            SqlCommand cmd = new SqlCommand("net_businessEntity_discoveryURLs_get", ConnectionManager.GetConnection());

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.CommandType = CommandType.StoredProcedure;

            //
            // Add parameters
            //
            cmd.Parameters.Add(new SqlParameter("@businessKey", SqlDbType.UniqueIdentifier));
            SqlParameterAccessor paramacc = new SqlParameterAccessor(cmd.Parameters);
            paramacc.SetGuidFromString("@businessKey", businessKey);

            //
            // Execute query
            //
            SqlDataReader rdr = cmd.ExecuteReader();
            try
            {
                SqlDataReaderAccessor rdracc = new SqlDataReaderAccessor(rdr);

                //
                // The discoveryUrls will be contained in the result set
                //
                while (rdr.Read())
                {
                    string useType = rdracc.GetString(UseTypeIndex);

                    if (null == useType)
                    {
                        useType = "";
                    }

                    Add(rdracc.GetString(UrlIndex), useType);
                }
            }
            finally
            {
                rdr.Close();
            }
#endif
        }
Beispiel #17
0
        public void Get(string businessKey)
        {
            //
            // Create a command object to invoke the stored procedure net_get_contacts
            //
            SqlStoredProcedureAccessor cmd = new SqlStoredProcedureAccessor("net_businessEntity_contacts_get");

            //
            // Input parameters
            //
            cmd.Parameters.Add("@businessKey", SqlDbType.UniqueIdentifier, ParameterDirection.Input);
            cmd.Parameters.SetGuidFromString("@businessKey", businessKey);

            //
            // Run the stored procedure
            //
            SqlDataReaderAccessor reader     = cmd.ExecuteReader();
            ArrayList             contactIds = null;

            try
            {
                contactIds = Read(reader);
            }
            finally
            {
                reader.Close();
            }

            Populate(contactIds);
#if never
            const int ContactIdIndex  = 0;
            const int UseTypeIndex    = 1;
            const int PersonNameIndex = 2;
            ArrayList contactIds      = new ArrayList();

            //
            // Create a command object to invoke the stored procedure net_get_contacts
            //
            SqlCommand cmd = new SqlCommand("net_businessEntity_contacts_get", ConnectionManager.GetConnection());

            cmd.Transaction = ConnectionManager.GetTransaction();
            cmd.CommandType = CommandType.StoredProcedure;

            //
            // Input parameters
            //
            cmd.Parameters.Add(new SqlParameter("@businessKey", SqlDbType.UniqueIdentifier)).Direction = ParameterDirection.Input;

            //
            // Set parameter values
            //
            SqlParameterAccessor populator = new SqlParameterAccessor(cmd.Parameters);
            populator.SetGuidFromString("@businessKey", businessKey);

            //
            // Run the stored procedure
            //
            SqlDataReader rdr = cmd.ExecuteReader();
            try
            {
                SqlDataReaderAccessor dracc = new SqlDataReaderAccessor(rdr);

                //
                // The contacts will be contained in the result set
                //
                while (rdr.Read())
                {
                    //
                    // construct a new contact from the data in this row, fully populate contact and add to collection
                    //
                    Add(new Contact(dracc.GetString(PersonNameIndex), dracc.GetString(UseTypeIndex)));
                    contactIds.Add(dracc.GetInt(ContactIdIndex));
                }
            }
            finally
            {
                rdr.Close();
            }

            int i = 0;
            foreach (Contact contact in this)
            {
                contact.Get((int)contactIds[i++]);
            }
#endif
        }