|
- using Learun.Application.Base.SystemModule;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using Learun.Util;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Learun.Application.Organization;
-
- namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
- {
- public class StuEnrollPhoneController : Controller
- {
- private StuEnrollIBLL stuEnrollIBLL = new StuEnrollBLL();
-
- public ActionResult Link()
- {
- return View();
- }
- public ActionResult Form()
- {
- return View();
- }
- public ActionResult Search(int type)
- {
- if (type == 1)
- {
-
- ViewBag.Title = "查询考试地点及时间";
- }
- if (type == 2)
- {
-
- ViewBag.Title = "查询录取结果";
- }
- return View();
- }
- public ActionResult SearchResult()
- {
- return View();
- }
-
- /// <summary>
- /// 报名
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="EmpNo">招生老师</param>
- /// <param name="strEntity"></param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, string EmpNo, string strEntity)
- {
- StuEnrollEntity entity = strEntity.ToObject<StuEnrollEntity>();
- if (string.IsNullOrEmpty(keyValue))
- {
- var model = stuEnrollIBLL.GetEntityByPersonalData(entity.IDCard, entity.StuMobile);
- if (model != null)
- {
- return Fail("您已报名,请耐心等待结果!");
- }
- }
- entity.EmpNo = EmpNo;
- stuEnrollIBLL.SaveEnroll(keyValue, entity);
- return Success("保存成功!");
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="type">1 查询考试地点及时间;2 查询录取结果</param>
- /// <param name="strEntity"></param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult SearchForm(int type, StuEnrollEntity entity)
- {
- var data = stuEnrollIBLL.SearchForm(type, entity);
- var jsonData = new object();
- if (data != null)
- {
- jsonData = new
- {
- StuEnroll = data,
- examData = stuEnrollIBLL.GetExamDataByStuId(data.StuId)
- };
- }
- else
- {
- jsonData = new
- {
- StuEnroll = data,
- examData = new List<ExamSubjectEntity>()
- };
- }
-
- return Success(jsonData);
- }
-
- protected virtual ActionResult Success(string info)
- {
- return Content(new ResParameter { code = ResponseCode.success, info = info, data = new object { } }.ToJson());
- }
-
- protected virtual ActionResult Success(object data)
- {
- return Content(new ResParameter { code = ResponseCode.success, info = "响应成功", data = data }.ToJson());
- }
- protected virtual ActionResult Fail(object data)
- {
- return Content(new ResParameter { code = ResponseCode.fail, info = "响应失败", data = data }.ToJson());
- }
- protected virtual ActionResult JsonResult(object data)
- {
- return Content(new ResParameter { code = ResponseCode.success, info = "响应成功", data = data }.ToJson());
- }
- }
- }
|