using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using EMIS.Entities; using EMIS.ViewModel.CacheManage; namespace EMIS.ViewModel.MinorManage.MinorClass { public class MinorClassView { /// /// 辅修班级ID /// [DisplayName("辅修班级ID")] public Guid ClassminorID { get; set; } /// /// 辅修专业ID /// [Required] [DisplayName("辅修专业ID")] public Guid? GrademinorID { get; set; } /// /// 班级名称 /// [Required] [DisplayName("辅修班级")] public string Name { get; set; } /// /// 班级简称 /// [DisplayName("班级简称")] public string ClassAbbreviation { get; set; } /// /// 班序 /// [DisplayName("班序")] public int? ClassNum { get; set; } /// /// 学年学期ID /// [DisplayName("学年学期")] public Guid? SchoolyearID { get; set; } /// /// 学年学期 /// [DisplayName("学年学期")] public string SchoolyearCode { get; set; } /// /// 年级 /// [DisplayName("年级")] public int? GradeYearID { get; set; } /// /// 年级 /// [DisplayName("年级")] public string Grade { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Grade.ToString()).Where(x => x.Value == GradeYearID).Select(x => x.Name).FirstOrDefault(); } } /// /// 专业代码(对应字典中的Value) /// public int? StandardID { get; set; } /// /// 专业代码 /// [DisplayName("专业代码")] public string StandardCode { get { var inistStandardCode = IdNameExt.GetDictionaryItem(DictionaryItem.CF_Standard.ToString()) .Where(x => x.Value == StandardID) .Select(x => x.Code).FirstOrDefault(); return (inistStandardCode != null ? inistStandardCode.PadLeft(6, '0') : ""); } } /// /// 专业名称 /// [DisplayName("专业名称")] public string StandardName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Standard.ToString()) .Where(x => x.Value == StandardID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 院系所ID /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public Guid? CollegeID { get; set; } /// /// 院系所编号 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public string CollegeNo { get; set; } /// /// 开设院系 /// [DisplayName("开设院系")] public string CollegeName { get; set; } /// /// 学生人数 /// [DisplayName("人数")] public int? StudentNum { get; set; } /// /// 学生集合 /// [DisplayName("学生集合")] public HashSet CF_ClassminorStudent { get; set; } /// /// 状态 /// [DisplayName("状态")] public int? RecordStatus { get; set; } /// /// 状态 /// [DisplayName("状态")] public string RecordStatusStr { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ClassminorStatus.ToString()) .Where(x => x.Value == RecordStatus) .Select(x => x.Name).FirstOrDefault(); } } } }