using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using EMIS.ViewModel.CacheManage; namespace EMIS.ViewModel.GraduationManage.GraduationRequirement { public class GrademajorRequirementView { /// /// 专业学分ID /// [DisplayName("专业学分ID")] public Guid GraduationRequirementID { get; set; } /// /// 年级专业ID /// [Required] [DisplayName("年级专业ID")] public Guid? GrademajorID { get; set; } /// /// 年级专业编号 /// [DisplayName("年级专业编号")] public string GrademajorCode { get; set; } /// /// 年级专业名称 /// [DisplayName("年级专业名称")] public string GrademajorName { get; set; } /// /// 院系专业ID /// [DisplayName("院系专业ID")] public Guid? FacultymajorID { get; set; } /// /// 院系专业编号 /// [DisplayName("院系专业编号")] public string FacultymajorNo { get; set; } /// /// 院系专业名称 /// [DisplayName("院系专业名称")] public string FacultymajorName { get; set; } /// /// 院系所ID /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "CollegeID")] public Guid? CollegeID { get; set; } /// /// 院系所代码 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "CollegeCode")] public string CollegeNo { get; set; } /// /// 院系所名称 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public string CollegeName { get; set; } /// /// 年级 /// [DisplayName("年级")] public int? SchoolyearID { get; set; } /// /// 学期 /// [DisplayName("学期")] public int? SchoolcodeID { get; set; } /// /// 学期 /// [DisplayName("学期")] public string SchoolcodeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Semester.ToString()).Where(x => x.Value == SchoolcodeID).Select(x => x.Name).FirstOrDefault(); } } /// /// 入学学年学期ID /// [DisplayName("入学学年学期ID")] public Guid? EnteringSchoolYearID { get; set; } /// /// 入学学年学期 /// [DisplayName("入学学年学期")] public string EnteringSchoolYearCode { get; set; } /// /// 毕业学期ID /// [DisplayName("毕业学期ID")] public Guid? GraduatingSemesterID { get; set; } /// /// 毕业学期 /// [DisplayName("毕业学期")] public string GraduatingSemesterCode { get; set; } /// /// 专业ID(Value) /// [DisplayName("专业ID(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(); } } /// /// 培养层次 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "EducationID")] public int? EducationID { get; set; } /// /// 培养层次 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "EducationName")] public string EducationName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Education.ToString()) .Where(x => x.Value == EducationID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 学习形式 /// [DisplayName("学习形式")] public int? LearningformID { get; set; } /// /// 学习形式 /// [DisplayName("学习形式")] public string LearningformName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Learningform.ToString()) .Where(x => x.Value == LearningformID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 学制 /// [DisplayName("学制")] public decimal? LearnSystem { get; set; } /// /// 选修学分 /// [Required] [DisplayName("选修学分")] [DisplayFormat(DataFormatString = "{0:N1}")] [RegularExpression(@"^\d+(\.\d{1,1})?$", ErrorMessage = "请输整数或保留1位小数")] public decimal? OptionalCourseCredit { get; set; } /// /// 必修学分 /// [Required] [DisplayName("必修学分")] [DisplayFormat(DataFormatString = "{0:N1}")] [RegularExpression(@"^\d+(\.\d{1,1})?$", ErrorMessage = "请输整数或保留1位小数")] public decimal? RequiredCredit { get; set; } /// /// 总学分 /// [Required] [DisplayName("总学分")] [DisplayFormat(DataFormatString = "{0:N1}")] [RegularExpression(@"^\d+(\.\d{1,1})?$", ErrorMessage = "请输整数或保留1位小数")] public decimal? TotalCredit { get; set; } /// /// 特定学分 /// [DisplayName("特定学分")] public decimal? SpecialCredit { get { return (this.TotalCredit == null ? 0 : this.TotalCredit) - (this.RequiredCredit == null ? 0 : this.RequiredCredit) - (this.OptionalCourseCredit == null ? 0 : this.OptionalCourseCredit); } } /// /// 状态 /// [DisplayName("状态")] public int? RecordStatus { get; set; } /// /// 创建人 /// [DisplayName("创建人")] public Guid? CreateUserID { get; set; } /// /// 创建时间 /// [DisplayName("创建时间")] public DateTime? CreateTime { get; set; } /// /// 修改人 /// [DisplayName("修改人")] public Guid? ModifyUserID { get; set; } /// /// 修改时间 /// [DisplayName("修改时间")] public DateTime? ModifyTime { get; set; } } }