Click here to Skip to main content
15,892,809 members
Articles / Web Development / ASP.NET

Open Source Extensible Enterprise n-tier Application Framework with Multilayered Architecture

Rate me:
Please Sign up or sign in to vote.
4.67/5 (2 votes)
3 Dec 2010MIT3 min read 37K   770   41  
Xenta architecture overview
using System;
using SiberTek.Xenta.Managers;
using SiberTek.Xenta.Entities.Collections;
using SiberTek.Xenta.Enums;

namespace SiberTek.Xenta.Entities
{
    /// <summary>
    /// Represents an forum entity
    /// </summary>
    public class ForumInfo : BusinessEntityBase
    {
        #region Fields
        private int _forumID;
        private int _parentForumID;
        private string _title;
        private string _description;
        private int _lastTopicID;
        private int _topicCount;
        private int _lastPostID;
        private int _postCount;
        private int _displayOrder;
        private bool _isActive;
        private DateTime _createdOn;
        private DateTime _updatedOn;
        #endregion

        #region Constructors
        public ForumInfo() : this(0, 0, String.Empty, String.Empty, 0, 0, 0, 0, 0, false, DateTime.UtcNow, DateTime.UtcNow)
        {
        }

        public ForumInfo(int forumID, int parentForumID, string title, string description, int lastTopicID, int topicCount, int lastPostID, int postCount, int displayOrder, bool isActive, DateTime createdOn, DateTime updatedOn)
        {
            _forumID = forumID;
            _parentForumID = parentForumID;
            _title = title;
            _description = description;
            _lastTopicID = lastTopicID;
            _topicCount = topicCount;
            _lastPostID = lastPostID;
            _postCount = postCount;
            _displayOrder = displayOrder;
            _isActive = isActive;
            _createdOn = createdOn;
            _updatedOn = updatedOn;
        }
        #endregion

        #region Properties
        public int ForumID
        {
            get
            {
                return _forumID;
            }
            set
            {
                _forumID = value;
            }
        }

        public int ParentForumID
        {
            get
            {
                return _parentForumID;
            }
            set
            {
                _parentForumID = value;
            }
        }

        public ForumInfo ParentForum
        {
            get
            {
                return ForumManager.Instance.GetForum(ParentForumID);
            }
        }

        public ForumInfoCollection ChildForums
        {
            get
            {
                return ForumManager.Instance.GetForumsByParentForumID(ForumID, true);
            }
        }

        public string Title
        {
            get
            {
                return _title;
            }
            set
            {
                _title = value;
            }
        }

        public string Description
        {
            get
            {
                return _description;
            }
            set
            {
                _description = value;
            }
        }

        public int LastTopicID
        {
            get
            {
                return _lastTopicID;
            }
            set
            {
                _lastTopicID = value;
            }
        }

        public ForumTopicInfo LastTopic
        {
            get
            {
                return ForumTopicManager.Instance.GetForumTopic(LastTopicID);
            }
        }

        public ForumTopicInfoCollection Topics
        {
            get
            {
                return ForumTopicManager.Instance.GetForumTopicsByForumID(ForumID, true);
            }
        }

        public int TopicCount
        {
            get
            {
                return _topicCount;
            }
            set
            {
                _topicCount = value;
            }
        }

        public int LastPostID
        {
            get
            {
                return _lastPostID;
            }
            set
            {
                _lastPostID = value;
            }
        }

        public ForumPostInfo LastPost
        {
            get
            {
                return ForumPostManager.Instance.GetForumPost(LastPostID);
            }
        }

        public int PostCount
        {
            get
            {
                return _postCount;
            }
            set
            {
                _postCount = value;
            }
        }

        public int DisplayOrder
        {
            get
            {
                return _displayOrder;
            }
            set
            {
                _displayOrder = value;
            }
        }

        public bool IsActive
        {
            get
            {
                return _isActive;
            }
            set
            {
                _isActive = value;
            }
        }

        public DateTime CreatedOn
        {
            get
            {
                return _createdOn;
            }
            set
            {
                _createdOn = value;
            }
        }


        public DateTime UpdatedOn
        {
            get
            {
                return _updatedOn;
            }
            set
            {
                _updatedOn = value;
            }
        }

        public ForumSubscriptionInfoCollection Subscriptions
        {
            get
            {
                return ForumSubscriptionManager.Instance.GetForumSubscriptionsByForumEntityID(ForumSubscriptionType.Forum, ForumID);
            }
        }
        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions