MyexamServicesController.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.CommonLogic.CerificateManage;
  7. using EMIS.ViewModel;
  8. using EMIS.Web.Controls;
  9. using Bowin.Web.Controls.Mvc;
  10. using EMIS.Utility;
  11. using EMIS.CommonLogic.ExaminationApply;
  12. using EMIS.CommonLogic.Students;
  13. using EMIS.ViewModel.FeeManage;
  14. using Senparc.Weixin.TenPay.V3;
  15. using EMIS.CommonLogic.SystemServices;
  16. namespace EMIS.Web.ServiceControllers.ExamManage
  17. {
  18. public class MyexamServicesController : Controller
  19. {
  20. public IExaminationSubjectServices IExaminationSubjectService { get; set; }
  21. public IWechatPayServices WechatPayServices { get; set; }
  22. public IExamineApplyServices IExamineApplyService { get; set; }
  23. /// <summary>
  24. /// 我的考试列表
  25. /// </summary>
  26. /// <param name="pararms"></param>
  27. /// <returns></returns>
  28. public ActionResult MyexamListView(Guid userID, int pageIndex, int pageSize)
  29. {
  30. ConfiguretView configuretView = new ConfiguretView();
  31. //var wecharPayList = WechatPayServices.SearchWeChatPayList(userID);
  32. //List<OrderQueryResult> orderList = new List<OrderQueryResult>();
  33. //foreach (var wecharPay in wecharPayList)
  34. //{
  35. // OrderQueryResult query = WechatHelper.OrderQuery(wecharPay.OrderID);
  36. // orderList.Add(query);
  37. //}
  38. //WechatPayServices.UpdateWeChatPay(orderList);
  39. return base.Json(IExaminationSubjectService.GetMyexamListView(configuretView,userID, pageIndex, pageSize));
  40. }
  41. /// <summary>
  42. /// 取消报名
  43. /// </summary>
  44. /// <param name="ExaminationRegistrationID"></param>
  45. /// <returns></returns>
  46. public ActionResult Cancel(Guid ExaminationRegistrationID)
  47. {
  48. try
  49. {
  50. var examinationRegistration = IExamineApplyService.GetExaminationRegistrationPayViewByRegistrationID(ExaminationRegistrationID);
  51. if(examinationRegistration.RecordStatus == (int)EX_ExaminationRegistrationStatus.ForPay)
  52. {
  53. IExamineApplyService.CheckCanCancelOnline(new List<Guid>() { ExaminationRegistrationID });
  54. IExamineApplyService.ChangeAndDelete(new List<Guid>(), new List<Guid>() { ExaminationRegistrationID });
  55. }
  56. if (examinationRegistration.RecordStatus == (int)EX_ExaminationRegistrationStatus.Paid)
  57. {
  58. return Json(new
  59. {
  60. isSuccess = true,
  61. message = ExaminationRegistrationID.ToString(),
  62. errorCode = 99,
  63. });
  64. //WechatHelper.Refund(examinationRegistration.OrderID, examinationRegistration.Fee ?? 0, (examinationRegistration.Fee ?? 0) - (examinationRegistration.RefundTotal ?? 0));
  65. //IExamineApplyService.ChangeAndDelete(new List<Guid> { ExaminationRegistrationID }, new List<Guid>());
  66. }
  67. return Json(new
  68. {
  69. isSuccess = true,
  70. message = "撤销成功。",
  71. errorCode = 1
  72. });
  73. }
  74. catch (Exception ex)
  75. {
  76. string mge = ex.Message;
  77. return Json(new
  78. {
  79. isSuccess = true,
  80. message = "撤销失败,原因:" + mge,
  81. errorCode = 0
  82. });
  83. }
  84. }
  85. public ActionResult CancelApply(Guid? ExaminationRegistrationID, RefundView refundView)
  86. {
  87. try
  88. {
  89. IExamineApplyService.RefundApply(refundView, new List<Guid> { ExaminationRegistrationID.Value });
  90. return Json(new
  91. {
  92. isSuccess = true,
  93. message = "已提交退费申请,请在24小时内带齐办理资料(收费票据、银行卡复印件)到鉴定考试中心审核是否可以退费。",
  94. errorCode = 1
  95. });
  96. }
  97. catch (Exception ex)
  98. {
  99. return Json(new
  100. {
  101. isSuccess = true,
  102. message = "退费申请提交失败,原因:" + ex.Message,
  103. errorCode = 0
  104. });
  105. }
  106. }
  107. }
  108. }