using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using EMIS.ViewModel.CacheManage;
using System.ComponentModel.DataAnnotations;
namespace EMIS.ViewModel.SelectCourse.SelectCourseResult
{
public class StudentSelectCourseView
{
public Guid ID { get; set; }
public Guid? SchoolyearID { get; set; }
public string SchoolYearCode { get; set; }
[DisplayName("选修任务班名称")]
public string DefaultClassName { get; set; }
[DisplayName("教师")]
public Guid? TeacherUserID { get; set; }
[DisplayName("教师工号")]
public string TeacherUserCode { get; set; }
[DisplayName("教师名称")]
public string TeacherName { get; set; }
[DisplayName("校区")]
public Guid? CampusID { get; set; }
///
/// 校区
///
[DisplayName("校区")]
public string CampusName { get; set; }
///
///
///
/// 教研室
///
[DisplayName("教研室")]
public Guid? DepartmentID { get; set; }
///
/// 教研室
///
[DisplayName("教研室")]
public string DepartmentName { get; set; }
///
/// 每周次数
///
[DisplayName("每周次数")]
public int? WeeklyNum { get; set; }
///
/// 开始周次
///
[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()) : "";
}
}
///
/// 开始时间
///
public DateTime? StartTime { get; set; }
public string StartTimeStr
{
get
{
return StartTime.HasValue ? StartTime.Value.ToShortDateString() : null;
}
}
///
/// 结束时间
///
public DateTime? EndTime { get; set; }
public string EndTimeStr
{
get
{
return EndTime.HasValue ? EndTime.Value.ToShortDateString() : null;
}
}
///
/// 是否需要教材
///
[DisplayName("是否需要教材")]
public bool IsNeedMaterial { get; set; }
///
/// 是否需要教材
///
[DisplayName("是否需要教材")]
public string IsNeedMaterialName
{
get { return this.IsNeedMaterial != true ? "否" : "是"; }
}
///
/// 选择课程ID
///
[DisplayName("选择课程ID")]
public Guid SelectCourseID { get; set; }
[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 CollegeName { get; set; }
//[DisplayName("选修类型")]
//public int SelectCourseType { get; set; }
//[DisplayName("选修类型")]
//public string SelectCourseTypeName { get { return SelectCourseType == 0 ? "专业选修" : "任选选修"; } }
public Guid? CoursematerialID { get; set; }
///
/// 课程代码
///
[DisplayName("课程代码")]
public string CourseCode { get; set; }
///
/// 课程名称
///
[DisplayName("课程名称")]
public string CourseName { get; set; }
[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? 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? TeachingModeID { get; set; }
///
/// 授课方式
///
[DisplayName("授课方式")]
public string TeachingModeName
{
//get;
//set;
get
{
return IdNameExt.GetDictionaryItem(DictionaryItem.CF_TeachingMode.ToString())
.Where(x => x.Value == TeachingModeID)
.Select(x => x.Name).FirstOrDefault();
}
}
///
/// 学分
///
[DisplayName("学分")]
public decimal? Credit { get; set; }
///
/// 理论学时
///
[DisplayName("理论学时")]
public int? TheoryCourse { get; set; }
///
/// 实践学时
///
[DisplayName("实践学时")]
public int? Practicehours { get; set; }
///
/// 实验学时
///
[DisplayName("实验学时")]
public int? Trialhours { get; set; }
///
/// 总学时
///
[DisplayName("总学时")]
public int? Totalhours
{
get
{
if (TheoryCourse == null)
TheoryCourse = 0;
if (Practicehours == null)
Practicehours = 0;
return (TheoryCourse + Practicehours);
//return this.TheoryCourse ?? 0 + this.Practicehours ?? 0 + this.Trialhours ?? 0; }
}
}
///
/// 人数下限
///
[Required]
[DisplayName("人数下限")]
public Nullable PeopleNumlower { get; set; }
///
/// 人数上限
///
[Required]
[DisplayName("人数上限")]
public Nullable PeopleNumlimit { get; set; }
[DisplayName("已选人数")]
public int? StudentTotalNum { 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();
}
}
///
/// 课程班级
///
[DisplayName("课程班级")]
public string ClassName { get; set; }
///
/// 选修类型ID
///
[DisplayName("选修类型ID")]
public int SelectCourseTypeID { get; set; }
///
/// 选修类型ID,0限选,1任选
///
[DisplayName("选修类型ID")]
public int SelectCourseTypeOrderID { get; set; }
///
/// 选修类型
///
[DisplayName("选修类型")]
public string SelectCourseTypeName { get; set; }
///
/// 已选人数
///
[DisplayName("已选人数")]
public int? StudentCount { get; set; }
///
/// 任课教师ID
///
[DisplayName("任课教师ID")]
public string TeacherIDs { get; set; }
///
/// 任课教师
///
[DisplayName("任课教师")]
public string TeacherNames { get; set; }
///
/// 是否选择
///
[DisplayName("是否选择")]
public bool? IsSelected { get; set; }
[DisplayName("指定节次")]
public Guid? CoursesTimeID { get; set; }
[DisplayName("指定节次")]
public string CoursesTimeName { get; set; }
[DisplayName("教室")]
public Guid? ClassroomID { get; set; }
[DisplayName("教室")]
public string ClassroomName { get; set; }
public string OperateText {
get
{
return !(this.IsSelected ?? false) ? "选课" : "取消选课";
}
}
[Required]
[DisplayName("开放状态")]
public bool IsOpened { get; set; }
public string IsOpenedDesc
{
get { return this.IsOpened == true ? "是" : "否"; }
}
public int? RecordStatus { get; set; }
[DisplayName("状态")]
public string RecordStatusName
{
get
{
return IdNameExt.GetDictionaryItem(DictionaryItem.EM_SelectCourseResultStatus.ToString())
.Where(x => x.Value == RecordStatus)
.Select(x => x.Name).FirstOrDefault();
}
}
///
/// 时间节段
///
[Required]
[DisplayName("时间节段")]
public int? TimesSegment { get; set; }
///
/// 时间节段
///
[DisplayName("时间节段")]
public string TimesSegmentName { get; set; }
///
/// 星期
///
public Nullable Weekday { get; set; }
public string WeekdayName
{
get;set;
}
[DisplayName("上课时间")]
public string WeekdayTimesSegmentName { get; set; }
}
}