123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.MinorGraduation.MinorGraduationManage;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- namespace EMIS.Web.Controllers.MinorGraduation.MinorGraduationManage
- {
- [Authorization]
- public class MinorGraduationListController : Controller
- {
- //
- // GET: /MinorGraduationList/
- public IMinorGraduationApplyServices minorGraduationApplyServices { get; set; }
- public ActionResult List()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var gradSchoolyearID = pararms.getExtraGuid("GradSchoolyearDropdown");
- var collegeID = pararms.getExtraGuid("CollegeDropdown");
- var yearID = pararms.getExtraInt("SchoolyearDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("SchoolyearDictionaryDropDown");
- var standardID = pararms.getExtraInt("StandardDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("StandardDictionaryDropDown");
- //毕业类型
- var graduationTypeID = pararms.getExtraInt("DictionaryGraduationType") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGraduationType");
- //在校状态
- var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- //毕业结论
- var graduationResult = pararms.getExtraInt("DictionaryGraduationResult") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGraduationResult");
- //审核状态名单只显示通过的
- var approvalStatus = minorGraduationApplyServices.GetCorrectEndStatus();
- return base.Json(minorGraduationApplyServices.GetMinorGraduationListGrid(configuretView, gradSchoolyearID, collegeID, yearID,
- standardID, graduationTypeID, inSchoolStatus, graduationResult, approvalStatus, (int)pararms.page, (int)pararms.rows));
- }
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- //var gradSchoolyearID = Request.Form["GradSchoolyearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["GradSchoolyearDropdown"].ParseStrTo<Guid>();
- var gradSchoolyearID = Request.Form["GradSchoolyearDropdown"].ParseStrTo<Guid>();
- var collegeID = Request.Form["CollegeDropdown"].ParseStrTo<Guid>();
- var yearID = Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["SchoolyearDictionaryDropDown"].ParseStrTo<int>();
- var standardID = Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["StandardDictionaryDropDown"].ParseStrTo<int>();
- //毕业类型
- var graduationTypeID = Request.Form["DictionaryGraduationType"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGraduationType"].ParseStrTo<int>();
- //在校状态
- var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
- //毕业结论
- var graduationResult = Request.Form["DictionaryGraduationResult"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGraduationResult"].ParseStrTo<int>();
- //审核状态
- var approvalStatus = minorGraduationApplyServices.GetCorrectEndStatus();
- var minorGraduationApplyIDString = Request.Form["SelectedID"];
- var minorGraduationApplyIDList = minorGraduationApplyIDString.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- var dt = minorGraduationApplyServices.GetMinorGraduationListList(configuretView, gradSchoolyearID, collegeID, yearID,
- standardID, graduationTypeID, inSchoolStatus, graduationResult, approvalStatus, minorGraduationApplyIDList)
- .Select(x => new
- {
- x.GraduatingSemesterCode,
- x.StudentNo,
- x.UserName,
- x.SexName,
- x.GraduationTypeName,
- x.ClassminorName,
- x.CollegeName,
- x.MinorGraduationResultName,
- x.ApprovalResult,
- x.Remark,
- x.ApprovalStatusName
- }).ToTable();
- string[] liststring = {
- "毕业学期", "学号", "姓名", "性别", "毕业类型", "辅修班级", "院系所", "毕业结论", "预审说明", "备注", "审核状态"
- };
- neh.Export(dt, liststring, "辅修毕业名单信息" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- [HttpPost]
- public ActionResult Delete(string minorGraduationApplyIDs)
- {
- try
- {
- List<Guid?> list = minorGraduationApplyIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- minorGraduationApplyServices.MinorGraduationApplyDelete(list);
- return base.Json("删除成功。");
- }
- catch (Exception ex)
- {
- return base.Json("删除失败,原因:" + ex.Message);
- }
- }
- }
- }
|