using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel.DataAnnotations; using System.ComponentModel; using EMIS.Entities; namespace EMIS.ViewModel.SystemView { public class RoleView { [Required] [DisplayName("序号")] [RegularExpression(@"^[1-9]\d*|0$", ErrorMessage = "请输入自然数!")] public Nullable OrderNo { get; set; } public Guid RoleID { get; set; } [Required] [DisplayName("角色ID")] public Nullable TypeID { get; set; } public string TypeDesc { get; set; } [Required] [DisplayName("角色名称")] [StringLength(100)] public string RoleName { get; set; } [DisplayName("备注")] [StringLength(500)] public string Description { get; set; } public bool IsSystemRole { get; set; } public Nullable SystemRoleType { get; set; } public string SystemRoleTypeDesc { get; set; } [Required] [DisplayName("数据范围")] public Nullable DefaultDataRange { get; set; } public string DefaultDataRangeDesc { get; set; } [Required] [DisplayName("学生类别")] public Nullable StudentType { get; set; } public string StudentTypeDesc { get; set; } public Nullable RecordStatus { get; set; } public string RecordStatusDesc { get; set; } public Nullable CreateUserID { get; set; } public string CreateUserName { get; set; } public Nullable CreateTime { get; set; } public Nullable ModifyUserID { get; set; } public string ModifyUserName { get; set; } public Nullable ModifyTime { get; set; } public Sys_Role ParseToEntity() { Sys_Role role = new Sys_Role() { RoleID = this.RoleID, TypeID = this.TypeID, RoleName = this.RoleName, Description = this.Description, IsSystemRole = this.IsSystemRole, SystemRoleType = this.SystemRoleType, DefaultDataRange = this.DefaultDataRange, RecordStatus = this.RecordStatus, CreateUserID = this.CreateUserID, CreateTime = this.CreateTime, ModifyUserID = this.ModifyUserID, ModifyTime = this.ModifyTime, CF_StudentRole = new CF_StudentRole() { RoleID = this.RoleID, StudentType = this.StudentType, RecordStatus = this.RecordStatus, CreateUserID = this.CreateUserID, CreateTime = this.CreateTime, ModifyUserID = this.ModifyUserID, ModifyTime = this.ModifyTime } }; return role; } } }