123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.CerificateManage;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.Utility;
- using EMIS.CommonLogic.ExaminationApply;
- using EMIS.CommonLogic.Students;
- using EMIS.ViewModel.FeeManage;
- using Senparc.Weixin.TenPay.V3;
- using EMIS.CommonLogic.SystemServices;
- namespace EMIS.Web.ServiceControllers.ExamManage
- {
- public class MyexamServicesController : Controller
- {
- public IExaminationSubjectServices IExaminationSubjectService { get; set; }
- public IWechatPayServices WechatPayServices { get; set; }
- public IExamineApplyServices IExamineApplyService { get; set; }
- /// <summary>
- /// 我的考试列表
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- public ActionResult MyexamListView(Guid userID, int pageIndex, int pageSize)
- {
- ConfiguretView configuretView = new ConfiguretView();
- //var wecharPayList = WechatPayServices.SearchWeChatPayList(userID);
- //List<OrderQueryResult> orderList = new List<OrderQueryResult>();
- //foreach (var wecharPay in wecharPayList)
- //{
- // OrderQueryResult query = WechatHelper.OrderQuery(wecharPay.OrderID);
- // orderList.Add(query);
- //}
- //WechatPayServices.UpdateWeChatPay(orderList);
- return base.Json(IExaminationSubjectService.GetMyexamListView(configuretView,userID, pageIndex, pageSize));
- }
- /// <summary>
- /// 取消报名
- /// </summary>
- /// <param name="ExaminationRegistrationID"></param>
- /// <returns></returns>
- public ActionResult Cancel(Guid ExaminationRegistrationID)
- {
- try
- {
- var examinationRegistration = IExamineApplyService.GetExaminationRegistrationPayViewByRegistrationID(ExaminationRegistrationID);
- if(examinationRegistration.RecordStatus == (int)EX_ExaminationRegistrationStatus.ForPay)
- {
- IExamineApplyService.CheckCanCancelOnline(new List<Guid>() { ExaminationRegistrationID });
- IExamineApplyService.ChangeAndDelete(new List<Guid>(), new List<Guid>() { ExaminationRegistrationID });
- }
- if (examinationRegistration.RecordStatus == (int)EX_ExaminationRegistrationStatus.Paid)
- {
- return Json(new
- {
- isSuccess = true,
- message = ExaminationRegistrationID.ToString(),
- errorCode = 99,
- });
- //WechatHelper.Refund(examinationRegistration.OrderID, examinationRegistration.Fee ?? 0, (examinationRegistration.Fee ?? 0) - (examinationRegistration.RefundTotal ?? 0));
- //IExamineApplyService.ChangeAndDelete(new List<Guid> { ExaminationRegistrationID }, new List<Guid>());
- }
- return Json(new
- {
- isSuccess = true,
- message = "撤销成功。",
- errorCode = 1
- });
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- return Json(new
- {
- isSuccess = true,
- message = "撤销失败,原因:" + mge,
- errorCode = 0
- });
- }
- }
- public ActionResult CancelApply(Guid? ExaminationRegistrationID, RefundView refundView)
- {
- try
- {
- IExamineApplyService.RefundApply(refundView, new List<Guid> { ExaminationRegistrationID.Value });
- return Json(new
- {
- isSuccess = true,
- message = "已提交退费申请,请在24小时内带齐办理资料(收费票据、银行卡复印件)到鉴定考试中心审核是否可以退费。",
- errorCode = 1
- });
- }
- catch (Exception ex)
- {
- return Json(new
- {
- isSuccess = true,
- message = "退费申请提交失败,原因:" + ex.Message,
- errorCode = 0
- });
- }
- }
- }
- }
|