using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using ChangkeTec.SDMS.Model.Attributes; using ChangkeTec.SDMS.Model.Base; using ChangkeTec.SDMS.Model.Enums; namespace ChangkeTec.SDMS.Model.DataCenterTables { [Description("用户表")] public class TA_USER : IUpdatableTable, ISoftDelete, IEnable, INotifyPropertyChanged { [IsDataGridColum(true, 1)] [Description("用户名")] [Required(ErrorMessage = "用户名不能为空")] [Index("IndexUser", Order = 0, IsUnique = true, IsClustered = false)] [StringLength(50)] public string UserName { get; set; } [IsDataGridColum(true, 2)] [Description("密码")] [Required(ErrorMessage = "密码不能为空")] [StringLength(50)] public string Password { get; set; } [IsDataGridColum(true, 3)] [Description("真实姓名")] [StringLength(50)] public string TrueName { get; set; } [IsDataGridColum(true, 7)] [ColumnSource(ColumnSourceType.TABLE, typeof(TA_DEPT), new[] {"DeptCode", "DeptName"})] //, "CompanyDeptSelector" [Description("部门编号")] [Required(ErrorMessage = "部门编号不能为空")] [StringLength(50)] public string DeptCode { get; set; } [ColumnSource(ColumnSourceType.ENUM, typeof(EnumUserType))] [IsDataGridColum(true, 5)] [Description("用户类型")] public EnumUserType UserType { get; set; } = EnumUserType.Admin; [IsDataGridColum(true, 12)] [Description("电子邮件")] [StringLength(50)] public string Email { get; set; } [IsDataGridColum(true, 13)] [Description("联系电话1")] [StringLength(50)] public string Phone1 { get; set; } [IsDataGridColum(true, 14)] [Description("联系电话2")] [StringLength(50)] public string Phone2 { get; set; } [IsDataGridColum(true, 9)] [Description("最后登录时间")] [Column(TypeName = "datetime2")] public DateTime? LastLoginTime { get; set; } [IsDataGridColum(true, 10)] [Description("最后登录IP地址")] [StringLength(50)] public string LastLoginIp { get; set; } [IsDataGridColum(true, 11)] [Description("最后登录电脑名称")] [StringLength(50)] public string LastLoginClient { get; set; } [IsDataGridColum(true, 8)] [Index("IndexUserSessionId", Order = 0, IsUnique = false, IsClustered = false)] [Description("会话编号")] [StringLength(50)] public string SessionId { get; set; } [Description("已删除")] public bool IsDeleted { get; set; } [Description("是否可用")] public bool Enable { get; set; } #region 公共字段 [Description("创建人")] [Required(AllowEmptyStrings = true)] [StringLength(50)] public string CreateUser { get; set; } = ""; [Description("创建时间")] public DateTime CreateTime { get; set; } = DateTime.Now; [Description("修改人")] [StringLength(50)] public string UpdateUser { get; set; } = ""; [Description("修改时间")] public DateTime? UpdateTime { get; set; } = DateTime.Now; [IsDataGridColum(true, 15)] [Description("备注")] public string Remark { get; set; } [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int UID { get; set; } [Key] public Guid GUID { get; set; } = Guid.NewGuid(); #endregion #region INotifyPropertyChanged接口 public event PropertyChangedEventHandler PropertyChanged; public void NotityPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } #endregion } }