SOCDetailView.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ComponentModel;
  6. using System.ComponentModel.DataAnnotations;
  7. using EMIS.Entities;
  8. namespace EMIS.ViewModel.DQPSystem
  9. {
  10. public class SOCDetailView
  11. {
  12. /// <summary>
  13. /// 主键ID
  14. /// </summary>
  15. [DisplayName("主键ID")]
  16. public Guid SOCDetailID { get; set; }
  17. public Guid? EducationMissionID { get; set; }
  18. public string EducationMissionName { get; set; }
  19. /// <summary>
  20. /// 课程SOCID
  21. /// </summary>
  22. [DisplayName("课程SOCID")]
  23. public Guid? SOCID { get; set; }
  24. /// <summary>
  25. /// 教研室
  26. /// </summary>
  27. [DisplayName("教研室")]
  28. public Guid? DepartmentID { get; set; }
  29. /// <summary>
  30. /// 学年学期ID
  31. /// </summary>
  32. [DisplayName("学年学期ID")]
  33. public Guid? SchoolyearID { get; set; }
  34. /// <summary>
  35. /// 学年学期
  36. /// </summary>
  37. [DisplayName("学年学期")]
  38. public string SchoolyearCode { get; set; }
  39. /// <summary>
  40. /// 课程资料
  41. /// </summary>
  42. [Required]
  43. [DisplayName("课程资料")]
  44. public Guid? CoursematerialID { get; set; }
  45. /// <summary>
  46. /// 课程资料代码
  47. /// </summary>
  48. [DisplayName("课程资料代码")]
  49. public string CourseCode { get; set; }
  50. /// <summary>
  51. /// 课程名称
  52. /// </summary>
  53. [DisplayName("课程名称")]
  54. public string CourseName { get; set; }
  55. /// <summary>
  56. /// 成果名称
  57. /// </summary>
  58. [DisplayName("成果名称")]
  59. public string Name { get; set; }
  60. /// <summary>
  61. /// 成果学分
  62. /// </summary>
  63. [DisplayName("成果学分")]
  64. //[DisplayFormat(DataFormatString = "{0:#.0}")]
  65. public decimal? Credit { get; set; }
  66. /// <summary>
  67. /// 成果权重
  68. /// </summary>
  69. [DisplayName("成果权重")]
  70. //[RegularExpression(@"^([01](\.0+)?|0\.[0-9]+)$", ErrorMessage = "请输入小于1大于0的数字")]
  71. public decimal? Weight { get; set; }
  72. /// <summary>
  73. /// 成果描述
  74. /// </summary>
  75. [DisplayName("成果描述")]
  76. public string Description { get; set; }
  77. /// <summary>
  78. /// 开始上传时间
  79. /// </summary>
  80. [DisplayName("开始上传时间")]
  81. public DateTime? StartTime { get; set; }
  82. public string StartTimeStr {
  83. get {
  84. return StartTime == null ? "" : StartTime.Value.ToShortDateString();
  85. }
  86. }
  87. /// <summary>
  88. /// 截止上传时间
  89. /// </summary>
  90. [DisplayName("截止上传时间")]
  91. public DateTime? EndTime { get; set; }
  92. public string EndTimeStr
  93. {
  94. get
  95. {
  96. return EndTime == null ? "" : EndTime.Value.ToShortDateString();
  97. }
  98. }
  99. /// <summary>
  100. /// 是否分组
  101. /// </summary>
  102. [DisplayName("是否分组")]
  103. public bool? IsGroup { get; set; }
  104. public bool IsGroupin { get; set; }
  105. /// <summary>
  106. /// 是否分组
  107. /// </summary>
  108. [DisplayName("是否分组")]
  109. public string IsGroupStr {
  110. get {
  111. return IsGroup == null ? "" : (IsGroup.Value ? "是" : "否");
  112. }
  113. }
  114. /// <summary>
  115. /// 成果附件说明
  116. /// </summary>
  117. [DisplayName("成果附件说明")]
  118. public string SOCDetailAttachment
  119. {
  120. get {
  121. string AttachmentName = string.Empty;
  122. if (Attachment != null)
  123. AttachmentName = string.Join("、", Attachment.Select(s => s.Name));
  124. if (string.IsNullOrEmpty(AttachmentName))
  125. {
  126. return "";
  127. }
  128. else
  129. {
  130. return AttachmentName;
  131. }
  132. }
  133. }
  134. public int? IsChangeAttachment { get; set; }
  135. /// <summary>
  136. /// 分组数
  137. /// </summary>
  138. [DisplayName("分组数")]
  139. public int? GroupCount { get; set; }
  140. /// <summary>
  141. /// 学生人数
  142. /// </summary>
  143. [DisplayName("学生人数")]
  144. public int? StudentCount { get; set; }
  145. public IEnumerable<SOCDetailAttachmentView> AttachmentList { get; set; }
  146. public IEnumerable<DQP_SOCDetailAttachment> Attachment { get; set; }
  147. public string EducationMissionNameStr
  148. {
  149. get
  150. {
  151. if (string.IsNullOrEmpty(EducationMissionName))
  152. {
  153. return "";
  154. }
  155. else
  156. {
  157. return EducationMissionName.Replace(CourseName, "").Replace("-", "");
  158. }
  159. }
  160. }
  161. }
  162. }