using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using EMIS.ViewModel.CacheManage; using EMIS.Entities; namespace EMIS.ViewModel.EducationManagement { public class EducationMissionClassView { /// /// 教学任务ID /// [DisplayName("教学任务ID")] public Guid? EducationMissionID { get; set; } /// /// 教学任务班ID /// [DisplayName("教学任务班ID")] public Guid? EducationMissionClassID { get; set; } /// /// 序号 /// [DisplayName("序号")] [RegularExpression(@"^[0-9]*[1-9][0-9]*$", ErrorMessage = "请输整数")] public int? OrderNo { get; set; } /// /// 任务班名称 /// [Required] [DisplayName("任务班名称")] public string Name { get; set; } [DisplayName("合班后的任务班名")] public string MissionClassClassmajorName { get { string name = string.Empty; if (ClassmajorViewList != null) name = string.Join("-", ClassmajorViewList.Select(s => s.ClassmajorName)); if (string.IsNullOrEmpty(name)) { return ""; } else { return string.Format(name + "-{0}-({1})", (CourseNameAb == null || CourseNameAb.Trim() == "" ? CourseName : CourseNameAb), TeachingModeName); } } } /// /// 排课班数 /// [DisplayName("排课班数")] public int? SchedulingClassNum { get; set; } [Required] [DisplayName("主要排课班级")] public Guid? MainScheduleClassID { get; set; } /// /// 主要排课班级 /// [DisplayName("主要排课班级")] public string SchedulingClass { get; set; } public Guid? MainScheduleClassGrademajorID { get; set; } public Guid? MainScheduleClassCollegeID { get; set; } [DisplayName("班级名称列表")] public IEnumerable ClassmajorViewList { get; set; } /// /// 学生人数 /// [DisplayName("人数")] public int? ClassNum { get; set; } /// /// 学年学期ID /// [DisplayName("学年学期")] public Guid? SchoolyearID { get; set; } /// /// 学年学期 /// [DisplayName("学年学期")] public string SchoolyearCode { get; set; } /// /// 学年(学年学期对应学年) /// [DisplayName("学年")] public int? YearID { get; set; } /// /// 学年(学年学期对应学年) /// [DisplayName("学年")] public string YearName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Year.ToString()).Where(x => x.Value == YearID).Select(x => x.Name).FirstOrDefault(); } } /// /// 课程信息ID /// [DisplayName("课程信息ID")] public Guid? CoursematerialID { get; set; } /// /// 课程代码 /// [DisplayName("课程代码")] public string CourseCode { get; set; } /// /// 课程名称 /// [DisplayName("课程名称")] public string CourseName { get; set; } /// /// 课程简称 /// [DisplayName("课程简称")] public string CourseNameAb { get; set; } /// /// 校区ID /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "Campus")] public Guid? CampusID { get; set; } /// /// 院系所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; } /// /// 院系所名称 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public string CollegeName { get; set; } /// /// 院系所ID /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public Guid? OpenCollegeID { get; set; } /// /// 院系所编号 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public string OpenCollegeNo { get; set; } /// /// 院系所名称 /// [Display(ResourceType = typeof(EMIS.Resources.DataAnnotations.Label), Name = "College")] public string OpenCollegeName { get; set; } /// /// 教研室ID /// [DisplayName("教研室ID")] public Guid? DepartmentID { get; set; } /// /// 教研室编号 /// [DisplayName("教研室编号")] public string DepartmentCode { get; set; } /// /// 教研室名称 /// [DisplayName("教研室名称")] public string DepartmentName { 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 SpecialtyCode { 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 SpecialtyName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Standard.ToString()) .Where(x => x.Value == StandardID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 学制 /// [DisplayName("学制")] public decimal? LearnSystem { get; set; } /// /// 培养层次 /// [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(); } } /// /// 年级专业ID /// [DisplayName("年级专业ID")] public Guid? GrademajorID { get; set; } /// /// 年级专业编号 /// [DisplayName("年级专业编号")] public string GrademajorCode { get; set; } /// /// 年级专业名称 /// [DisplayName("年级专业名称")] public string GrademajorName { get; set; } /// /// 教室ID /// [DisplayName("教室")] public Guid? ClassroomID { get; set; } /// /// 教室编号 /// [DisplayName("教室编号")] public string ClassroomCode { get; set; } /// /// 教室名称 /// [DisplayName("教室名称")] public string ClassroomName { get; set; } /// /// 教室类型 /// [Required] [DisplayName("教室类型")] public int? ClassroomTypeID { get; set; } /// /// 教室类型 /// [DisplayName("教室类型")] public string ClassroomTypeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ClassroomType.ToString()) .Where(x => x.Value == ClassroomTypeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 课程结构 /// [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? 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? 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? 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(); } } /// /// 考试方式 /// [DisplayName("考试方式")] public int? ExaminationModeID { get; set; } /// /// 考试方式 /// [DisplayName("考试方式")] public string ExaminationModeStr { get; set; } /// /// 考试方式 /// [DisplayName("考试方式")] public string ExaminationModeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString()) .Where(x => x.Value == ExaminationModeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 成绩类型 /// [Required] [DisplayName("成绩类型")] public int? ResultTypeID { get; set; } /// /// 成绩类型 /// [DisplayName("成绩类型")] public string ResultTypeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ResultType.ToString()) .Where(x => x.Value == ResultTypeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 授课语言 /// [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 int? HandleModeID { get; set; } /// /// 处理方式 /// [DisplayName("处理方式")] public string HandleModeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_HandleMode.ToString()) .Where(x => x.Value == HandleModeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 是否需要教材 /// [DisplayName("是否需要教材")] public bool IsNeedMaterial { get; set; } /// /// 授课方式 /// [DisplayName("授课方式")] public int TeachingModeID { get; set; } /// /// 授课方式 /// [DisplayName("授课方式")] public string TeachingModeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TeachingMode.ToString()) .Where(x => x.Value == TeachingModeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 开始周次 /// [DisplayName("开始周次")] public int? StartWeeklyNum { get; set; } /// /// 结束周次 /// [DisplayName("结束周次")] public int? EndWeeklyNum { get; set; } /// /// 开始周次 /// [DisplayName("开始周次")] public int? StartWeeklyNumReserved { get; set; } /// /// 结束周次 /// [DisplayName("结束周次")] public int? EndWeeklyNumReserved { get; set; } /// /// 执行周次 /// [DisplayName("执行周次")] public string StartStopWeeklyNum { get { return (StartWeeklyNumReserved > 0 ? StartWeeklyNumReserved : StartWeeklyNum) + "-" + (EndWeeklyNumReserved > 0 ? EndWeeklyNumReserved : EndWeeklyNum); } } /// /// 理论学时 /// [DisplayName("理论学时")] public int? TheoryCourse { get; set; } /// /// 实践学时 /// [DisplayName("实践学时")] public int? Practicehours { get; set; } /// /// 实验学时 /// [DisplayName("实验学时")] public int? Trialhours { get; set; } /// /// 总学时 /// [DisplayName("总学时")] public int? Totalhours { get { //总学时=理论学时+实践学时 return this.TheoryCourse + this.Practicehours;//+ this.Trialhours; } } /// /// 执行学时 /// [DisplayName("执行学时")] public int? CourseProcessTimes { get; set; } /// /// 已排学时 /// [DisplayName("已排学时")] public int? ScheduledTimes { get; set; } /// /// 学分 /// [DisplayName("学分")] [DisplayFormat(DataFormatString = "{0:N1}")] [RegularExpression(@"^\d+(\.\d{1,1})?$", ErrorMessage = "请输整数或保留1位小数")] public decimal? Credit { get; set; } /// /// 理论周数 /// [DisplayName("理论周数")] public int? TheoryWeeklyNum { get; set; } /// /// 实践周数 /// [DisplayName("实践周数")] public int? PracticeWeeklyNum { get; set; } /// /// 实验周数 /// [DisplayName("实验周数")] public int? TrialWeeklyNum { get; set; } /// /// 总周数 /// [DisplayName("总周数")] public int? SchoolweeksNum { get { return this.TheoryWeeklyNum + this.PracticeWeeklyNum; } } /// /// 周学时 /// [Required] [DisplayName("周学时")] public int? WeeklyHours { get; set; } /// /// 每周次数 /// [Required] [DisplayName("每周次数")] public int? WeeklyNum { get; set; } /// /// 学生集合 /// [DisplayName("学生集合")] public HashSet CF_Student { get; set; } /// ///上课周次 /// public int? WeekNum { get; set; } /// ///星期 /// public int? Weekday { get; set; } /// /// 星期 /// public string WeekdayName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.ES_WeekDay.ToString()) .Where(x => x.Value == Weekday) .Select(x => x.Name).FirstOrDefault(); } } /// ///上课时间 /// public string TimesHoure { get; set; } /// /// 开始节次 /// public int StarTimes { get; set; } /// ///上课节次 /// public string Times { get; set; } public Guid? newCoursesTimeID { get; set; } /// /// 教师ID /// public List UserID { get; set; } /// /// 授课老师 /// [DisplayName("授课老师")] public string TeacherName { get { string name = string.Empty; if (MissionClassTeacherView != null) name = string.Join(",", MissionClassTeacherView.Select(s => s.Name)); if (string.IsNullOrEmpty(name)) { return ""; } else { return name; } } } public IEnumerable Sys_User { get; set; } /// /// 教师集合 /// [DisplayName("教师集合")] public IEnumerable CF_Staff { get; set; } [DisplayName("授课老师集合")] public IEnumerable MissionClassTeacherView { get; set; } /// /// 课时类别 /// [DisplayName("课时类别")] [ScaffoldColumn(false)] [Required] public Guid? CourseTimeID { get; set; } /// /// 课时类别 /// [DisplayName("课时类别")] [ScaffoldColumn(false)] public int? TimeID { get; set; } [ScaffoldColumn(false)] public string CourseTimeDesc { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TimesSegment.ToString()) .Where(x => x.Value == TimeID) .Select(x => x.Name).FirstOrDefault(); } } /// /// 课时类别 /// public string CourseTime { get; set; } /// /// 批量更新课时类别任务班ID /// public string EducationMissionClassStr { get; set; } /// /// 处理状态 /// public int? ApprovalStatus { get; set; } /// /// 处理状态 /// public string ApprovalStatusName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.EM_EducationMissionClassStatus.ToString()) .Where(x => x.Value == ApprovalStatus) .Select(x => x.Name).FirstOrDefault(); } } /// /// 创建时间 /// [DisplayName("创建时间")] public DateTime? CreateTime { get; set; } /// /// 创建人 /// [DisplayName("创建人")] public Guid? CreateUserID { get; set; } /// /// 备注 /// [DisplayName("备注")] public string Remark { get; set; } public bool IsExcelVaildateOK { get; set; } public string ErrorMessage { get; set; } public bool IsCollegeScheduleSubmitted { get; set; } } public class ClassView { [DisplayName("学籍班ID")] public Guid? ClassmajorID { get; set; } [DisplayName("学籍班")] public string ClassmajorName { get; set; } [DisplayName("学年学期")] public Guid? SchoolyearID { get; set; } /// [DisplayName("课程ID")] public Guid? CoursematerialID { get; set; } /// /// 授课方式 /// [DisplayName("授课方式")] public int TeachingModeID { get; set; } } public class MissionClassTeacherView { [DisplayName("用户ID")] public Guid? UserID { get; set; } [DisplayName("用户名称")] public string Name { get; set; } [DisplayName("任务班ID")] public Guid? EducationMissionClassID { get; set; } [DisplayName("排课课表ID")] public Guid? EducationSchedulingID { get; set; } [DisplayName("任课方式")] public int? TeachingMethod { get; set; } /// ///上课周次 /// public int? WeekNum { get; set; } /// ///星期 /// public int? Weekday { get; set; } /// /// 星期 /// public string WeekdayName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.ES_WeekDay.ToString()) .Where(x => x.Value == Weekday) .Select(x => x.Name).FirstOrDefault(); } } public Guid? CoursesTimeID { get; set; } /// ///上课时间 /// public string TimesHoure { get; set; } /// /// 开始节次 /// public int StarTimes { get; set; } /// ///上课节次 /// public string Times { get; set; } } }