123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- 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.StudentStatistics;
- using EMIS.CommonLogic.StudentManage.StudentStatistics;
- namespace EMIS.Web.Controllers.StudentManage.StudentStatistics
- {
- [Authorization]
- public class InSchoolSettingController : Controller
- {
- public IInSchoolSettingServices InSchoolSettingServices { 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 inSchoolStatusID = pararms.getExtraInt("DictionaryInSchoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInSchoolStatus");
- var isSelected = pararms.getExtraInt("DictionaryIsSelected") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryIsSelected");
- var isDisplayID = pararms.getExtraInt("DictionaryIsDisplay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryIsDisplay");
- return base.Json(InSchoolSettingServices.GetInSchoolSettingViewGrid(configuretView, inSchoolStatusID, isSelected, isDisplayID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 设置(新增、修改、删除)
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Edit()
- {
- try
- {
- var inSchoolSettingViewList = DataGrid.GetTableData<InSchoolSettingView>("dgInSchoolSettingList");
- InSchoolSettingServices.InSchoolSettingEdit(inSchoolSettingViewList);
- 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 inSchoolStatusID = Request.Form["DictionaryInSchoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInSchoolStatus"].ParseStrTo<int>();
- var isSelected = Request.Form["DictionaryIsSelected"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryIsSelected"].ParseStrTo<int>();
- var isDisplayID = Request.Form["DictionaryIsDisplay"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryIsDisplay"].ParseStrTo<int>();
- var dt = InSchoolSettingServices.GetInSchoolSettingViewList(configuretView, inSchoolStatusID, isSelected, isDisplayID)
- .Select(x => new
- {
- x.InSchoolStatusID,
- x.InSchoolStatusName,
- x.IsSelectedName,
- x.IsDisplayName,
- x.CreateUserName,
- x.ModifyUserName,
- x.ModifyTime
- }).ToTable();
- string[] liststring = {
- "类型代码", "在校状态", "是否选中", "是否显示", "创建人", "修改人", "修改时间"
- };
- neh.Export(dt, liststring, "在校设定信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- }
- }
|