ProjectRecordView.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel;
  7. using EMIS.ViewModel.CacheManage;
  8. using Bowin.Common.Utility;
  9. using EMIS.Entities;
  10. namespace EMIS.ViewModel.SupervisionManage
  11. {
  12. public class ProjectRecordView
  13. {
  14. /// <summary>
  15. /// ProjectRecordID
  16. /// </summary>
  17. public System.Guid ProjectRecordID { get; set; }
  18. /// <summary>
  19. /// 学年学期
  20. /// </summary>
  21. [Required]
  22. [DisplayName("学年学期")]
  23. public Guid? SchoolyearID { get; set; }
  24. /// <summary>
  25. /// 学年学期
  26. /// </summary>
  27. [DisplayName("学年学期")]
  28. public string SchoolyearCode { get; set; }
  29. [Required]
  30. [DisplayName("督导时间")]
  31. public Nullable<System.DateTime> ProjectDate { get; set; }
  32. public string ProjectDateDesc {
  33. get {
  34. return ProjectDate == null ? "" : ProjectDate.Value.ToShortDateString();
  35. }
  36. }
  37. [Required]
  38. [DisplayName("督导地点")]
  39. public string Location { get; set; }
  40. [DisplayName("院系所")]
  41. public Guid? CollegeID { get; set; }
  42. public string CollegeName { get; set; }
  43. [Required]
  44. [DisplayName("督导院系")]
  45. public Nullable<System.Guid> SupervisionCollegeID { get; set; }
  46. public string SupervisionCollegeName { get; set; }
  47. [Required]
  48. [DisplayName("督导类型")]
  49. public Nullable<int> SupervisionTypeID { get; set; }
  50. public string SupervisionTypeDesc
  51. {
  52. get
  53. {
  54. return IdNameExt.GetDictionaryItem(DictionaryItem.SUP_SupervisionType.ToString())
  55. .Where(x => x.Value == SupervisionTypeID)
  56. .Select(x => x.Name).FirstOrDefault();
  57. }
  58. }
  59. [DisplayName("督导对象")]
  60. public Guid? UserID { get; set; }
  61. public string UserName { get;set; }
  62. [DisplayName("课程")]
  63. public Guid? CoursematerialID { get; set; }
  64. public string CoursematerialName { get; set; }
  65. [DisplayName("其他督导对象")]
  66. public string OtherTarget { get; set; }
  67. public string SupervisionTarget
  68. {
  69. get {
  70. if (UserID.HasValue)
  71. {
  72. return UserName;
  73. }
  74. if (OtherTarget != null)
  75. {
  76. return OtherTarget;
  77. }
  78. return "";
  79. }
  80. }
  81. [DisplayName("督导组成员")]
  82. public IEnumerable<CF_Staff> staffList { get; set; }
  83. public IEnumerable<Sys_User> userList { get; set; }
  84. public List<Guid?> UserIDList {
  85. get {
  86. if (userList != null)
  87. {
  88. string ids = string.Join(",", userList.Select(s => s.UserID));
  89. List<Guid?> UserIDList = ids.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
  90. return UserIDList;
  91. }
  92. else
  93. {
  94. return null;
  95. }
  96. }
  97. }
  98. public string staffListDesc {
  99. get {
  100. string name = string.Empty;
  101. if (userList != null)
  102. name = string.Join(",", userList.Select(s => s.Name));
  103. if (string.IsNullOrEmpty(name))
  104. {
  105. return "";
  106. }
  107. else
  108. {
  109. return name;
  110. }
  111. }
  112. }
  113. [Required]
  114. [DisplayName("星期")]
  115. public Nullable<int> Weekday { get; set; }
  116. public string WeekdayDesc
  117. {
  118. get
  119. {
  120. if (Weekday.HasValue)
  121. {
  122. return WeekHelper.WeekDictionary[Weekday.Value];
  123. }
  124. else
  125. {
  126. return "";
  127. }
  128. }
  129. }
  130. [Required]
  131. [DisplayName("节次")]
  132. public Nullable<System.Guid> CoursesTimeID { get; set; }
  133. public Nullable<int> StartTimes { get; set; }
  134. public Nullable<int> EndTimes { get; set; }
  135. public string CoursesTimeDesc
  136. {
  137. get
  138. {
  139. return string.Format("第{0}-{1}节", StartTimes.HasValue ? StartTimes.Value.ToString() : "", EndTimes.HasValue ? EndTimes.Value.ToString() : "");
  140. }
  141. }
  142. public string DateWeekTimeDesc {
  143. get {
  144. return ProjectDateDesc + " " + WeekdayDesc + " " + CoursesTimeDesc;
  145. }
  146. }
  147. [DisplayName("综合评分")]
  148. public decimal? TotalScore { get; set; }
  149. [DisplayName("说明")]
  150. public string Description { get; set; }
  151. [Required]
  152. [DisplayName("督导情况记录")]
  153. public string Content { get; set; }
  154. [Required]
  155. [DisplayName("督导评价建议")]
  156. public string Advise { get; set; }
  157. [Required]
  158. [DisplayName("创建人(督导)")]
  159. public Nullable<System.Guid> CreateUserID { get; set; }
  160. public string CreateUserName { get; set; }
  161. [DisplayName("创建时间(督导)")]
  162. public DateTime? CreateTime { get; set; }
  163. public string CreateTimeDesc
  164. {
  165. get
  166. {
  167. return CreateTime == null ? "" : CreateTime.Value.ToShortDateString();
  168. }
  169. }
  170. public IEnumerable<SUP_ProjectRecordAttachment> ProjectRecordAttachmentList { get; set; }
  171. public string ProjectRecordAttachmentIDString
  172. {
  173. get
  174. {
  175. if (ProjectRecordAttachmentList.Count() > 0)
  176. {
  177. return string.Join(",", ProjectRecordAttachmentList.Select(x => x.ProjectRecordAttachmentID));
  178. }
  179. else
  180. {
  181. return "";
  182. }
  183. }
  184. }
  185. /// <summary>
  186. /// 附件名称
  187. /// </summary>
  188. [DisplayName("附件名称")]
  189. public string AttachmentName
  190. {
  191. get
  192. {
  193. if (ProjectRecordAttachmentList != null)
  194. {
  195. if (ProjectRecordAttachmentList.Count() > 0)
  196. {
  197. return string.Join(",", ProjectRecordAttachmentList.Select(x => x.Name));
  198. }
  199. else
  200. {
  201. return "";
  202. }
  203. }
  204. else
  205. {
  206. return "";
  207. }
  208. }
  209. }
  210. /// <summary>
  211. /// 附件状态
  212. /// </summary>
  213. public int? IsChangeAttachment { get; set; }
  214. }
  215. }