www.mcadex.com
BOOL GetPrdPropertyValue(CATIProduct_var pRefProduct,
CATUnicodeString strKeyName,
CATUnicodeString &strValue)
{
BOOL bIsExist = FALSE;
strValue="";
if (pRefProduct == NULL_var || strKeyName == "")
{
return bIsExist;
}
//获得实例属性
CATIPrdProperties_var spProp(pRefProduct);
CATIParmPublisher* pPublisher = NULL;
if(NULL_var!=spProp)
{
spProp->GetUserProperties(pPublisher,FALSE);
if (pPublisher == NULL)
{
return bIsExist;
}
//获取所有参数
CATLISTV(CATISpecObject_var) pParamArray;
pPublisher->GetDirectChildren("CATICkeParm",pParamArray);
CATISpecObject_var SpecObj=NULL_var;
for (int i = 1; i <= pParamArray.Size(); i ++)
{
//是否存在该属性名
CATUnicodeString strDispName = pParamArray->GetDisplayName();
strDispName.ToUpper();
strKeyName.ToUpper();
if (strDispName == strKeyName)
{
CATICkeParm_var spPara = pParamArray;
strValue = spPara->Content();
bIsExist = TRUE;
break;
}
}
}
return bIsExist;
}