123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.ViewModel.EducationManagement;
- using EMIS.ViewModel.CacheManage;
- using Bowin.Common.Utility;
- using System.ComponentModel;
- namespace EMIS.ViewModel.EducationManage
- {
- public class EducationMissionImportClassView : EducationMissionClassView
- {
- public Guid? ClassmajorCollegeID { get; set; }
- /// <summary>
- /// 教师姓名
- /// </summary>
- [DisplayName("教师姓名")]
- public string TeacherNames
- {
- get
- {
- string name = string.Empty;
- if (MissionClassTeacherView != null)
- name = string.Join("\\", MissionClassTeacherView.Select(s => s.Name));
- if (string.IsNullOrEmpty(name))
- {
- return "";
- }
- else
- {
- return name;
- }
- }
- }
- /// <summary>
- /// 开始时间
- /// </summary>
- [DisplayName("开始时间")]
- public string StartDate
- {
- get
- {
- return (StartHour ?? 0).ToString().PadLeft(2, '0')
- + ":"
- + (StartMinutes ?? 0).ToString().PadLeft(2, '0');
- }
- }
- /// <summary>
- /// 开始时间
- /// </summary>
- [DisplayName("开始时间")]
- public int? StartHour { get; set; }
- /// <summary>
- /// 开始时间
- /// </summary>
- [DisplayName("开始时间")]
- public int? StartMinutes { get; set; }
- /// <summary>
- /// 结束时间
- /// </summary>
- [DisplayName("结束时间")]
- public string EndDate
- {
- get
- {
- return (EndHour ?? 0).ToString().PadLeft(2, '0')
- + ":"
- + (EndMinutes ?? 0).ToString().PadLeft(2, '0');
- }
- }
- /// <summary>
- /// 结束时间
- /// </summary>
- [DisplayName("结束时间")]
- public int? EndHour { get; set; }
- /// <summary>
- /// 结束时间
- /// </summary>
- [DisplayName("结束时间")]
- public int? EndMinutes { get; set; }
-
- /// <summary>
- /// 转换学时数
- /// </summary>
- public int? Hours { get; set; }
- public string TheoryCourseStr { get; set; }
- public string PracticehoursStr { get; set; }
- public string TotalhoursStr { get; set; }
-
-
- public string ClassNumStr { get; set; }
- public string scheduleClassroomName { get; set; }
- public int? Totalhour { get; set; }
- public string TeacherNameString { get; set; }
- public int? EducationID { get; set; }
- /// <summary>
- ///培养层次
- /// </summary>
- public string Education { get; set; }
- /// <summary>
- ///培养层次
- /// </summary>
- public string EducationName
- {
- get
- {
- return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Education.ToString())
- .Where(x => x.Value == EducationID)
- .Select(x => x.Name).FirstOrDefault();
- }
- }
- /// <summary>
- ///学习形式
- /// </summary>
- public int? LearningformID { get; set; }
- /// <summary>
- ///学习形式
- /// </summary>
- public string LearningformName
- {
- get
- {
- return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Learningform.ToString())
- .Where(x => x.Value == LearningformID)
- .Select(x => x.Name).FirstOrDefault();
- }
- }
- /// <summary>
- ///学习形式
- /// </summary>
- public string Learningform { get; set; }
- /// <summary>
- ///年级专业
- /// </summary>
- public string StandardName { get; set; }
- /// <summary>
- ///班主任
- /// </summary>
- public string Assistant { get; set; }
- /// <summary>
- ///参考天数
- /// </summary>
- public int? ExamDay{
- get
- {
- if (Hours != null)
- {
- return (TheoryCourse + Practicehours) / Hours;
- }
- else
- {
- return 0;
- }
- }
- }
- public string TeachingTime{get;set;}
- /// <summary>
- /// 执行天数
- /// </summary>
- public string TeachingDay { get; set; }
- /// <summary>
- /// 执行学时
- /// </summary>
- public string TeachingHours { get; set; }
- /// <summary>
- /// 参考天数
- /// </summary>
- public string ReferenceDays { get; set; }
-
- /// <summary>
- /// 考试周次
- /// </summary>
- [DisplayName("考试周次")]
- public string ExamWeek { get; set; }
- /// <summary>
- /// 考试周次
- /// </summary>
- public List<int?> ExaWeek { get; set; }
- /// <summary>
- /// 考试周次
- /// </summary>
- [DisplayName("考试周次")]
- public string ExamWeekShow {
- get {
- string week = null;
- if(ExaWeek!=null){
- foreach(var w in ExaWeek){
- if(w!=null){
- week += w.ToString()+"\\";
- }
- }
- if(week!=null){
- week = week.TrimEnd('\\');
- }
- }
- return week;
- }
- }
- public string ExamTime { get; set; }
- /// <summary>
- /// 考试日期
- /// </summary>
- public DateTime ExamDate { get; set; }
- /// <summary>
- /// 开始时间
- /// </summary>
- public TimeSpan StarTime { get; set; }
- /// <summary>
- /// 结束时间
- /// </summary>
- public TimeSpan EndTime { get; set; }
- public List<string> Time { get; set; }
- /// <summary>
- ///上课时间
- /// </summary>
- public List<DateTime?> TDate { get; set; }
- /// <summary>
- ///课时类别
- /// </summary>
- public string CourseTimeShow
- {
- get
- {
- if (CourseTimeDesc != null)
- {
- return CourseTimeDesc + "(" + StartDate + "-" + EndDate + ")";
- }
- else
- {
- return null;
- }
- }
- }
- /// <summary>
- /// 课室
- /// </summary>
- public string showClassRoom {
- get {
- if (scheduleClassroomName != null && scheduleClassroomName != "")
- {
- return scheduleClassroomName;
- }
- else
- {
- return ClassroomName;
- }
- }
- }
- /// <summary>
- /// 考试时间
- /// </summary>
- [DisplayName("考试时间")]
- public string Examedate_time {
- get {
- string date=ExamDate.ToLongDateString().ToString()+" "+StarTime.ToString(@"hh\:mm")+"-"+EndTime.ToString(@"hh\:mm");
- if (date == "0001年1月1日 00:00-00:00")
- {
- return null;
- }
- else
- {
- return date;
- }
- }
- }
- ///<summary>
- /// 上课时间
- /// </summary>
- public DateTime? Dates { get; set; }
- /// <summary>
- ///上课时间
- /// </summary>
- public string date {
- get {
- if (TDate != null)
- {
- List<DateTime?> t = TDate.OrderBy(x => x.Value.Date).ToList();
- string da = "";
- string dates = "";
- foreach (var d in t)
- {
- da += d.Value.Month + "月" + d.Value.Day + ",";
- }
- string[] m = da.TrimEnd(',').Split(',');
- for (int i = 0; i < m.Count(); i++)
- {
- if (i == 0)
- {
- if (i + 1 < m.Count())
- {
- string[] lastm = m[i].TrimEnd('日').Split('月');
- dates += lastm[0] + "月" + lastm[1];
- string[] nextm = m[i + 1].TrimEnd('日').Split('月');
- if (lastm[0] == nextm[0])
- {
- dates += "、" + nextm[1];
- }
- else
- {
- dates += "," + nextm[0] + "月" + nextm[1] + ",";
- }
- }
- else if(m[i]!=""){
- string[] lastm = m[i].TrimEnd('日').Split('月');
- dates += lastm[0] + "月" + lastm[1];
- }
- }
- else if (i + 1 < m.Count())
- {
- string[] lastm = m[i].TrimEnd('日').Split('月');
- //dates += lastm[0] + "月" + lastm[1];
- string[] nextm = m[i + 1].TrimEnd('日').Split('月');
- if (lastm[0] == nextm[0])
- {
- dates += "、" + nextm[1];
- }
- else
- {
- dates += "," + nextm[0] + "月" + nextm[1];
- }
- }
- }
- dates = dates.TrimEnd(',');
- return dates;
- }
- else {
- return null;
- }
- }
- }
- }
- }
|