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.SelectCourse { /// /// 任选设定 /// public class ExecutableFreeSelectionCouseView { //是否验证冲突 [DisplayName("是否验证冲突")] public bool? IsNeedVerify { get; set; } /// /// 任选设定ID /// [DisplayName("任选设定ID")] public Guid ExecutableFreeSelectionCouseID { get; set; } /// /// 任选课程ID /// [Required] [DisplayName("任选课程ID")] public Guid? FreeSelectionCouseID { get; set; } /// /// 选课编号 /// [DisplayName("选课编号")] public string FreeSelectionCouseNo { get; set; } /// /// 学年学期ID /// [Required] [DisplayName("学年学期ID")] public Guid? SchoolyearID { get; set; } /// /// 学年学期 /// [DisplayName("学年学期")] public string SchoolyearCode { get; set; } /// /// 学年学期 /// [DisplayName("学年学期")] public string SchoolyearName { get; set; } /// /// 选修任务班名称 /// [Required] [DisplayName("选修任务班名称")] public string DefaultClassName { get; set; } /// /// 开课教研室ID /// [Required] [DisplayName("开课教研室ID")] public Guid? DepartmentID { get; set; } /// /// 开课教研室 /// [DisplayName("开课教研室")] public string DepartmentName { 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 = "College")] public string CollegeName { get; set; } /// /// 课程代码 /// [DisplayName("课程代码")] public string CourseCode { get; set; } /// /// 课程名称 /// [DisplayName("课程名称")] public string CourseName { get; set; } /// /// 课程类型 /// [Required] [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(); } } /// /// 课程结构 /// //[Required] [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(); } } /// /// 课程类别 /// //[Required] [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(); } } /// /// 课程性质 /// //[Required] [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(); } } /// /// 学分 /// [Required] [DisplayName("学分")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public decimal Credit { get; set; } /// /// 总学时 /// [Required] [DisplayName("总学时")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? Totalhours { get { //return ((TheoryCourse ?? 0) + (Practicehours ?? 0) + (Trialhours ?? 0)); return ((TheoryCourse ?? 0) + (Practicehours ?? 0)); } } /// /// 理论学时 /// [Required] [DisplayName("理论学时")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? TheoryCourse { get; set; } /// /// 实践学时 /// [Required] [DisplayName("实践学时")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? Practicehours { get; set; } /// /// 实验学时 /// [Required] [DisplayName("实验学时")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? Trialhours { get; set; } /// /// 上课周数 /// [Required] [DisplayName("上课周数")] public int? SchoolweeksNum { get { return (TheoryWeeklyNum ?? 0) + (PracticeWeeklyNum ?? 0) + (TrialWeeklyNum ?? 0); } } /// /// 每周次数 /// [Required] [DisplayName("每周次数")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? WeeklyNum { get; set; } /// /// 理论周次 /// [Required] [DisplayName("理论周次")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? TheoryWeeklyNum { get; set; } /// /// 实践周次 /// [Required] [DisplayName("实践周次")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? PracticeWeeklyNum { get; set; } /// /// 实验周次 /// [Required] [DisplayName("实验周次")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? TrialWeeklyNum { get; set; } /// /// 周学时 /// [Required] [DisplayName("周学时")] [RegularExpression(@"^[0-9]*$", ErrorMessage = "请输入数字")]//^[1-9]\d*|0$ public int? WeeklyHours { get; set; } /// /// 开始周次 /// [DisplayName("开始周次")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? StartWeeklyNum { get; set; } /// /// 结束周次 /// [DisplayName("结束周次")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? EndWeeklyNum { get; set; } /// /// 起止周次 /// [DisplayName("起止周次")] public string StartEndWeeklyNum { get { if (StartWeeklyNum != null && EndWeeklyNum != null) return StartWeeklyNum + "-" + EndWeeklyNum; else return ""; } } /// /// 授课方式 /// [DisplayName("授课方式")] public List TeachingModeID { get; set; } /// /// 授课方式 /// [DisplayName("授课方式")] public string TeachingModeName { 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(); } } /// /// 考试方式 /// [Required] [DisplayName("考试方式")] public int? ExaminationModeID { get; set; } /// /// 考试方式 /// [DisplayName("考试方式")] public string ExaminationModeName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.CF_ExaminationMode.ToString()) .Where(x => x.Value == CourseTypeID) .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? SchoolyearNumID { get; set; } /// /// 开课学年 /// [DisplayName("开课学年")] public string SchoolyearNumName { get; set; } /// /// 学期 /// [DisplayName("学期")] public int? SchoolcodeID { get; set; } /// /// 学期 /// [DisplayName("学期")] public string SchoolcodeName { get; set; } /// /// 开课学期 /// [DisplayName("开课学期")] public int? StarttermID { get; set; } /// /// 开课学期 /// [DisplayName("开课学期")] public string StarttermName { get; set; } /// /// 处理方式 /// [Required] [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 string IsNeedMaterialName { get; set; } /// /// 人数下限 /// [DisplayName("人数下限")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? PeopleNumlower { get; set; } /// /// 人数上限 /// [DisplayName("人数上限")] [RegularExpression(@"^[0-9]+([.]{1}[0-9]+){0,1}$", ErrorMessage = "请输入数字")] public int? PeopleNumlimit { get; set; } /// /// 排课明细 /// [DisplayName("排课明细")] public string Scheduling { get; set; } /// /// 星期 /// [DisplayName("星期")] public int? Weekday { get; set; } /// /// 星期 /// [DisplayName("星期")] public string WeekdayName { get; set; } /// /// 节次 /// [DisplayName("节次")] public Guid? CoursesTimeID { get; set; } /// /// 节次 /// [DisplayName("节次")] public string CoursesTimeName { get; set; } /// /// 教室ID /// [DisplayName("教室ID")] //[Required] public Guid? ClassroomID { get; set; } /// /// 教室 /// [DisplayName("教室")] public string ClassroomName { get; set; } /// /// 任课教师 /// [DisplayName("任课教师")] public HashSet Teachers { 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 List GradeYear { get; set; } /// /// 年级范围 /// [DisplayName("年级范围")] public string GradeYearName { get; set; } /// /// 专业范围 /// [DisplayName("专业范围")] public List SpecialtyID { get; set; } /// /// 专业范围 /// [DisplayName("专业范围")] public string SpecialtyName { get; set; } /// /// 开放状态 /// [DisplayName("开放状态")] public bool IsOpened { get; set; } /// /// 开放状态 /// public string IsOpenedName { get { return IsOpened == true ? "是" : "否"; } } /// /// 是否启用 /// [DisplayName("是否启用")] public bool IsEnable { get; set; } /// /// 是否启用 /// [DisplayName("是否启用")] public string IsEnableName { get { return IsEnable == true ? "是" : "否"; } } /// /// 审批状态 /// [DisplayName("审批状态")] public int? ApprovalStatus { get; set; } /// /// 审批状态 /// [DisplayName("审批状态")] public string ApprovalStatusName { get; set; } /// /// 任选课开课申请状态 /// public bool IsEditable { get { return !(this.ApprovalStatus != (int)EM_FreeSelectionCouseApplyStatus.NotSubmit && this.ApprovalStatus != (int)EM_FreeSelectionCouseApplyStatus.Rollbacked); } } /// /// 状态 /// public Nullable RecordStatus { get; set; } /// /// 选课结果状态 /// [DisplayName("状态ID")] public string RecordStatusCode { get { return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString()) .Where(x => x.Value == RecordStatus) .Select(x => x.Code).FirstOrDefault(); } } /// /// 选课结果状态 /// [DisplayName("状态")] public string RecordStatusName { get { return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString()) .Where(x => x.Value == RecordStatus) .Select(x => x.Name).FirstOrDefault(); } } /// /// 备注 /// [DisplayName("备注")] public string Remarks { get; set; } /// /// 创建人 /// [DisplayName("创建人")] public Guid? CreateUserID { get; set; } /// /// 创建时间 /// [DisplayName("创建时间")] public DateTime? CreateTime { get; set; } [DisplayName("上课时间")] public string WeekdayTimesSegmentName { get; set; } } }