Esempio n. 1
0
        public void Fill(IDataReader dr)
        {
            JournalId     = Null.SetNullInteger(dr["JournalId"]);
            JournalTypeId = Null.SetNullInteger(dr["JournalTypeId"]);
            PortalId      = Null.SetNullInteger(dr["PortalId"]);
            UserId        = Null.SetNullInteger(dr["UserId"]);
            ProfileId     = Null.SetNullInteger(dr["ProfileId"]);
            SocialGroupId = Null.SetNullInteger(dr["GroupId"]);
            if (!String.IsNullOrEmpty(Null.SetNullString(dr["JournalXML"])))
            {
                JournalXML = new XmlDocument {
                    XmlResolver = null
                };
                JournalXML.LoadXml(dr["JournalXML"].ToString());
                XmlNode xRoot = JournalXML.DocumentElement;
                XmlNode xNode = xRoot.SelectSingleNode("//items/item/body");
                if (xNode != null)
                {
                    Body = xNode.InnerText;
                }
            }
            DateCreated = Null.SetNullDateTime(dr["DateCreated"]);
            DateUpdated = Null.SetNullDateTime(dr["DateUpdated"]);
            ObjectKey   = Null.SetNullString(dr["ObjectKey"]);
            AccessKey   = Null.SetNullGuid(dr["AccessKey"]);
            Title       = Null.SetNullString(dr["Title"]);
            Summary     = Null.SetNullString(dr["Summary"]);
            string itemd = Null.SetNullString(dr["ItemData"]);

            ItemData = new ItemData();
            if (!string.IsNullOrEmpty(itemd))
            {
                ItemData = itemd.FromJson <ItemData>();
            }
            ContentItemId = Null.SetNullInteger(dr["ContentItemId"]);
            JournalAuthor = new JournalEntity(dr["JournalAuthor"].ToString());
            JournalOwner  = new JournalEntity(dr["JournalOwner"].ToString());
            JournalType   = Null.SetNullString(dr["JournalType"]);

            IsDeleted        = Null.SetNullBoolean(dr["IsDeleted"]);
            CommentsDisabled = Null.SetNullBoolean(dr["CommentsDisabled"]);
            CommentsHidden   = Null.SetNullBoolean(dr["CommentsHidden"]);
            SimilarCount     = Null.SetNullInteger(dr["SimilarCount"]);
        }
Esempio n. 2
0
        public void Fill(IDataReader dr) {
            JournalId = Null.SetNullInteger(dr["JournalId"]);
            JournalTypeId = Null.SetNullInteger(dr["JournalTypeId"]);
            PortalId = Null.SetNullInteger(dr["PortalId"]);
            UserId = Null.SetNullInteger(dr["UserId"]);
            ProfileId = Null.SetNullInteger(dr["ProfileId"]);
            SocialGroupId = Null.SetNullInteger(dr["GroupId"]);
            if (!String.IsNullOrEmpty(Null.SetNullString(dr["JournalXML"]))) {
                JournalXML = new XmlDocument();
                JournalXML.LoadXml(dr["JournalXML"].ToString());
                XmlNode xRoot = JournalXML.DocumentElement;
                XmlNode xNode = xRoot.SelectSingleNode("//items/item/body");
                if (xNode != null) {
                    Body = xNode.InnerText;
                }
            }
            DateCreated = Null.SetNullDateTime(dr["DateCreated"]);
            DateUpdated = Null.SetNullDateTime(dr["DateUpdated"]);
            ObjectKey = Null.SetNullString(dr["ObjectKey"]);
            AccessKey = Null.SetNullGuid(dr["AccessKey"]);
            Title = Null.SetNullString(dr["Title"]);
            Summary = Null.SetNullString(dr["Summary"]);
            string itemd = Null.SetNullString(dr["ItemData"]);
            ItemData = new ItemData();
            if (!string.IsNullOrEmpty(itemd)) {
                ItemData = itemd.FromJson<ItemData>();
            }
            ContentItemId = Null.SetNullInteger(dr["ContentItemId"]);
            JournalAuthor = new JournalEntity(dr["JournalAuthor"].ToString());
            JournalOwner = new JournalEntity(dr["JournalOwner"].ToString());
            JournalType = Null.SetNullString(dr["JournalType"]);

            IsDeleted = Null.SetNullBoolean(dr["IsDeleted"]);
            CommentsDisabled = Null.SetNullBoolean(dr["CommentsDisabled"]);
            CommentsHidden = Null.SetNullBoolean(dr["CommentsHidden"]);
        }