/// <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.Record)
            {
                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.RecordInfo != null)
                {
                    CreateRecordInfo(objRecord.RecordInfo, RecordElement);
                }
                //if (objRecord.RecordHistories != null)
                //{
                //    CreateRecordHistories(objRecord.RecordHistories, RecordElement);
                //}
            }
        }
Esempio n. 2
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.Record = SetListDetail(listDetails);
 }
 /// <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;
 }
        /// <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.Record != null)
            {
                //Method call to create Entity Node.
                CreateRecord(records, RecordsNode);
            }
            else
                objXmlDocument = null;

            //returns the final SearchRequest Xml.
            return objXmlDocument;
        }