12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.Students;
- using Bowin.Common.Exceptions;
- namespace EMIS.Web.Controllers.StudentSystem.Examine
- {
- [Authorization]
- public class ExamineApplyController : Controller
- {
- public Lazy<IStudentRecordServices> StudentRecordService { get; set; }
- public Lazy<IExamineApplyServices> ExamineApplyService { get; set; }
- //
- // GET: /ExamineApply/
- public ActionResult Apply()
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- var Student = StudentRecordService.Value.GetStudentByStudentNo(user.UserID);
- return View(Student);
- }
- /// <summary>
- /// 列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExaminationSubjectList()
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- return base.Json(ExamineApplyService.Value.GetExaminationSubjectList(user.UserID));
- }
- /// <summary>
- ///
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult GetExaminationRegisterList()
- {
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- return base.Json(ExamineApplyService.Value.GetExaminationRegisterList(user.UserID));
- }
- public ActionResult ApplySubmit(string ExaminationSubjectID)
- {
- try
- {
- Guid subjectID = Guid.Parse(Request.Params["ExaminationSubjectID"]);
- int version = int.Parse(Request.Params["Version"]);
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- ExamineApplyService.Value.ApplySubmit(subjectID, user.UserID);
- return base.Json("报名成功");
- }
- catch (Exception ex)
- {
- GetExceptionDetailMessage(ex);
- string mge = GetExceptionDetailMessage(ex).Message;
- return base.Json("报名失败,原因:" + mge);
- }
- }
- Exception GetExceptionDetailMessage(Exception ex)
- {
- if (ex.InnerException == null)
- {
- return ex;
- }
- else
- return GetExceptionDetailMessage(ex.InnerException);
- }
- public ActionResult ApplyCancel(string ExaminationRegistrationIDs)
- {
- try
- {
- var xaminationRegistrationIDList = ExaminationRegistrationIDs.Split(',').Where(x => x.IndexOf("-") >= 0).Select(x => new Guid(x)).ToList();
- var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
- ExamineApplyService.Value.ApplyCancel(xaminationRegistrationIDList);
- return base.Json("撤销成功");
- }
- catch (Exception ex)
- {
- string mge = ex.Message;
- return base.Json("撤销失败,原因:" + mge);
- }
- }
- }
- }
|