using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using EMIS.ViewModel.SelectCourse; using EMIS.ViewModel.CacheManage; using EMIS.Entities; using System.ComponentModel.DataAnnotations; namespace EMIS.ViewModel.ElectiveEnter { public class ElectiveCourseEnterView { public Guid ExecutableOptionalCourseID { get; set; } /// /// OptionalCourseID /// public System.Guid OptionalCourseID { get; set; } /// /// 年级专业 /// [DisplayName("年级专业")] public Nullable GrademajorID { get; set; } /// /// 年级专业代码 /// [DisplayName("年级专业")] public string GrademajorCode { get; set; } /// /// 年级名称 /// [DisplayName("年级名称")] public string GrademajorName { get; set; } [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")] public Nullable CampusID { get; set; } public Nullable CollegeID { get; set; } /// /// 院系所 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public string CollegeName { get; set; } /// /// 校班级专业ID /// [DisplayName("校班级专业ID")] public Guid? ClassmajorID { get; set; } /// /// 选修任务班名称 /// [DisplayName("班级名称")] public string DefaultClassName { get; set; } /// /// 教研室 /// [DisplayName("教研室")] public Guid? DepartmentID { get; set; } /// /// 教研室 /// [DisplayName("教研室")] public string DepartmentName { get; set; } /// /// 专业课程 /// [DisplayName("专业课程")] public Nullable SpecialtyCourseID { get; set; } /// /// 专业信息ID /// [DisplayName("专业信息")] public Nullable SpecialtyID { get; set; } /// /// 标准专业 /// 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 StandardDesc { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Standard.ToString()) .Where(x => x.Value == StandardID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 课程 /// public Guid? CoursematerialID { get; set; } /// /// 课程代码 /// [DisplayName("课程代码")] public string CourseCode { get; set; } /// /// 课程名称 /// [DisplayName("课程名称")] public string CourseName { get; set; } /// /// 实践类型 /// [DisplayName("实践类型")] public int? PracticeTypeID { get; set; } [DisplayName("实践类型名称")] public string PracticeTypeNameStr { get; set; } /// /// 实践类型名称 /// [DisplayName("实践类型名称")] public string PracticeTypeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.EM_PracticeType.ToString()) .Where(x => x.Value == PracticeTypeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 开始周次 /// [DisplayName("开始周次")] public int? StartWeeklyNum { get; set; } /// /// 结束周次 /// [DisplayName("结束周次")] public int? EndWeeklyNum { get; set; } public string StartEndWeeklyNum { get { return (this.StartWeeklyNum.HasValue && this.EndWeeklyNum.HasValue) ? (this.StartWeeklyNum.Value.ToString() + "-" + this.EndWeeklyNum.Value.ToString()) : ""; } } /// /// 考试方式 /// [DisplayName("考试方式")] public int? ExaminationModeID { get; set; } public string ExaminationModeDesc { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString()) .Where(x => x.Value == ExaminationModeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 处理方式 /// [DisplayName("处理方式")] public int? HandleModeID { get; set; } public string HandleModeDesc { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_HandleMode.ToString()) .Where(x => x.Value == HandleModeID) .Select(x => x.Name).FirstOrDefault(); } } public virtual HashSet TeachingMode { get; set; } public virtual HashSet Teachers { get; set; } public virtual IEnumerable Sys_User { get; set; } public string TeacherNames { get { var teacherNames = string.Join(",", Teachers.Select(x => x.Name).ToList()); if (string.IsNullOrEmpty(teacherNames)) { return "请选择教师"; } else { return teacherNames; } } } /// /// 选课编号 /// [DisplayName("选课编号")] public string No { get; set; } /// /// 学年学期 /// [Required] [DisplayName("学年学期")] public Nullable SchoolyearID { get; set; } public string SchoolyearDesc { get; set; } /// /// 是否需要教材 /// [DisplayName("是否需要教材")] public bool IsNeedMaterial { get; set; } public string IsNeedMaterialDesc { get { return this.IsNeedMaterial == true ? "是" : "否"; } } /// /// 教材名称 /// [DisplayName("教材名称")] public string MaterialName{ get; set; } /// /// 人数下限 /// [DisplayName("人数下限")] public Nullable PeopleNumlower { get; set; } /// /// 人数上限 /// [DisplayName("人数上限")] public Nullable PeopleNumlimit { get; set; } /// /// 已选人数 /// [DisplayName("已选人数")] public Nullable EnterPeopleNum { get; set; } /// /// 限选设定任课老师设定ID /// public Guid ExecutableOptionalCourseTeacherID { get; set; } /// /// 限选设定任课老师ID /// [DisplayName("任课老师ID")] public Guid TeacherID { get; set; } [Required] [DisplayName("是否启用")] public bool IsEnable { get; set; } public string IsEnableDesc { get { return this.IsEnable == true ? "是" : "否"; } } /// /// 开放状态 /// [Required] [DisplayName("开放状态")] public bool IsOpened { get; set; } public string IsOpenedDesc { get { return this.IsOpened == true ? "是" : "否"; } } /// /// 开课学年 /// [DisplayName("开课学年")] public int? Schoolyear { get; set; } [DisplayName("年级")] public int? Years { get; set; } /// /// 备注 /// [DisplayName("备注")] public string Remarks { get; set; } /// /// RecordStatus /// public Nullable RecordStatus { get; set; } /// /// CreateTime /// public Nullable CreateTime { get; set; } /// /// CreateUserID /// public Nullable CreateUserID { get; set; } /// /// ModifyUserID /// public Nullable ModifyUserID { get; set; } /// /// ModifyTime /// public Nullable ModifyTime { get; set; } /// /// 课程结构 /// [DisplayName("课程结构")] public int? CourseStructureID { get; set; } /// /// 课程结构 /// [DisplayName("课程结构")] public string CourseStructureName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseStructure.ToString()) .Where(x => x.Value == CourseStructureID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 课程类型 /// [DisplayName("课程类型")] public int? CourseTypeID { get; set; } /// /// 课程类型 /// [DisplayName("课程类型")] public string CourseTypeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseType.ToString()) .Where(x => x.Value == CourseTypeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 课程类别 /// [DisplayName("课程属性")] public int? CourseCategoryID { get; set; } /// /// 课程类别 /// [DisplayName("课程属性")] public string CourseCategoryName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseCategory.ToString()) .Where(x => x.Value == CourseCategoryID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 理论学时 /// [DisplayName("理论学时")] public int? TheoryCourse { get; set; } /// /// 实践学时 /// [DisplayName("实践学时")] public int? Practicehours { get; set; } /// /// 实验学时 /// [DisplayName("实验学时")] public int? Trialhours { get; set; } /// /// 每周次数 /// [DisplayName("每周次数")] public int? WeeklyNum { get; set; } /// /// 每周上课时间 /// [DisplayName("每周上课时间")] public int? Weekday { get; set; } /// /// 周学时 /// [DisplayName("周学时")] public int? WeeklyHours { get; set; } /// /// 开课学年 /// [DisplayName("理论周数")] public int? TheoryWeeklyNum { get; set; } /// /// 实践周数 /// [DisplayName("实践周数")] public int? PracticeWeeklyNum { get; set; } /// /// 实验周数 /// [DisplayName("实验周数")] public int? TrialWeeklyNum { get; set; } /// /// 学分 /// [DisplayName("学分")] public decimal? Credit { get; set; } /// /// 总学时 /// [DisplayName("总学时")] public int? Totalhours { get { return this.TheoryCourse ?? 0 + this.Practicehours ?? 0 + this.Trialhours ?? 0; } } /// /// 上课周次 /// [DisplayName("上课周次")] public int? SchoolweeksNum { get { return this.TheoryWeeklyNum ?? 0 + this.PracticeWeeklyNum ?? 0 + this.TrialWeeklyNum ?? 0; } } [DisplayName("教室ID")] public Guid? ClassroomID { get; set; } [DisplayName("教室")] public string ClassroomName { get; set; } /// /// 授课方式 /// [DisplayName("授课方式")] public List TeachingModeID { get; set; } /// /// 授课语言 /// [DisplayName("授课语言")] public int? TeachinglanguageID { get; set; } /// /// 授课语言 /// [DisplayName("授课语言")] public string TeachinglanguageName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Teachinglanguage.ToString()) .Where(x => x.Value == TeachinglanguageID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 是否学位或主干课 /// [DisplayName("是否学位或主干课")] public bool IsMainCourse { get; set; } /// /// 是否学位或主干课 /// [DisplayName("是否学位或主干课")] public string IsMainCourseName { get { return this.IsMainCourse == true ? "是" : "否"; } } [DisplayName("学年学期")] public string SchoolYearCode { get; set; } [DisplayName("入学学年学期")] public string GSchoolYearCode { get; set; } /// /// 学年数 /// [DisplayName("学年数")] public int? SchoolyearNumID { get; set; } /// /// 学年数 /// [DisplayName("学年数")] public string SchoolyearNumName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_SchoolyearNum.ToString()) .Where(x => x.Value == SchoolyearNumID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 学期 /// [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(); } } /// /// 开课学期 /// [DisplayName("开课学期")] public int? StarttermID { get; set; } /// /// 开课学期 /// [DisplayName("开课学期")] public string StarttermName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Startterm.ToString()) .Where(x => x.Value == StarttermID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 课程性质 /// [DisplayName("课程性质")] public int? CourseQualityID { get; set; } /// /// 课程性质 /// [DisplayName("课程性质")] public string CourseQualityName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_CourseQuality.ToString()) .Where(x => x.Value == CourseQualityID) .Select(x => x.Name).FirstOrDefault(); } } } }