Click here to Skip to main content
15,896,063 members
Articles / Programming Languages / XML

netTierGenerator

Rate me:
Please Sign up or sign in to vote.
4.81/5 (20 votes)
30 Nov 2008CPOL14 min read 67.6K   2.8K   108  
A 3-tier application framework and code generation tool - the way for rapid and effective development.
using System;
using Sample.Common.Data;
using Sample.Common.Exception;
using Sample.Common.History;
using Sample.Common.Util;
using Sample.Common.Validation;
using Sample.Common.Administration;

namespace Sample.Model.Administration
{
	[Serializable]
	public partial class UserRoleInfoModel : BusinessEntity, ICloneable
	{
		#region Static Members
		private static readonly ValidationRules VALIDATION_RULES;
		#endregion Static Members

		#region members

		private Guid _userID;
		private Guid _roleID;

		#endregion members

		#region properties

		[HistoryAttribute()]
		public Guid UserID
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get { return this._userID; }
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				if (this._userID != value)
				{
					this.IsDirty = true;
				}
				this._userID = value;
			}
		}
		[HistoryAttribute()]
		public Guid RoleID
		{
			[global::System.Diagnostics.DebuggerStepThrough]
			get { return this._roleID; }
			[global::System.Diagnostics.DebuggerStepThrough]
			set
			{
				if (this._roleID != value)
				{
					this.IsDirty = true;
				}
				this._roleID = value;
			}
		}

		#endregion properties

		#region Constructors
		public UserRoleInfoModel(Guid _userID, Guid _roleID)
			: this()
		{
			this._userID = _userID;
			this._roleID = _roleID;
		}
		static UserRoleInfoModel()
		{
			UserRoleInfoModel.VALIDATION_RULES = new ValidationRules();
			UserRoleInfoModel.AddDatabaseSchemaRules();
			UserRoleInfoModel.AddCustomRules();
		}
		#endregion Constructors

		#region Public Methods
		public override string TranslatePropertyName(string name)
		{
			return Sample.Model.Administration.Resources.UserRoleInfo.ResourceManager.GetString(name);
		}
		public void Validate()
		{
			ValidationResult validationResult = UserRoleInfoModel.VALIDATION_RULES.Validate(this);

			if (!validationResult.IsValid)
			{
				throw new ValidationException(this, validationResult);
			}
		}
		#endregion Public Methods

		#region Static Methods
		private static void AddDatabaseSchemaRules()
		{
			UserRoleInfoModel.VALIDATION_RULES.AddRule(CommonRules.NotNull, "RoleID");
		}
		#endregion Static Methods

		#region ICloneable Members
		public object Clone()
		{
			UserRoleInfoModel clone = new UserRoleInfoModel();
			clone.UserID = this.UserID;
			clone.RoleID = this.RoleID;
			return clone;
		}
		#endregion ICloneable Members
	}
}

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 Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions