|
- using System;
- using Learun.Util;
- using System.Data;
- using Learun.Application.TwoDevelopment.EducationalAdministration;
- using System.Web.Mvc;
- using System.Collections.Generic;
- using System.Linq;
-
- namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
- {
- /// <summary>
- /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
- /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
- /// 创 建:超级管理员
- /// 日 期:2021-12-16 10:14
- /// 描 述:长阳迎新
- /// </summary>
- public class StuVolunteerController : MvcControllerBase
- {
- private StuVolunteerIBLL stuVolunteerIBLL = new StuVolunteerBLL();
-
- #region 视图功能
-
- /// <summary>
- /// 主页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Index()
- {
- return View();
- }
- /// <summary>
- /// 表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult Form()
- {
- return View();
- }
-
- /// <summary>
- /// 标注页面
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexLabel()
- {
- return View();
- }
-
- /// <summary>
- /// 志愿表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult FormSchool()
- {
- return View();
- }
-
- /// <summary>
- /// 志愿表单页
- /// <summary>
- /// <returns></returns>
- [HttpGet]
- public ActionResult IndexAccount()
- {
- return View();
- }
-
- #endregion
-
- #region 获取数据
-
- /// <summary>
- /// 获取页面显示列表数据
- /// </summary>
- /// <param name="pagination">分页参数</param>
- /// <param name="queryJson">查询参数</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetPageList(string pagination, string queryJson)
- {
- Pagination paginationobj = pagination.ToObject<Pagination>();
- var data = stuVolunteerIBLL.GetPageList(paginationobj, queryJson);
- var jsonData = new
- {
- rows = data,
- total = paginationobj.total,
- page = paginationobj.page,
- records = paginationobj.records
- };
- return Success(jsonData);
- }
- /// <summary>
- /// 获取表单数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpGet]
- [AjaxOnly]
- public ActionResult GetFormData(string keyValue)
- {
- var StuVolunteerData = stuVolunteerIBLL.GetStuVolunteerEntity(keyValue);
- var jsonData = new
- {
- StuVolunteer = StuVolunteerData,
- };
- return Success(jsonData);
- }
- #endregion
-
- #region 提交数据
-
- /// <summary>
- /// 删除实体数据
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <returns></returns>
- [HttpPost]
- [AjaxOnly]
- public ActionResult DeleteForm(string keyValue)
- {
- stuVolunteerIBLL.DeleteEntity(keyValue);
- return Success("删除成功!");
- }
- /// <summary>
- /// 保存实体数据(新增、修改)
- /// </summary>
- /// <param name="keyValue">主键</param>
- /// <param name="strEntity">实体</param>
- /// <returns></returns>
- [HttpPost]
- [ValidateAntiForgeryToken]
- [AjaxOnly]
- public ActionResult SaveForm(string keyValue, string strEntity)
- {
- StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
- var userInfo = LoginUserInfo.Get();
- if (string.IsNullOrEmpty(keyValue))
- {
- entity.CreateUser = userInfo.realName;
- entity.CreateTime = DateTime.Now;
- }
- entity.UpdateUser = userInfo.realName;
- entity.UpdateTime = DateTime.Now;
- var dWList =
- stuVolunteerIBLL.GetRepetitions(entity.H_SchoolNo, entity.ApplyNo, entity.CardNo).Where(x => x.ID != keyValue);
- if (dWList.Count() > 0)
- {
- return Fail("保存失败,请检查数据有重复项");
- }
- stuVolunteerIBLL.SaveEntity(keyValue, entity);
- return Success("保存成功!");
- }
- #endregion
-
-
- #region 扩展数据
-
- /// <summary>
- /// 标注数据
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult LabelForm(string keyValue)
- {
- stuVolunteerIBLL.LabelEntity(keyValue);
- return Success("标注成功!");
- }
-
- /// <summary>
- /// 取消数据
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult CancelLabel(string keyValue)
- {
- stuVolunteerIBLL.CancelLabel(keyValue);
- return Success("取消成功!");
- }
-
- /// <summary>
- /// 填报志愿
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult IsOurSchool(string keyValue, string strEntity)
- {
- StuVolunteerEntity entity = strEntity.ToObject<StuVolunteerEntity>();
- stuVolunteerIBLL.IsOurSchool(keyValue,entity);
- return Success("填报成功!");
- }
-
-
- /// <summary>
- /// 录取学生
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult EnrollForm(string keyValue)
- {
- stuVolunteerIBLL.EnrollEntity(keyValue);
- return Success("录取成功!");
- }
-
- /// <summary>
- /// 取消录取学生
- /// </summary>
- /// <param name="keyValue"></param>
- /// <returns></returns>
- public ActionResult CancelForm(string keyValue)
- {
- stuVolunteerIBLL.CancelEntity(keyValue);
- return Success("取消成功!");
- }
-
- #endregion
- }
- }
|