public List <string> GetClassificationAttributes(KCInventoryItemAPIHelper helper) { List <KNSIKCClassificationsMapping> classificationsMapping = GetMappedClassifications(); List <string> classificationsAttributes = new List <string>(); APIResultOfArrayOfClassificationConfigurationInformation classifications = helper.GetClassifications(); List <ClassificationConfigurationInformationAttribute[]> attributeArrays = new List <ClassificationConfigurationInformationAttribute[]>(); if (classifications.ResultData == null) { throw new PXException(KCMessages.NoClassificationsFound); } foreach (ClassificationConfigurationInformation classification in classifications.ResultData) { KNSIKCClassification savedClassification = Classifications.Select().RowCast <KNSIKCClassification>().Where(x => x.ClassificationName.Equals(classification.Name)).FirstOrDefault(); foreach (KNSIKCClassificationsMapping mapping in classificationsMapping) { if (savedClassification != null && mapping.IsMapped == true && mapping.ClassificationID == savedClassification.ClassificationID) { attributeArrays.Add(classification.ClassificationConfigurationInformationAttributeArray); } } } foreach (ClassificationConfigurationInformationAttribute[] attributeArray in attributeArrays) { if (attributeArray != null && attributeArray.Count() > 0) { foreach (ClassificationConfigurationInformationAttribute attribute in attributeArray) { classificationsAttributes.Add(attribute.Name.Trim().ToUpper()); } } } return(classificationsAttributes); }
public void FillClassificationsFromCA(KCInventoryItemAPIHelper helper, List <string> newNames) { APIResultOfArrayOfClassificationConfigurationInformation classifications = helper.GetClassifications(); try { classifications.ResultData.ForEach(x => newNames.Add(x.Name)); } catch (System.ArgumentNullException ex) { throw new PXException(KCMessages.NoClassificationsFound); } }