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

Eucalypto - ASP.NET CMS Library using NHibernate

Rate me:
Please Sign up or sign in to vote.
4.84/5 (36 votes)
10 Jun 2009MIT24 min read 321.9K   4.6K   260  
An ASP.NET server library for creating CMS website (forums, articles/wiki, news, users/roles, ...), using NHibernate for data access.
using System;
using System.Collections.Generic;
using System.Text;

namespace Eucalypto.Wiki
{
    public abstract class ArticleBase : IAudit, IOwner
    {
        protected ArticleBase()
        {

        }

        /// <summary>
        /// Copy constructor
        /// </summary>
        /// <param name="other"></param>
        public ArticleBase(ArticleBase other)
        {
            Owner = other.Owner;
            Title = other.Title;
            Description = other.Description;
            Body = other.Body;
            TOC = other.TOC;
            Version = other.Version;
            Author = other.Author;
            UpdateUser = other.UpdateUser;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="pOwner">The owner is the same of the update user when creating the article</param>
        /// <param name="pTitle"></param>
        public ArticleBase(string pOwner, string pTitle)
        {
            Owner = pOwner;
            Title = pTitle;
            UpdateUser = pOwner;
        }

        private string mId;
        public virtual string Id
        {
            get { return mId; }
            protected set { mId = value; }
        }

        private int mVersion = 1;
        public virtual int Version
        {
            get { return mVersion; }
            protected set { mVersion = value; }
        }

        public virtual void IncrementVersion()
        {
            Version++;
        }

        private string mOwner;
        /// <summary>
        /// Gets or sets the original user that has create the article and that has the ownership of it
        /// </summary>
        public virtual string Owner
        {
            get { return mOwner; }
            protected set { mOwner = value; }
        }

        private string mUpdateUser;
        /// <summary>
        /// Gets or sets a free text field used to store the update user informations (last update)
        /// </summary>
        public virtual string UpdateUser
        {
            get { return mUpdateUser; }
            set { mUpdateUser = value; }
        }

        private string mTitle;
        public virtual string Title
        {
            get { return mTitle; }
            set { mTitle = value; }
        }

        private string mDescription;
        public virtual string Description
        {
            get { return mDescription; }
            set { mDescription = value; }
        }

        private string mBody;
        public virtual string Body
        {
            get { return mBody; }
            set { mBody = value; }
        }

        private string mTOC;
        /// <summary>
        /// Gets or sets the table of contents
        /// </summary>
        public virtual string TOC
        {
            get { return mTOC; }
            set { mTOC = value; }
        }

        private string mAuthor;
        /// <summary>
        /// Gets or sets a free text field used to store the author informations (that can be different from the owner)
        /// </summary>
        public virtual string Author
        {
            get { return mAuthor; }
            set { mAuthor = value; }
        }

        private DateTime mInsertDate;
        public virtual DateTime InsertDate
        {
            get { return mInsertDate; }
            set { mInsertDate = value; }
        }

        private DateTime mUpdateDate;
        public virtual DateTime UpdateDate
        {
            get { return mUpdateDate; }
            set { mUpdateDate = value; }
        }

        private string mTag;
        /// <summary>
        /// Field that can be used for user defined extensions.
        /// </summary>
        public virtual string Tag
        {
            get { return mTag; }
            set { mTag = value; }
        }
    }
}

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
Software Developer
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions