using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using CK.SCP.Models.Attributes;
using CK.SCP.Models.Base;

using CK.SCP.Models.ExchangeCenterTables;namespace CK.SCP.Models.DataCenterTables
{
    [Description("部门表")]
    public class TA_DEPT : IUpdatableTable, IEnable,IDomainSite
    {
        [IsDataGridColum(true, 1)]
        [Description("部门编号")]
        [Required(ErrorMessage = "部门编号不能为空.")]
        [Index("IndexDept", Order = 0, IsUnique = true, IsClustered = false)]
        [StringLength(50)]
        public string DeptCode { get; set; }

        [IsDataGridColum(true, 2)]
        [Description("部门名称")]
        [Required(ErrorMessage = "部门名称不能为空.")]
        [StringLength(50)]
        public string DeptName { get; set; }

        [Description("是否选中")]
        [NotMapped]
        public bool IsChecked { 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, 3)]
        [Description("备注")]
        public string Remark { get; set; }


        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int UID { get; set; }

        [Key]
        public Guid GUID { get; set; } = Guid.NewGuid();

        #endregion

        public bool Enable { get; set; }
        public string Domain { get; set; }
        public string Site { get; set; }
    }
}