RetakePlanStudentApplyView.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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.ViewModel.CacheManage;
  8. namespace EMIS.ViewModel.RetakeManage
  9. {
  10. public class RetakePlanStudentApplyView : RetakePlanTaskView
  11. {
  12. /// <summary>
  13. /// 开课学年
  14. /// </summary>
  15. [DisplayName("开课学年")]
  16. public int? SchoolyearNumID { get; set; }
  17. /// <summary>
  18. /// 开课学年
  19. /// </summary>
  20. [DisplayName("开课学年")]
  21. public string SchoolyearNumName
  22. {
  23. get
  24. {
  25. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_SchoolyearNum.ToString())
  26. .Where(x => x.Value == SchoolyearNumID)
  27. .Select(x => x.Name).FirstOrDefault();
  28. }
  29. }
  30. /// <summary>
  31. /// 开课学期
  32. /// </summary>
  33. [DisplayName("开课学期")]
  34. public int? StarttermID { get; set; }
  35. /// <summary>
  36. /// 开课学期
  37. /// </summary>
  38. [DisplayName("开课学期")]
  39. public string StarttermName
  40. {
  41. get
  42. {
  43. return IdNameExt.GetDictionaryItem(DictionaryItem.CF_Startterm.ToString())
  44. .Where(x => x.Value == StarttermID)
  45. .Select(x => x.Name).FirstOrDefault();
  46. }
  47. }
  48. /// <summary>
  49. /// 重修控制信息ID
  50. /// </summary>
  51. [DisplayName("重修控制信息ID")]
  52. public Guid? RetakeOpenControlID { get; set; }
  53. /// <summary>
  54. /// 开始时间
  55. /// </summary>
  56. [DisplayName("开始时间")]
  57. public DateTime? StartDate { get; set; }
  58. /// <summary>
  59. /// 结束时间
  60. /// </summary>
  61. [DisplayName("结束时间")]
  62. public DateTime? EndDate { get; set; }
  63. /// <summary>
  64. /// 报名状态
  65. /// </summary>
  66. [DisplayName("报名状态")]
  67. public bool? ApplyStatus { get; set; }
  68. /// <summary>
  69. /// 报名状态
  70. /// </summary>
  71. [DisplayName("报名状态")]
  72. public string ApplyStatusName
  73. {
  74. get
  75. {
  76. return ApplyStatus == true ? "是" : "否";
  77. }
  78. }
  79. /// <summary>
  80. /// 操作状态
  81. /// </summary>
  82. [DisplayName("操作状态")]
  83. public bool? CanSelect { get; set; }
  84. /// <summary>
  85. /// 操作状态
  86. /// </summary>
  87. public string OperateText
  88. {
  89. get
  90. {
  91. if (RetakeOpenControlID == null || RetakeOpenControlID == Guid.Empty)
  92. {
  93. return "未开放";
  94. }
  95. else if (RetakeOpenControlID.HasValue && StartDate > DateTime.Now)
  96. {
  97. return "即将开始";
  98. }
  99. else if (RetakeOpenControlID.HasValue && EndDate < DateTime.Now)
  100. {
  101. return "已结束";
  102. }
  103. else
  104. {
  105. if (PeopleNumlimit != null && PeopleNumlimit != 0 && ApplyNumber.Value >= PeopleNumlimit.Value
  106. && ApplyStatus.Value == false)
  107. {
  108. return "已报满";
  109. }
  110. else
  111. {
  112. return !(this.ApplyStatus ?? false) ? "立即报名" : "取消报名";
  113. }
  114. }
  115. }
  116. }
  117. }
  118. }