Esempio n. 1
0
 /// <summary>
 /// Set the attributes for each record and returns the RecordInfo object
 /// </summary>
 /// <param name="dataRow">DataRow</param>
 /// <returns>RecordInfo</returns>
 private RecordInfo SetRecordInfo(DataRow dataRow)
 {
     RecordInfo objRecordInfo = null;
     try
     {
         objRecordInfo = new RecordInfo();
         switch (ListReportName.ToString())
         {
             case "Audit Trail":
                 {
                     objRecordInfo.Attributes = SetAuditHistory(dataRow);
                     break;
                 }
             case MASTERPAGEREPORT:
                 {
                     objRecordInfo.Attributes = SetMasterAttributes(dataRow);
                     break;
                 }
             case TEMPLATEREPORT:
                 {
                     objRecordInfo.Attributes = SetTemplateAttributes(dataRow);
                     break;
                 }
             case TEMPLATEPAGESREPORT:
                 {
                     objRecordInfo.Attributes = SetTemplatePagesAttributes(dataRow);
                     break;
                 }
             case WELLBOOKREPORT:
                 {
                     objRecordInfo.Attributes = SetBookAttributes(dataRow);
                     break;
                 }
             case CHAPTERPAGEMAPPINGREPORT:
                 {
                     objRecordInfo.Attributes = SetBookPagesAttributes(dataRow);
                     break;
                 }
             case CHAPTERPAGEREPORT:
                 {
                     objRecordInfo.Attributes = SetChapterPagesAttributes(dataRow);
                     break;
                 }
             case CHAPTERREPORT:
                 {
                     objRecordInfo.Attributes = SetBookChaptersAttributes(dataRow);
                     break;
                 }
             case USERREGISTRATION:
                 {
                     objRecordInfo.Attributes = SetUserAttributes(dataRow);
                     break;
                 }
             case TEAMREGISTRATION:
                 {
                     objRecordInfo.Attributes = SetTeamAttributes(dataRow);
                     break;
                 }
             case STAFFREGISTRATION:
                 {
                     objRecordInfo.Attributes = SetStaffAttributes(dataRow);
                     break;
                 }
             case DWBHOME:
                 {
                     objRecordInfo.Attributes = SetDWBHomeAttributes(dataRow);
                     break;
                 }
             case WELLBOOKPAGEVIEW:
                 {
                     objRecordInfo.Attributes = SetWellBookPageSummaryAttributes(dataRow);
                     break;
                 }
         }
         return objRecordInfo;
     }
     catch
     {
         throw;
     }
 }
        /// <summary>
        /// Creates the record info.
        /// </summary>
        /// <param name="recordInfo">The record info.</param>
        /// <param name="recordElement">The record element.</param>
        private void CreateRecordInfo(RecordInfo recordInfo, XmlElement recordElement)
        {
            XmlElement RecordInfoElement = objXmlDocument.CreateElement("recordInfo");
            recordElement.AppendChild(RecordInfoElement);
            foreach (Attributes objAttribute in recordInfo.Attributes)
            {
                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;
                }
            }
        }