/// <summary> /// Creates the record info. /// </summary> /// <param name="recordInfo">The record info.</param> /// <param name="recordElement">The record element.</param> private void CreateRecordAttributes(Record recordInfo, XmlElement recordElement) { XmlElement RecordInfoElement = objXmlDocument.CreateElement("recordInfo"); recordElement.AppendChild(RecordInfoElement); foreach (RecordAttribute objAttribute in recordInfo.RecordAttributes) { XmlElement AttributeElement = objXmlDocument.CreateElement("attribute"); RecordInfoElement.AppendChild(AttributeElement); //Creating attributes for Attribute Element. if (objAttribute.Name.ToString().Length > 0) { XmlAttribute AttributeName = objXmlDocument.CreateAttribute("name"); AttributeElement.Attributes.Append(AttributeName); AttributeName.Value = objAttribute.Name; } if (objAttribute.Value.ToString().Length > 0) { XmlAttribute AttributeValue = objXmlDocument.CreateAttribute("value"); AttributeElement.Attributes.Append(AttributeValue); AttributeValue.Value = objAttribute.Value; } if (objAttribute.Display.ToString().Length > 0) { XmlAttribute AttributeValue = objXmlDocument.CreateAttribute("display"); AttributeElement.Attributes.Append(AttributeValue); AttributeValue.Value = objAttribute.Display; } if (objAttribute.DataType.Length > 0) { XmlAttribute AttributeValue = objXmlDocument.CreateAttribute("datatype"); AttributeElement.Attributes.Append(AttributeValue); AttributeValue.Value = objAttribute.DataType; } } }
/// <summary> /// Set the Record and Attribute properties for each record in DataTable /// </summary> /// <param name="listDetails">DataTable</param> /// <returns>ArrayList</returns> private ArrayList SetListDetail(DataTable listDetails) { DataRow objDataRow; Record objRecord = null; ArrayList arlRecord = null; try { arlRecord = new ArrayList(); for (int intIndex = 0; intIndex < listDetails.Rows.Count; intIndex++) { objDataRow = listDetails.Rows[intIndex]; objRecord = new Record(); objRecord.Order = Convert.ToString(intIndex + 1); objRecord.RecordNumber = objDataRow["ID"].ToString(); objRecord.RecordAttributes = SetTeamRecordAttributes(objDataRow); arlRecord.Add(objRecord); } return arlRecord; } catch { throw; } }