using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace WCS.Entity { public enum DeviceType { } public class WCS_DEVICE { [Key] [Required] [Display(Name = "设备编号")] [StringLength(50)] public string CODE { get; set; } [Display(Name = "设备名称")] [StringLength(50)] [Required] public string NAME { get; set; } //[Display(Name = "设备类型")] //[StringLength(100)] //[Required] //public string TYPE { get; set; } [Display(Name = "可用")] public bool ENABLED { get; set; } = true; [MaxLength(50)] [Required] [Display(Name = "更新者")] public string UPDATEUSER { get; set; } [Display(Name = "更新时间")] public DateTime UPDATETIME { get; set; } = DateTime.Now; [Timestamp] [Display(Name = "版本")] public byte[] VER { get; set; } public List PROTOCOLS { get; set; } = new List(); [InverseProperty("DEVICE")] public List ROUTES { get; set; } = new List(); [InverseProperty("START")] public List PATHS { get; set; } = new List(); /// /// 设备组中的内容 /// [InverseProperty("GROUP")] public List DEVICEGROUP { get; set; } = new List(); public override string ToString() { return CODE; } } public class WCS_DEVICEPROTOCOL : OBJ { [Display(Name = "设备")] [Required] public WCS_DEVICE DEVICE { get; set; } [Display(Name = "DB块")] [Required] public WCS_DATABLOCK DB { get; set; } [Display(Name = "起始位置")] public Int16 POSITION { get; set; } } }