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.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)