Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Software > Commerce Server Userprofile management > Retrieve the mu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 254 of 267
Post > Topic >>

Retrieve the multi-value columns along with normal columns using 1

by =?Utf-8?B?TWFuaXNo?= <Manish@[EMAIL PROTECTED] > Nov 17, 2006 at 08:05 AM

Is there a ways I can retrieve the multi-value columns (ex. BusinessLine, 
ChannelRole etc) from the profiles (ex. organizationobject profile) along 
with the normal columns (ex. Org_Name, Division etc.) in one API call. 
Currently we retrieve columns that are not multi-valued and loop through
the 
data and query again for each organization to retrieve the multi-value 
columns.

Code: 
public void PopulatePartnerDetailsByAll(DataTable dtPartnerDetails,
DataSet 
dsBusinessData, DataSet dsChannelRole)
        {
            dtPartnerDetails.Columns.Add(new 
DataColumn("BusinesslineDescription"));
            dtPartnerDetails.Columns.Add(new 
DataColumn("ChannelRoleDescription"));
            try
            {
                int intRowCount = dtPartnerDetails.Rows.Count - 1;
                for (int intRowIndex = intRowCount; intRowIndex >= 0; 
intRowIndex--)
                {
                    object[] multiValueBusinessline = 
dlPartnerLocator.GetMultipleValue(dtPartnerDetails.Rows[intRowIndex][0].ToString(),
"BusinessLine");
                    object[] multiValueChannelRole = 
dlPartnerLocator.GetMultipleValue(dtPartnerDetails.Rows[intRowIndex][0].ToString(),
"ChannelRole");
                    if (multiValueBusinessline == null && 
multiValueChannelRole == null)
                    {
                        
dtPartnerDetails.Rows[intRowIndex]["BusinesslineDescription"] = "";
                        
dtPartnerDetails.Rows[intRowIndex]["ChannelRoleDescription"] = "";
                    }
                    else if (multiValueBusinessline != null && 
multiValueChannelRole == null)
                    {
                        
dtPartnerDetails.Rows[intRowIndex]["ChannelRoleDescription"] = "";
                        string strBusiness = null;
                        DataRow[] drDescription;
                        for (int intMultivalueIndex = 0;
intMultivalueIndex 
<= multiValueBusinessline.Length - 1; intMultivalueIndex++)
                        {
                            drDescription = 
dsBusinessData.Tables[0].Select("BusinessLineID ='" + 
multiValueBusinessline[intMultivalueIndex].ToString() + "'");
                            if (drDescription.Length > 0)
                            strBusiness = 
drDescription[0]["BusinessLineName"] + "<br>" + strBusiness;
                            else
                            throw new 
Delphi.ApplicationBlocks.Exceptions.Busines***ception("This " + 
multiValueBusinessline[intMultivalueIndex].ToString() + " ID is missing in

BusinessLineProfile");
                        }

                        
dtPartnerDetails.Rows[intRowIndex]["BusinesslineDescription"] =
strBusiness;
                    }
                    else if (multiValueBusinessline == null && 
multiValueChannelRole != null)
                    {
                        
dtPartnerDetails.Rows[intRowIndex]["BusinesslineDescription"] = "";
                        string strChannel = null;
                        DataRow[] drDescription;
                        for (int intMultivalueIndex = 0;
intMultivalueIndex 
<= multiValueChannelRole.Length - 1; intMultivalueIndex++)
                        {
                            drDescription = 
dsChannelRole.Tables[0].Select("ChannelRoleId ='" + 
multiValueChannelRole[intMultivalueIndex].ToString() + "'");
                            if (drDescription.Length > 0)
                            strChannel =
drDescription[0]["ChannelRoleName"] 
+ "<br>" + strChannel;
                            else
                            throw new 
Delphi.ApplicationBlocks.Exceptions.Busines***ception("This " + 
multiValueChannelRole[intMultivalueIndex].ToString() + "ID is missing in 
ChannelRoleProfile");
                        }
                        
dtPartnerDetails.Rows[intRowIndex]["ChannelRoleDescription"] = strChannel;
                    }
                    else if (multiValueBusinessline != null && 
multiValueChannelRole != null)
                    {
                        string strChannel = null;
                        string strBusiness = null;
                        DataRow[] drDescription;
                        for (int intMultivalueIndex = 0;
intMultivalueIndex 
<= multiValueBusinessline.Length - 1; intMultivalueIndex++)
                        {
                            drDescription = 
dsBusinessData.Tables[0].Select("BusinessLineID ='" + 
multiValueBusinessline[intMultivalueIndex].ToString() + "'");
                            if (drDescription.Length > 0)
                                strBusiness = 
drDescription[0]["BusinessLineName"] + "<br>" + strBusiness;
                            else
                                throw new 
Delphi.ApplicationBlocks.Exceptions.Busines***ception("This" + 
multiValueBusinessline[intMultivalueIndex].ToString() + " is missing in 
BusinesslineProfile");                                                    
   
    
                        }
                        for (int intMultivalueIndex = 0;
intMultivalueIndex 
<= multiValueChannelRole.Length - 1; intMultivalueIndex++)
                        {
                            drDescription = 
dsChannelRole.Tables[0].Select("ChannelRoleId ='" + 
multiValueChannelRole[intMultivalueIndex].ToString() + "'");
                            if(drDescription.Length > 0)
                            strChannel =
drDescription[0]["ChannelRoleName"] 
+ "<br>" + strChannel;
                            else
                            throw new 
Delphi.ApplicationBlocks.Exceptions.Busines***ception("This" + 
multiValueChannelRole[intMultivalueIndex].ToString() + " is missing in 
ChannelRoleProfile");                                                     
   
   
                        }
                        
dtPartnerDetails.Rows[intRowIndex]["BusinesslineDescription"] =
strBusiness;
                        
dtPartnerDetails.Rows[intRowIndex]["ChannelRoleDescription"] = strChannel;
                    }
                }
                dtPartnerDetails.AcceptChanges();
            }
            catch (Delphi.ApplicationBlocks.Exceptions.Busines***ception 
Busines***ception)
            {
                throw new 
Delphi.ApplicationBlocks.Exceptions.Busines***ception(Busines***ception.Message,
Busines***ception);
            }

        }
 




 1 Posts in Topic:
Retrieve the multi-value columns along with normal columns using
=?Utf-8?B?TWFuaXNo?= <  2006-11-17 08:05:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 6:34:02 CST 2008.