Click here to Skip to main content
15,892,643 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 320.5K   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.Profile
{
    public class ProfileUser : IAudit
    {
        protected ProfileUser()
        {

        }

        public ProfileUser(string applicationName, string userName, ProfileType profileType)
        {
            ApplicationName = applicationName;
            Name = userName;
            ProfileType = profileType;
        }


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

        private string mName;
        public virtual string Name
        {
            get { return mName; }
            protected set
            {
                Eucalypto.EntityHelper.ValidateCode("Name", value);
                mName = 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 mApplicationName;
        public virtual string ApplicationName
        {
            get { return mApplicationName; }
            protected set { mApplicationName = value; }
        }

        private ProfileType mProfileType;
        public virtual ProfileType ProfileType
        {
            get { return mProfileType; }
            set { mProfileType = value; }
        }

        private DateTime mLastActivityDate = DateTime.Now;
        /// <summary>
        /// Changes when calling SetPropertyValues and GetPropertyValues method
        /// </summary>
        public virtual DateTime LastActivityDate
        {
            get { return mLastActivityDate; }
            set { mLastActivityDate = value; }
        }

        private DateTime mLastPropertyChangedDate = DateTime.Now;
        /// <summary>
        /// This property differs from the UpdateDate because change only when calling SetPropertyValues method
        /// </summary>
        public virtual DateTime LastPropertyChangedDate
        {
            get { return mLastPropertyChangedDate; }
            set { mLastPropertyChangedDate = value; }
        }

        private IList<ProfileProperty> mProperties;
        /// <summary>
        /// List used for cascading rules
        /// </summary>
        protected IList<ProfileProperty> Properties
        {
            get { return mProperties; }
            set { mProperties = value; }
        }
    }

    public enum ProfileType
    {
        Anonymous = 1,
        Authenticated = 2
    }
}

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