WCS_DEVICE.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. //[NotMapped]
  37. public List<WCS_DEVICEPROTOCOL> PROTOCOLS { get; set; } = new List<WCS_DEVICEPROTOCOL>();
  38. //[NotMapped]
  39. [InverseProperty("DEVICE")]
  40. public List<WCS_ROUTE> ROUTES { get; set; } = new List<WCS_ROUTE>();
  41. //[NotMapped]
  42. [InverseProperty("START")]
  43. public List<WCS_PATH> PATHS { get; set; } = new List<WCS_PATH>();
  44. public override string ToString()
  45. {
  46. return CODE;
  47. }
  48. }
  49. public class WCS_DEVICEPROTOCOL : OBJ
  50. {
  51. [Display(Name = "设备")]
  52. [Required]
  53. public WCS_DEVICE DEVICE { get; set; }
  54. [Display(Name = "DB块")]
  55. [Required]
  56. public WCS_DATABLOCK DB { get; set; }
  57. [Display(Name = "起始位置")]
  58. public Int16 POSITION { get; set; }
  59. }
  60. }