RoleView.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel;
  7. using EMIS.Entities;
  8. namespace EMIS.ViewModel.SystemView
  9. {
  10. public class RoleView
  11. {
  12. [Required]
  13. [DisplayName("序号")]
  14. [RegularExpression(@"^[1-9]\d*|0$", ErrorMessage = "请输入自然数!")]
  15. public Nullable<int> OrderNo { get; set; }
  16. public Guid RoleID { get; set; }
  17. [Required]
  18. [DisplayName("角色ID")]
  19. public Nullable<int> TypeID { get; set; }
  20. public string TypeDesc { get; set; }
  21. [Required]
  22. [DisplayName("角色名称")]
  23. [StringLength(100)]
  24. public string RoleName { get; set; }
  25. [DisplayName("备注")]
  26. [StringLength(500)]
  27. public string Description { get; set; }
  28. public bool IsSystemRole { get; set; }
  29. public Nullable<int> SystemRoleType { get; set; }
  30. public string SystemRoleTypeDesc { get; set; }
  31. [Required]
  32. [DisplayName("数据范围")]
  33. public Nullable<int> DefaultDataRange { get; set; }
  34. public string DefaultDataRangeDesc { get; set; }
  35. [Required]
  36. [DisplayName("学生类别")]
  37. public Nullable<int> StudentType { get; set; }
  38. public string StudentTypeDesc { get; set; }
  39. public Nullable<int> RecordStatus { get; set; }
  40. public string RecordStatusDesc { get; set; }
  41. public Nullable<Guid> CreateUserID { get; set; }
  42. public string CreateUserName { get; set; }
  43. public Nullable<System.DateTime> CreateTime { get; set; }
  44. public Nullable<System.Guid> ModifyUserID { get; set; }
  45. public string ModifyUserName { get; set; }
  46. public Nullable<System.DateTime> ModifyTime { get; set; }
  47. public Sys_Role ParseToEntity()
  48. {
  49. Sys_Role role = new Sys_Role()
  50. {
  51. RoleID = this.RoleID,
  52. TypeID = this.TypeID,
  53. RoleName = this.RoleName,
  54. Description = this.Description,
  55. IsSystemRole = this.IsSystemRole,
  56. SystemRoleType = this.SystemRoleType,
  57. DefaultDataRange = this.DefaultDataRange,
  58. RecordStatus = this.RecordStatus,
  59. CreateUserID = this.CreateUserID,
  60. CreateTime = this.CreateTime,
  61. ModifyUserID = this.ModifyUserID,
  62. ModifyTime = this.ModifyTime,
  63. CF_StudentRole = new CF_StudentRole() {
  64. RoleID = this.RoleID,
  65. StudentType = this.StudentType,
  66. RecordStatus = this.RecordStatus,
  67. CreateUserID = this.CreateUserID,
  68. CreateTime = this.CreateTime,
  69. ModifyUserID = this.ModifyUserID,
  70. ModifyTime = this.ModifyTime
  71. }
  72. };
  73. return role;
  74. }
  75. }
  76. }