using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.CommonLogic.Students; using EMIS.ViewModel; using EMIS.Web.Controls; using Bowin.Web.Controls.Mvc; using Bowin.Common.Data; using Bowin.Common.Utility; namespace EMIS.Web.Controllers.StudentManage.StudentChange { [Authorization] public class StudentReentryController : Controller { public IReentryServices ReentryServices { get; set; } /// /// /// /// public ActionResult List() { return View(); } /// /// 列表查询 /// /// /// [HttpPost] public ActionResult List(QueryParamsModel pararms) { ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms); var schoolYearID = pararms.getExtraGuid("ddlSchoolYear"); //学年学期 var campusID = pararms.getExtraGuid("cbgCampus"); //校区 var collegeID = pararms.getExtraGuid("cbgCollege"); //院系所 var education = pararms.getExtraInt("ddlEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlEducation"); //培养层次 var year = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear"); //年级 var standard = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard"); //专业名称 var learningform = pararms.getExtraInt("ddlLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlLearningform"); //学习形式 var differentDynamicStatus = pararms.getExtraInt("ddlStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlStatus"); //审批状态 var result = ReentryServices.GetStudentReentryViewGrid(configuretView, schoolYearID, campusID, collegeID, education, year, standard, learningform, (int)pararms.page, (int)pararms.rows); return Json(result); } [HttpPost] public ActionResult Excel() { NpoiExcelHelper neh = new NpoiExcelHelper(); ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null); var schoolYearID = Request.Form["ddlSchoolYear"].ParseStrTo(); //学年学期 var campusID = Request.Form["cbgCampus"].ParseStrTo(); //校区 var collegeID = Request.Form["cbgCollege"].ParseStrTo(); //院系所 var education = Request.Form["ddlEducation"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["ddlEducation"].ParseStrTo(); //培养层次 var year = Request.Form["ddlYear"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo(); //年级 var standard = Request.Form["cbgStandard"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["cbgStandard"].ParseStrTo(); //专业名称 var learningform = Request.Form["ddlLearningform"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["ddlLearningform"].ParseStrTo(); //学习形式 var differentDynamicStatus = Request.Form["ddlStatus"].ParseStrTo() == DropdownList.SELECT_ALL ? null : Request.Form["ddlStatus"].ParseStrTo(); //审批状态 var result = ReentryServices.GetStudentReentryViewList(configuretView, schoolYearID, campusID, collegeID, education, year, standard, learningform); var dt = result.Select(s => new { s.LoginID, s.UserName, EndDateString = (s.EndDate.HasValue ? s.EndDate.Value.ToString("yyyy-MM-dd") : ""), s.DifferentDynamicTypeDesc, s.ClassmajorName, s.StudentStatusDesc, s.AfterClassmajorName, s.AfterStudentStatusDesc, s.ReasonDesc, IsReturnedDesc = s.IsReentriedDesc, s.CollegeName, s.CampusName }).ToTable(); string[] liststring = { "学号", "姓名", "结束日期", "异动类型", "异动前班级", "异动前学籍状态", "异动后班级", "异动后学籍状态", "异动原因", "是否已复学处理", "所属学院", "所属校区" }; neh.Export(dt, liststring, "复学名单"); return RedirectToAction("MsgShow", "Common", new { msg = "导出成功!", url = Url.Action("List").AddMenuParameter() }); } } }