DictionaryItemView.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.Linq;
  6. using System.Text;
  7. namespace EMIS.ViewModel.SystemView
  8. {
  9. public class DictionaryItemView
  10. {
  11. /// <summary>
  12. /// 字典元素主键ID
  13. /// </summary>
  14. [DisplayName("字典元素主键ID")]
  15. public Guid DictionaryItemID { get; set; }
  16. /// <summary>
  17. /// 类型代码
  18. /// </summary>
  19. [Required]
  20. [DisplayName("类型代码")]
  21. public string DictionaryCode { get; set; }
  22. /// <summary>
  23. /// 类型名称
  24. /// </summary>
  25. [DisplayName("类型名称")]
  26. public string DictionaryName { get; set; }
  27. /// <summary>
  28. /// 序号
  29. /// </summary>
  30. [Required]
  31. [DisplayName("序号")]
  32. [RegularExpression(@"^[0-9]*[1-9][0-9]*$", ErrorMessage = "请输入正整数")]
  33. public int? OrderNo { get; set; }
  34. /// <summary>
  35. /// 元素代码
  36. /// </summary>
  37. [Required]
  38. [DisplayName("元素代码")]
  39. [RegularExpression(@"^\w+$", ErrorMessage = "请输入数字或字符")]
  40. public string Code { get; set; }
  41. /// <summary>
  42. /// 元素名称
  43. /// </summary>
  44. [Required]
  45. [DisplayName("元素名称")]
  46. public string Name { get; set; }
  47. /// <summary>
  48. /// 元素值
  49. /// </summary>
  50. [Required]
  51. [DisplayName("元素值")]
  52. [RegularExpression(@"^[0-9]*[1-9][0-9]*$", ErrorMessage = "请输入正整数")]
  53. public int? Value { get; set; }
  54. /// <summary>
  55. /// 可否编辑
  56. /// </summary>
  57. [DisplayName("可否编辑")]
  58. public bool IsEditable { get; set; }
  59. /// <summary>
  60. /// 可否编辑
  61. /// </summary>
  62. [DisplayName("可否编辑")]
  63. public string IsEditableName
  64. {
  65. get
  66. {
  67. return IsEditable == true ? "是" : "否";
  68. }
  69. }
  70. /// <summary>
  71. /// 可否显示
  72. /// </summary>
  73. [DisplayName("可否显示")]
  74. public bool IsVisible { get; set; }
  75. /// <summary>
  76. /// 可否显示
  77. /// </summary>
  78. [DisplayName("可否显示")]
  79. public string IsVisibleName
  80. {
  81. get
  82. {
  83. return IsVisible == true ? "是" : "否";
  84. }
  85. }
  86. /// <summary>
  87. /// 状态
  88. /// </summary>
  89. [DisplayName("状态")]
  90. public int? RecordStatus { get; set; }
  91. }
  92. }