using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace YLErp.DBModels
{
public class BaseSystemUser
{
public int Id { get; set; }
///
/// 0=正常 1=禁用
///
public int State { get; set; }
[Required]
[DisplayName("登录名")]
[MaxLength(50)]
public string LoginName { get; set; }
[Required]
[MaxLength(50)]
[DisplayName("姓名")]
public string Name { get; set; }
[DisplayName("邮箱")]
[MaxLength(50)]
public string Email { get; set; }
[DisplayName("QT")]
[MaxLength(50)]
public string QQ { get; set; }
[DisplayName("手机号")]
[MaxLength(50)]
public string Mobile { get; set; }
[DisplayName("座机号")]
[MaxLength(50)]
public string Tel { get; set; }
[DisplayName("角色类型")]
[MaxLength(500)]
public string RoleType { get; set; }
[DisplayName("业务组")]
public string UserGroup { get; set; }
///
/// 1 客户经理,2 交易员 ,3 客户经理+交易员
///
[DisplayName("账号岗位")]
public int AccountPost { get; set; }
[DisplayName("隶属账号")]
public int? ParentId { get; set; }
///
/// VarietyIds为0代表用户一个品种都不能操作
/// VarietyIds为空代表客户默认全品种操作
///
[DisplayName("品种")]
public string VarietyIds { get; set; }
///
/// oa账号
///
[DisplayName("OA账号")]
[Column("oa_account")]
public string OaAccount { get; set; }
public List VarietyIdList
{
get
{
if (string.IsNullOrEmpty(VarietyIds))
{
return new List();
}
return VarietyIds.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Select(a => Convert.ToInt32(a)).ToList();
}
}
public override string ToString()
{
return Id + "--" + LoginName;
}
}
}