📄 role.cs
字号:
using System;
namespace HardwareDistributor.Business
{
public class Role : DataObject
{
#region Constants
public const string ROLE_COLUMN = "Role";
public const string ROLEID_COLUMN = "RoleId";
public const string ROLEEMAIL_COLUMN = "EmailAddress";
#endregion
#region Fields
private string _name = string.Empty;
private Nullable<int> _roleId = null;
private string _emailAddress = string.Empty;
#endregion
#region Constructor(s) & Dispose
/// <summary>
/// Create a new Role
/// </summary>
public Role() : base()
{
}
/// <summary>
/// Create an unmodified Role
/// </summary>
/// <param name="roleId">Id of the Role</param>
/// <param name="roleName">Name of the Role</param>
public Role(Nullable<int> roleId,
string roleName, string emailAddress)
{
_roleId = roleId;
_name = roleName;
_emailAddress = emailAddress;
_objectState= ObjectState.Unchanged;
}
#endregion
#region Properties
/// <summary>
/// Unique Role Id
/// </summary>
public Nullable<int> RoleId
{
get
{
return _roleId;
}
set
{
_roleId = ChangeKey<Nullable<int>>(_roleId, value,
ROLEID_COLUMN);
}
}
/// <summary>
/// Name that describes the Role
/// </summary>
public string RoleName
{
get
{
return _name;
}
set
{
// If needed put additional editing before the change value.
_name = ChangeValue<string>(_name, value, ROLE_COLUMN);
}
}
/// <summary>
/// Email address for the role
/// </summary>
public string EmailAddress
{
get { return _emailAddress; }
set { _emailAddress = ChangeValue<string>(_name, value, ROLEEMAIL_COLUMN); ; }
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -