ASP.NET&Spring.NET&NHibernate最佳实践(九)——第4章权限子系统(2)
4.1. 权限子系统领域模型层(DomainModel)
应用程序(Application.cs)
角色(Role.cs)
用户(User.cs)
应用程序(Application.cs)
using System;
using System.Collections.Generic;
using System.Text;
namespace Guushuuse.SalaryPrj.Security.DomainModel
{
/// <summary>
/// 应用程序
/// </summary>
[Serializable]
public class Application
{
private int _id;
private string _name;
private string _description;
属性 属性
构造函数 构造函数
方法 方法
}
}
using System.Collections.Generic;
using System.Text;
namespace Guushuuse.SalaryPrj.Security.DomainModel
{
/// <summary>
/// 应用程序
/// </summary>
[Serializable]
public class Application
{
private int _id;
private string _name;
private string _description;
属性 属性
构造函数 构造函数
方法 方法
}
}
角色(Role.cs)
using System;
using System.Collections.Generic;
using System.Text;
namespace Guushuuse.SalaryPrj.Security.DomainModel
{
/// <summary>
/// 角色
/// </summary>
[Serializable]
public class Role
{
private int _id;
private string _name;
private string _description;
private Application _application;
属性 属性
构造函数 构造函数
方法 方法
}
}
using System.Collections.Generic;
using System.Text;
namespace Guushuuse.SalaryPrj.Security.DomainModel
{
/// <summary>
/// 角色
/// </summary>
[Serializable]
public class Role
{
private int _id;
private string _name;
private string _description;
private Application _application;
属性 属性
构造函数 构造函数
方法 方法
}
}
用户(User.cs)
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Web.Security;
namespace Guushuuse.SalaryPrj.Security.DomainModel
{
/// <summary>
/// 用户
/// </summary>
[Serializable]
public class User
{
private int _id;
private string _username;
private string _email;
private string _password;
private MembershipPasswordFormat _passwordFormat;
private string _passwordSalt;
private string _passwordQuestion;
private string _passwordAnswer;
private bool _isAnonymous;
private bool _isApproved;
private bool _isLockedOut;
private DateTime _createDate;
private DateTime _lastActivityDate;
private DateTime _lastLoginDate;
private DateTime _lastPasswordChangedDate;
private DateTime _lastLockoutDate;
private int _failedPasswordAttemptCount;
private DateTime _failedPasswordAttemptWindowStart;
private int _failedPasswordAnswerAttemptCount;
private DateTime _failedPasswordAnswerAttemptWindowStart;
private string _comment;
private Application _application;
private IList _roles;
属性 属性
构造函数 构造函数
方法 方法
}
}
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Web.Security;
namespace Guushuuse.SalaryPrj.Security.DomainModel
{
/// <summary>
/// 用户
/// </summary>
[Serializable]
public class User
{
private int _id;
private string _username;
private string _email;
private string _password;
private MembershipPasswordFormat _passwordFormat;
private string _passwordSalt;
private string _passwordQuestion;
private string _passwordAnswer;
private bool _isAnonymous;
private bool _isApproved;
private bool _isLockedOut;
private DateTime _createDate;
private DateTime _lastActivityDate;
private DateTime _lastLoginDate;
private DateTime _lastPasswordChangedDate;
private DateTime _lastLockoutDate;
private int _failedPasswordAttemptCount;
private DateTime _failedPasswordAttemptWindowStart;
private int _failedPasswordAnswerAttemptCount;
private DateTime _failedPasswordAnswerAttemptWindowStart;
private string _comment;
private Application _application;
private IList _roles;
属性 属性
构造函数 构造函数
方法 方法
}
}
posted on 2008-05-17 14:27 guushuuse 阅读(1804) 评论(1) 编辑 收藏 举报