/// <summary>
        /// Creates the entity.
        /// </summary>
        /// <param name="objRequestInfo">The requestinfo object.</param>
        /// <param name="EntitiesElement">The entities element.</param>
        private void CreateRecord(Records records, XmlNode recordsNode)
        {
            XmlElement RecordElement;

            foreach (Record objRecord in records.RecordCollection)
            {
                RecordElement = objXmlDocument.CreateElement("record");
                recordsNode.AppendChild(RecordElement);
                if (objRecord.Order.Length > 0)
                {
                    XmlAttribute OrderAttribute = objXmlDocument.CreateAttribute("order");
                    RecordElement.Attributes.Append(OrderAttribute);
                    OrderAttribute.Value = objRecord.Order;
                }
                if (objRecord.RecordNumber.Length > 0)
                {
                    XmlAttribute RecordNumberAttribute = objXmlDocument.CreateAttribute("recordNumber");
                    RecordElement.Attributes.Append(RecordNumberAttribute);
                    RecordNumberAttribute.Value = objRecord.RecordNumber;
                }
                if (objRecord.RecordAttributes != null)
                {
                   CreateRecordAttributes(objRecord, RecordElement);
                }
            }
        }
        /// <summary>
        /// Creates the root element.
        /// </summary>
        /// <param name="objRequestInfo">The request info object.</param>
        /// <returns></returns>
        private XmlDocument CreateRootElement(Records records)
        {
            //Creating the root Xml Element RequestInfo.
            XmlElement RecordsElement = objXmlDocument.CreateElement("records");
            objXmlDocument.AppendChild(RecordsElement);

            //Creating the RequestInfo node with Name attribute.
            XmlNode RecordsNode = objXmlDocument.DocumentElement;
            if (records.RecordCollection != null)
            {
                //Method call to create Entity Node.
                CreateRecord(records, RecordsNode);
            }
            else
                objXmlDocument = null;

            //returns the final SearchRequest Xml.
            return objXmlDocument;
        }
 /// <summary>
 /// Creates the list viewer XML.
 /// </summary>
 /// <param name="records">The records.</param>
 /// <returns></returns>
 public XmlDocument CreateListViewerXML(Records records)
 {
     objXmlDocument = new XmlDocument();
     objXmlDocument = CreateRootElement(records);
     return objXmlDocument;
 }
Beispiel #4
0
 /// <summary>
 /// Sets the records data object.
 /// </summary>
 /// <param name="dtListDetails">The dt list details.</param>
 private void SetRecordsDataObject(DataTable listDetails)
 {
     objRecords = new Records();
     objRecords.Name = ListReportName;
     objRecords.RecordCollection = SetListDetail(listDetails);
 }