Hello,
Thank you for the propt response.
I am implementing a data verification and measurement subsystem.
We implemented data delivery system from the PLM to out ERP. The data verification subsystem checks the Part BOM table agains the ERP BOM table to identify delivery issues.
The measurement subsystem is a sort of BI, that collects data from the ARAS as well as from the ERP and other data bases, manipulates them and create data for statistical processes.
The other applications does not use XML or similar protocols. As I had to manipulate data from all of them, I select List<string[]> as the basis object structure; I convert data from all the DBs into this object type and manipulate it. Then I'm preparing the output data from thse objects.
The following is an example of converting method, which is used widely; however, thre are instances that this method doesn't work, and I have specialized methods.
The header input parameter is a list of the fields read from the PLM, serving as the columns names of the output table
private List<string[]> itemToList(Item results, string[] header, out string err)
{
err = "";
List<string[]> localClassList = new List<string[]>();
// Convert the data received from the PLM into List <string[]>
int resultsRowsCount = results.getItemCount();
List<string> distinct = new List<string>();
for (int rowPtr = 0; rowPtr < resultsRowsCount; rowPtr++)
{
Item itemTemp = results.getItemByIndex(rowPtr); // Exception will be caught in higher level
if (itemTemp != null)
{
List<string> strArray = new List<string>();
// Convert the data item by item according to the field names packed in HEADER.
for (int i = 0; i < header.Length; i++)
{
string[] headerParts = header.Split('|');
if (headerParts.Length == 1)
strArray.Add(itemTemp.getProperty(header.Trim(), ""));
else
{
Item it = itemTemp.getPropertyItem(headerParts[0]);
if (it != null)
strArray.Add(it.getProperty(headerParts[1].Trim(), ""));
}
}
if (!distinct.Contains(strArray[0]))
{
distinct.Add(strArray[0]);
localClassList.Add(strArray.ToArray());
}
}
}
return localClassList;
}