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; }
///
/// 我的考试列表
///
///
///
public ActionResult MyexamListView(Guid userID, int pageIndex, int pageSize)
{
ConfiguretView configuretView = new ConfiguretView();
//var wecharPayList = WechatPayServices.SearchWeChatPayList(userID);
//List orderList = new List();
//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));
}
///
/// 取消报名
///
///
///
public ActionResult Cancel(Guid ExaminationRegistrationID)
{
try
{
var examinationRegistration = IExamineApplyService.GetExaminationRegistrationPayViewByRegistrationID(ExaminationRegistrationID);
if(examinationRegistration.RecordStatus == (int)EX_ExaminationRegistrationStatus.ForPay)
{
IExamineApplyService.CheckCanCancelOnline(new List() { ExaminationRegistrationID });
IExamineApplyService.ChangeAndDelete(new List(), new List() { 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 { ExaminationRegistrationID }, new List());
}
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 { ExaminationRegistrationID.Value });
return Json(new
{
isSuccess = true,
message = "已提交退费申请,请在24小时内带齐办理资料(收费票据、银行卡复印件)到鉴定考试中心审核是否可以退费。",
errorCode = 1
});
}
catch (Exception ex)
{
return Json(new
{
isSuccess = true,
message = "退费申请提交失败,原因:" + ex.Message,
errorCode = 0
});
}
}
}
}