WCS_DEVICE.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace WCS.Entity
  6. {
  7. public enum DeviceType
  8. {
  9. }
  10. public class WCS_DEVICE
  11. {
  12. [Key]
  13. [Required]
  14. [Display(Name = "设备编号")]
  15. [StringLength(50)]
  16. public string CODE { get; set; }
  17. [Display(Name = "设备名称")]
  18. [StringLength(50)]
  19. [Required]
  20. public string NAME { get; set; }
  21. //[Display(Name = "设备类型")]
  22. //[StringLength(100)]
  23. //[Required]
  24. //public string TYPE { get; set; }
  25. [Display(Name = "可用")]
  26. public bool ENABLED { get; set; } = true;
  27. [MaxLength(50)]
  28. [Required]
  29. [Display(Name = "更新者")]
  30. public string UPDATEUSER { get; set; }
  31. [Display(Name = "更新时间")]
  32. public DateTime UPDATETIME { get; set; } = DateTime.Now;
  33. [Timestamp]
  34. [Display(Name = "版本")]
  35. public byte[] VER { get; set; }
  36. public List<WCS_DEVICEPROTOCOL> PROTOCOLS { get; set; } = new List<WCS_DEVICEPROTOCOL>();
  37. [InverseProperty("DEVICE")]
  38. public List<WCS_ROUTE> ROUTES { get; set; } = new List<WCS_ROUTE>();
  39. [InverseProperty("START")]
  40. public List<WCS_PATH> PATHS { get; set; } = new List<WCS_PATH>();
  41. /// <summary>
  42. /// 设备组中的内容
  43. /// </summary>
  44. [InverseProperty("GROUP")]
  45. public List<WCS_GROUPMEMBER> DEVICEGROUP { get; set; } = new List<WCS_GROUPMEMBER>();
  46. public override string ToString()
  47. {
  48. return CODE;
  49. }
  50. }
  51. public class WCS_DEVICEPROTOCOL : OBJ
  52. {
  53. [Display(Name = "设备")]
  54. [Required]
  55. public WCS_DEVICE DEVICE { get; set; }
  56. [Display(Name = "DB块")]
  57. [Required]
  58. public WCS_DATABLOCK DB { get; set; }
  59. [Display(Name = "起始位置")]
  60. public Int16 POSITION { get; set; }
  61. }
  62. }