namespace ZR.Model.System.Dto
{
public class SysUserDto
{
public long UserId { get; set; }
public string UserName { get; set; }
public string NickName { get; set; }
public string Email { get; set; }
public string Remark { get; set; }
public string Phonenumber { get; set; }
public string Avatar { get; set; }
///
/// 用户性别(0男 1女 2未知)
///
public int Sex { get; set; }
public string Password { get; set; }
///
/// 帐号状态(0正常 1停用)
///
public int Status { get; set; }
///
/// 最后登录IP
///
public string LoginIP { get; set; }
///
/// 部门Id
///
public long DeptId { get; set; }
public string WelcomeContent { get; set; }
#region 表额外字段
[SugarColumn(IsIgnore = true)]
public bool IsAdmin
{
get
{
return UserId == 1;
}
}
///
/// 拥有角色个数
///
//[SugarColumn(IsIgnore = true)]
//public int RoleNum { get; set; }
[SugarColumn(IsIgnore = true)]
public string DeptName { get; set; }
///
/// 角色id集合
///
[ExcelIgnore]
public long[] RoleIds { get; set; }
///
/// 岗位集合
///
[SugarColumn(IsIgnore = true)]
[ExcelIgnore]
public int[] PostIds { get; set; }
[SugarColumn(IsIgnore = true)]
[ExcelIgnore]
public List Roles { get; set; }
[SugarColumn(IsIgnore = true)]
public string WelcomeMessage
{
get
{
int now = DateTime.Now.Hour;
if (now > 0 && now <= 6)
{
return "午夜好";
}
else if (now > 6 && now <= 11)
{
return "早上好";
}
else if (now > 11 && now <= 14)
{
return "中午好";
}
else if (now > 14 && now <= 18)
{
return "下午好";
}
else
{
return "晚上好";
}
}
}
#endregion
}
public class SysUserQueryDto
{
public long? UserId { get; set; }
public string UserName { get; set; }
public string NickName { get; set; }
public string Email { get; set; }
public string Remark { get; set; }
public string Phonenumber { get; set; }
///
/// 用户性别(0男 1女 2未知)
///
public int Sex { get; set; }
public DateTime? BeginTime { get; set; }
public DateTime? EndTime { get; set; }
public int Status { get; set; }
public long DeptId { get; set; }
}
}