UserView.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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. using EMIS.ViewModel.CacheManage;
  8. namespace EMIS.ViewModel.SystemManage.UserManage
  9. {
  10. public class UserView
  11. {
  12. /// <summary>
  13. /// 主键ID
  14. /// </summary>
  15. [DisplayName("主键ID")]
  16. public Guid UserID { get; set; }
  17. /// <summary>
  18. /// 用户名
  19. /// </summary>
  20. [Required]
  21. [DisplayName("用户名")]
  22. [RegularExpression(@"^[0-9a-zA-Z\s?]+$", ErrorMessage = "请输入数字或英文字母")]
  23. public string LoginID { get; set; }
  24. /// <summary>
  25. /// 姓名
  26. /// </summary>
  27. [Required]
  28. [DisplayName("姓名")]
  29. public string Name { get; set; }
  30. /// <summary>
  31. /// 性别
  32. /// </summary>
  33. [DisplayName("性别")]
  34. public int? SexID { get; set; }
  35. /// <summary>
  36. /// 性别
  37. /// </summary>
  38. [DisplayName("性别")]
  39. public string SexName
  40. {
  41. get
  42. {
  43. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Sex.ToString()).Where(x => x.Value == SexID).Select(x => x.Name).FirstOrDefault();
  44. }
  45. }
  46. /// <summary>
  47. /// 出生日期
  48. /// </summary>
  49. [DisplayName("出生日期")]
  50. [DataType(DataType.DateTime)]
  51. [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}")]
  52. public DateTime? BirthDate { get; set; }
  53. /// <summary>
  54. /// 校区ID
  55. /// </summary>
  56. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")]
  57. public Guid? CampusID { get; set; }
  58. /// <summary>
  59. /// 校区代码
  60. /// </summary>
  61. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "CampusCode")]
  62. public string CampusCode { get; set; }
  63. /// <summary>
  64. /// 校区名称
  65. /// </summary>
  66. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")]
  67. public string CampusName { get; set; }
  68. /// <summary>
  69. /// 院系所ID
  70. /// </summary>
  71. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  72. public Guid? CollegeID { get; set; }
  73. /// <summary>
  74. /// 院系所代码
  75. /// </summary>
  76. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "CollegeCode")]
  77. public string CollegeCode { get; set; }
  78. /// <summary>
  79. /// 院系所
  80. /// </summary>
  81. [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")]
  82. public string CollegeName { get; set; }
  83. /// <summary>
  84. /// 教研室ID
  85. /// </summary>
  86. [DisplayName("教研室ID")]
  87. public Guid? DepartmentID { get; set; }
  88. /// <summary>
  89. /// 教研室代码
  90. /// </summary>
  91. [DisplayName("教研室代码")]
  92. public string DepartmentCode { get; set; }
  93. /// <summary>
  94. /// 教研室
  95. /// </summary>
  96. [DisplayName("教研室")]
  97. public string DepartmentName { get; set; }
  98. /// <summary>
  99. /// 角色ID
  100. /// </summary>
  101. [DisplayName("角色ID")]
  102. public Guid? RoleID { get; set; }
  103. /// <summary>
  104. /// 角色序号
  105. /// </summary>
  106. [DisplayName("角色序号")]
  107. public int? RoleOrderNo { get; set; }
  108. /// <summary>
  109. /// 角色名称
  110. /// </summary>
  111. [DisplayName("角色名称")]
  112. public string RoleName { get; set; }
  113. /// <summary>
  114. /// 角色类型
  115. /// </summary>
  116. [DisplayName("角色类型")]
  117. public int? TypeID { get; set; }
  118. /// <summary>
  119. /// 角色类型
  120. /// </summary>
  121. [DisplayName("角色类型")]
  122. public string TypeName
  123. {
  124. get
  125. {
  126. return IdNameExt.GetDictionaryItem(DictionaryItem.SYS_RoleType.ToString()).Where(x => x.Value == TypeID).Select(x => x.Name).FirstOrDefault();
  127. }
  128. }
  129. /// <summary>
  130. /// 数据范围
  131. /// </summary>
  132. [DisplayName("数据范围")]
  133. public int? DataRange { get; set; }
  134. /// <summary>
  135. /// 数据范围
  136. /// </summary>
  137. [DisplayName("数据范围")]
  138. public string DataRangeName
  139. {
  140. get
  141. {
  142. return IdNameExt.GetDictionaryItem(DictionaryItem.SYS_DataRange.ToString()).Where(x => x.Value == DataRange).Select(x => x.Name).FirstOrDefault();
  143. }
  144. }
  145. /// <summary>
  146. /// 角色状态
  147. /// </summary>
  148. [DisplayName("角色状态")]
  149. public int? RoleStatus { get; set; }
  150. /// <summary>
  151. /// 角色状态
  152. /// </summary>
  153. [DisplayName("数据范围")]
  154. public string RoleStatusName
  155. {
  156. get
  157. {
  158. return IdNameExt.GetDictionaryItem(DictionaryItem.SYS_STATUS.ToString()).Where(x => x.Value == RoleStatus).Select(x => x.Name).FirstOrDefault();
  159. }
  160. }
  161. /// <summary>
  162. /// 备注
  163. /// </summary>
  164. [DisplayName("备注")]
  165. public string Remark { get; set; }
  166. /// <summary>
  167. /// 帐号状态
  168. /// </summary>
  169. [DisplayName("帐号状态")]
  170. public Nullable<int> RecordStatus { get; set; }
  171. /// <summary>
  172. /// 帐号状态
  173. /// </summary>
  174. [DisplayName("帐号状态")]
  175. public string RecordStatusName
  176. {
  177. get
  178. {
  179. return IdNameExt.GetDictionaryItem(DictionaryItem.SYS_STATUS.ToString()).Where(x => x.Value == RecordStatus).Select(x => x.Name).FirstOrDefault();
  180. }
  181. }
  182. /// <summary>
  183. /// 创建人
  184. /// </summary>
  185. [DisplayName("创建人")]
  186. public Nullable<System.Guid> CreateUserID { get; set; }
  187. /// <summary>
  188. /// 创建人
  189. /// </summary>
  190. [DisplayName("创建人")]
  191. public string CreateUserName { get; set; }
  192. /// <summary>
  193. /// 创建时间
  194. /// </summary>
  195. [DisplayName("创建时间")]
  196. public Nullable<System.DateTime> CreateTime { get; set; }
  197. /// <summary>
  198. /// 修改人
  199. /// </summary>
  200. [DisplayName("修改人")]
  201. public Nullable<System.Guid> ModifyUserID { get; set; }
  202. /// <summary>
  203. /// 修改人
  204. /// </summary>
  205. [DisplayName("修改人")]
  206. public string ModifyUserName { get; set; }
  207. /// <summary>
  208. /// 修改时间
  209. /// </summary>
  210. [DisplayName("修改时间")]
  211. public Nullable<System.DateTime> ModifyTime { get; set; }
  212. }
  213. }