You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

118 lines
3.7 KiB

  1. using Learun.Application.Base.SystemModule;
  2. using Learun.Application.TwoDevelopment.EducationalAdministration;
  3. using Learun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Web;
  8. using System.Web.Mvc;
  9. using Learun.Application.Organization;
  10. namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
  11. {
  12. public class StuEnrollPhoneController : Controller
  13. {
  14. private StuEnrollIBLL stuEnrollIBLL = new StuEnrollBLL();
  15. public ActionResult Link()
  16. {
  17. return View();
  18. }
  19. public ActionResult Form()
  20. {
  21. return View();
  22. }
  23. public ActionResult Search(int type)
  24. {
  25. if (type == 1)
  26. {
  27. ViewBag.Title = "查询考试地点及时间";
  28. }
  29. if (type == 2)
  30. {
  31. ViewBag.Title = "查询录取结果";
  32. }
  33. return View();
  34. }
  35. public ActionResult SearchResult()
  36. {
  37. return View();
  38. }
  39. /// <summary>
  40. /// 报名
  41. /// </summary>
  42. /// <param name="keyValue">主键</param>
  43. /// <param name="EmpNo">招生老师</param>
  44. /// <param name="strEntity"></param>
  45. /// <returns></returns>
  46. [HttpPost]
  47. [AjaxOnly]
  48. public ActionResult SaveForm(string keyValue, string EmpNo, string strEntity)
  49. {
  50. StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
  51. if (string.IsNullOrEmpty(keyValue))
  52. {
  53. var model = stuEnrollIBLL.GetEntityByPersonalData(entity.IDCard, entity.StuMobile);
  54. if (model != null)
  55. {
  56. return Fail("您已报名,请耐心等待结果!");
  57. }
  58. }
  59. entity.EmpNo = EmpNo;
  60. stuEnrollIBLL.SaveEnroll(keyValue, entity);
  61. return Success("保存成功!");
  62. }
  63. /// <summary>
  64. ///
  65. /// </summary>
  66. /// <param name="type">1 查询考试地点及时间;2 查询录取结果</param>
  67. /// <param name="strEntity"></param>
  68. /// <returns></returns>
  69. [HttpGet]
  70. [AjaxOnly]
  71. public ActionResult SearchForm(int type, StuEnrollEntity entity)
  72. {
  73. var data = stuEnrollIBLL.SearchForm(type, entity);
  74. var jsonData = new object();
  75. if (data != null)
  76. {
  77. jsonData = new
  78. {
  79. StuEnroll = data,
  80. examData = stuEnrollIBLL.GetExamDataByStuId(data.StuId)
  81. };
  82. }
  83. else
  84. {
  85. jsonData = new
  86. {
  87. StuEnroll = data,
  88. examData = new List<ExamSubjectEntity>()
  89. };
  90. }
  91. return Success(jsonData);
  92. }
  93. protected virtual ActionResult Success(string info)
  94. {
  95. return Content(new ResParameter { code = ResponseCode.success, info = info, data = new object { } }.ToJson());
  96. }
  97. protected virtual ActionResult Success(object data)
  98. {
  99. return Content(new ResParameter { code = ResponseCode.success, info = "响应成功", data = data }.ToJson());
  100. }
  101. protected virtual ActionResult Fail(object data)
  102. {
  103. return Content(new ResParameter { code = ResponseCode.fail, info = "响应失败", data = data }.ToJson());
  104. }
  105. protected virtual ActionResult JsonResult(object data)
  106. {
  107. return Content(new ResParameter { code = ResponseCode.success, info = "响应成功", data = data }.ToJson());
  108. }
  109. }
  110. }