123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.Web.Controls;
- using EMIS.ViewModel;
- using EMIS.ViewModel.StudentManage.OnlineChecking;
- using EMIS.CommonLogic.StudentManage.OnlineChecking;
- namespace EMIS.Web.Controllers.StudentManage.OnlineChecking
- {
- [Authorization]
- public class CheckingControlController : Controller
- {
- public Lazy<ICheckingControlServices> CheckingControlServices { get; set; }
- /// <summary>
- /// 学生校对控制页面
- /// </summary>
- /// <returns></returns>
- public ActionResult List()
- {
- return View();
- }
- /// <summary>
- /// 学生校对控制页面列表查询
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var checkingTypeID = pararms.getExtraInt("DictionaryCheckingType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryCheckingType");
- return base.Json(CheckingControlServices.Value.GetStudentEditControlViewGrid(configuretView, checkingTypeID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 学生校对控制设置
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StudentEditControlSet()
- {
- try
- {
- var checkingControlViewList = DataGrid.GetTableData<CheckingControlView>("dgStudentEditControlList");
- CheckingControlServices.Value.StudentEditControlSet(checkingControlViewList.Select(x => x.ColumnName).ToList(), checkingControlViewList.Select(x => x.CheckingTypeID).ToList());
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "设置成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "设置失败,原因:" + ex.Message
- });
- }
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var checkingTypeID = Request.Form["DictionaryCheckingType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryCheckingType"].ParseStrTo<int>();
- var dt = CheckingControlServices.Value.GetStudentEditControlViewList(configuretView, checkingTypeID)
- .Select(x => new
- {
- x.OrderNo,
- x.ColumnName,
- x.DisplayColumnName,
- x.Description,
- x.CheckingTypeName,
- x.CreateUserName,
- x.ModifyUserName,
- x.ModifyTime
- }).ToTable();
- string[] liststring = {
- "序号", "校对代码", "校对列名", "校对名称", "校对类型", "创建人", "修改人", "修改时间"
- };
- neh.Export(dt, liststring, "校对控制信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- }
- }
|