using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.ViewModel.CacheManage; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using EMIS.Entities; namespace EMIS.ViewModel.DQPSystem { public class SOCDocView { public SOCDocView() { this.RoleList = new List(); this.CollegeList = new List(); } public System.Guid DocumentID { get; set; } [Required] [DisplayName("文献类型")] public Nullable SOCDocTypeID { get; set; } public string SOCDocTypeDesc { get { return IdNameExt.GetDictionaryItem(DictionaryItem.DQP_SOCDocType.ToString()) .Where(x => x.Value == SOCDocTypeID) .Select(x => x.Name).FirstOrDefault(); } } [Required] [DisplayName("标题")] public string Title { get; set; } [Required] [DisplayName("信息内容")] public string Content { get; set; } private bool roleType; [DisplayName("面向对象")] public bool RoleType { get { return RoleList.Count() == 0; } set { roleType = value; } } public IEnumerable RoleList { get; set; } public string RoleName { get { return string.Join(",", RoleList.Select(x => x.RoleName)); } } private bool collegeType; [DisplayName("面向部门")] public bool CollegeType { get { return CollegeList.Count() == 0; } set { collegeType = value; } } public IEnumerable CollegeList { get; set; } public string CollegeName { get { return string.Join(",", CollegeList.Select(x => x.Name)); } } public IEnumerable DepartmentList { get; set; } public string DepartmentName { get { return string.Join(",", DepartmentList.Select(x => x.Name)); } } public Nullable RecordStatus { get; set; } public string RecordStatusDesc { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_GeneralPurpose.ToString()) .Where(x => x.Value == RecordStatus) .Select(x => x.Name).FirstOrDefault(); } } [DisplayName("是否显示")] public bool IsShow { get; set; } public Nullable CreateCollegeID { get; set; } public string CreateCollegeName { get; set; } public Nullable CreateUserID { get; set; } public string CreateUserName { get; set; } public Nullable CreateTime { get; set; } } }