EducationMissionImportClassView.cs 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.EducationManagement;
  6. using EMIS.ViewModel.CacheManage;
  7. using Bowin.Common.Utility;
  8. using System.ComponentModel;
  9. namespace EMIS.ViewModel.EducationManage
  10. {
  11. public class EducationMissionImportClassView : EducationMissionClassView
  12. {
  13. public Guid? ClassmajorCollegeID { get; set; }
  14. /// <summary>
  15. /// 教师姓名
  16. /// </summary>
  17. [DisplayName("教师姓名")]
  18. public string TeacherNames
  19. {
  20. get
  21. {
  22. string name = string.Empty;
  23. if (MissionClassTeacherView != null)
  24. name = string.Join("\\", MissionClassTeacherView.Select(s => s.Name));
  25. if (string.IsNullOrEmpty(name))
  26. {
  27. return "";
  28. }
  29. else
  30. {
  31. return name;
  32. }
  33. }
  34. }
  35. /// <summary>
  36. /// 开始时间
  37. /// </summary>
  38. [DisplayName("开始时间")]
  39. public string StartDate
  40. {
  41. get
  42. {
  43. return (StartHour ?? 0).ToString().PadLeft(2, '0')
  44. + ":"
  45. + (StartMinutes ?? 0).ToString().PadLeft(2, '0');
  46. }
  47. }
  48. /// <summary>
  49. /// 开始时间
  50. /// </summary>
  51. [DisplayName("开始时间")]
  52. public int? StartHour { get; set; }
  53. /// <summary>
  54. /// 开始时间
  55. /// </summary>
  56. [DisplayName("开始时间")]
  57. public int? StartMinutes { get; set; }
  58. /// <summary>
  59. /// 结束时间
  60. /// </summary>
  61. [DisplayName("结束时间")]
  62. public string EndDate
  63. {
  64. get
  65. {
  66. return (EndHour ?? 0).ToString().PadLeft(2, '0')
  67. + ":"
  68. + (EndMinutes ?? 0).ToString().PadLeft(2, '0');
  69. }
  70. }
  71. /// <summary>
  72. /// 结束时间
  73. /// </summary>
  74. [DisplayName("结束时间")]
  75. public int? EndHour { get; set; }
  76. /// <summary>
  77. /// 结束时间
  78. /// </summary>
  79. [DisplayName("结束时间")]
  80. public int? EndMinutes { get; set; }
  81. /// <summary>
  82. /// 转换学时数
  83. /// </summary>
  84. public int? Hours { get; set; }
  85. public string TheoryCourseStr { get; set; }
  86. public string PracticehoursStr { get; set; }
  87. public string TotalhoursStr { get; set; }
  88. public string ClassNumStr { get; set; }
  89. public string scheduleClassroomName { get; set; }
  90. public int? Totalhour { get; set; }
  91. public string TeacherNameString { get; set; }
  92. public int? EducationID { get; set; }
  93. /// <summary>
  94. ///培养层次
  95. /// </summary>
  96. public string Education { get; set; }
  97. /// <summary>
  98. ///培养层次
  99. /// </summary>
  100. public string EducationName
  101. {
  102. get
  103. {
  104. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Education.ToString())
  105. .Where(x => x.Value == EducationID)
  106. .Select(x => x.Name).FirstOrDefault();
  107. }
  108. }
  109. /// <summary>
  110. ///学习形式
  111. /// </summary>
  112. public int? LearningformID { get; set; }
  113. /// <summary>
  114. ///学习形式
  115. /// </summary>
  116. public string LearningformName
  117. {
  118. get
  119. {
  120. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Learningform.ToString())
  121. .Where(x => x.Value == LearningformID)
  122. .Select(x => x.Name).FirstOrDefault();
  123. }
  124. }
  125. /// <summary>
  126. ///学习形式
  127. /// </summary>
  128. public string Learningform { get; set; }
  129. /// <summary>
  130. ///年级专业
  131. /// </summary>
  132. public string StandardName { get; set; }
  133. /// <summary>
  134. ///班主任
  135. /// </summary>
  136. public string Assistant { get; set; }
  137. /// <summary>
  138. ///参考天数
  139. /// </summary>
  140. public int? ExamDay{
  141. get
  142. {
  143. if (Hours != null)
  144. {
  145. return (TheoryCourse + Practicehours) / Hours;
  146. }
  147. else
  148. {
  149. return 0;
  150. }
  151. }
  152. }
  153. public string TeachingTime{get;set;}
  154. /// <summary>
  155. /// 执行天数
  156. /// </summary>
  157. public string TeachingDay { get; set; }
  158. /// <summary>
  159. /// 执行学时
  160. /// </summary>
  161. public string TeachingHours { get; set; }
  162. /// <summary>
  163. /// 参考天数
  164. /// </summary>
  165. public string ReferenceDays { get; set; }
  166. /// <summary>
  167. /// 考试周次
  168. /// </summary>
  169. [DisplayName("考试周次")]
  170. public string ExamWeek { get; set; }
  171. /// <summary>
  172. /// 考试周次
  173. /// </summary>
  174. public List<int?> ExaWeek { get; set; }
  175. /// <summary>
  176. /// 考试周次
  177. /// </summary>
  178. [DisplayName("考试周次")]
  179. public string ExamWeekShow {
  180. get {
  181. string week = null;
  182. if(ExaWeek!=null){
  183. foreach(var w in ExaWeek){
  184. if(w!=null){
  185. week += w.ToString()+"\\";
  186. }
  187. }
  188. if(week!=null){
  189. week = week.TrimEnd('\\');
  190. }
  191. }
  192. return week;
  193. }
  194. }
  195. public string ExamTime { get; set; }
  196. /// <summary>
  197. /// 考试日期
  198. /// </summary>
  199. public DateTime ExamDate { get; set; }
  200. /// <summary>
  201. /// 开始时间
  202. /// </summary>
  203. public TimeSpan StarTime { get; set; }
  204. /// <summary>
  205. /// 结束时间
  206. /// </summary>
  207. public TimeSpan EndTime { get; set; }
  208. public List<string> Time { get; set; }
  209. /// <summary>
  210. ///上课时间
  211. /// </summary>
  212. public List<DateTime?> TDate { get; set; }
  213. /// <summary>
  214. ///课时类别
  215. /// </summary>
  216. public string CourseTimeShow
  217. {
  218. get
  219. {
  220. if (CourseTimeDesc != null)
  221. {
  222. return CourseTimeDesc + "(" + StartDate + "-" + EndDate + ")";
  223. }
  224. else
  225. {
  226. return null;
  227. }
  228. }
  229. }
  230. /// <summary>
  231. /// 课室
  232. /// </summary>
  233. public string showClassRoom {
  234. get {
  235. if (scheduleClassroomName != null && scheduleClassroomName != "")
  236. {
  237. return scheduleClassroomName;
  238. }
  239. else
  240. {
  241. return ClassroomName;
  242. }
  243. }
  244. }
  245. /// <summary>
  246. /// 考试时间
  247. /// </summary>
  248. [DisplayName("考试时间")]
  249. public string Examedate_time {
  250. get {
  251. string date=ExamDate.ToLongDateString().ToString()+" "+StarTime.ToString(@"hh\:mm")+"-"+EndTime.ToString(@"hh\:mm");
  252. if (date == "0001年1月1日 00:00-00:00")
  253. {
  254. return null;
  255. }
  256. else
  257. {
  258. return date;
  259. }
  260. }
  261. }
  262. ///<summary>
  263. /// 上课时间
  264. /// </summary>
  265. public DateTime? Dates { get; set; }
  266. /// <summary>
  267. ///上课时间
  268. /// </summary>
  269. public string date {
  270. get {
  271. if (TDate != null)
  272. {
  273. List<DateTime?> t = TDate.OrderBy(x => x.Value.Date).ToList();
  274. string da = "";
  275. string dates = "";
  276. foreach (var d in t)
  277. {
  278. da += d.Value.Month + "月" + d.Value.Day + ",";
  279. }
  280. string[] m = da.TrimEnd(',').Split(',');
  281. for (int i = 0; i < m.Count(); i++)
  282. {
  283. if (i == 0)
  284. {
  285. if (i + 1 < m.Count())
  286. {
  287. string[] lastm = m[i].TrimEnd('日').Split('月');
  288. dates += lastm[0] + "月" + lastm[1];
  289. string[] nextm = m[i + 1].TrimEnd('日').Split('月');
  290. if (lastm[0] == nextm[0])
  291. {
  292. dates += "、" + nextm[1];
  293. }
  294. else
  295. {
  296. dates += "," + nextm[0] + "月" + nextm[1] + ",";
  297. }
  298. }
  299. else if(m[i]!=""){
  300. string[] lastm = m[i].TrimEnd('日').Split('月');
  301. dates += lastm[0] + "月" + lastm[1];
  302. }
  303. }
  304. else if (i + 1 < m.Count())
  305. {
  306. string[] lastm = m[i].TrimEnd('日').Split('月');
  307. //dates += lastm[0] + "月" + lastm[1];
  308. string[] nextm = m[i + 1].TrimEnd('日').Split('月');
  309. if (lastm[0] == nextm[0])
  310. {
  311. dates += "、" + nextm[1];
  312. }
  313. else
  314. {
  315. dates += "," + nextm[0] + "月" + nextm[1];
  316. }
  317. }
  318. }
  319. dates = dates.TrimEnd(',');
  320. return dates;
  321. }
  322. else {
  323. return null;
  324. }
  325. }
  326. }
  327. }
  328. }