1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.ScoreManage;
- using EMIS.Utility;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace EMIS.Web.Controllers.ScoreManage
- {
- [Authorization]
- public class ResitController : Controller
- {
- public IResitServices ResitServices { get; set; }
- public ActionResult List()
- {
- return View();
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView conditionView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var examinationBatchID = pararms.getExtraGuid("ddlExaminationBatch");
- var examinationTypeID = pararms.getExtraGuid("ddlExaminationType");
- var examinationProjectID = pararms.getExtraGuid("ddlExaminationProject");
- var examinationSubjectID = pararms.getExtraInt("ddlExaminationSubject") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlExaminationSubject");
- var schoolAreaID = pararms.getExtraInt("ddlSchoolArea") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlSchoolArea");
- var collegeID = pararms.getExtraGuid("ddlCollege");
- var standardID = pararms.getExtraInt("cgbStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cgbStandard");
- var classmajorID = pararms.getExtraGuid("cgbClassmajor");
- return base.Json(ResitServices.GetResitViewGrid(conditionView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- examinationSubjectID, schoolAreaID, collegeID, null, standardID, classmajorID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// Excel导出
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView conditionView = ConfiguretExtensions.GetConfiguretermsView(null);
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var examinationBatchID = Request.Form["dllExaminationBatch"].ParseStrTo<Guid>();
- var examinationTypeID = Request.Form["dllExaminationType"].ParseStrTo<Guid>();
- var examinationProjectID = Request.Form["dllExaminationProject"].ParseStrTo<Guid>();
- var examinationSubjectID = Request.Form["ddlExaminationSubject"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlExaminationSubject"].ParseStrTo<int>();
- var schoolAreaID = Request.Form["ddlSchoolArea"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlSchoolArea"].ParseStrTo<int>();
- var collegeID = Request.Form["ddlCollege"].ParseStrTo<Guid>();
- var standardID = Request.Form["cgbStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["cgbStandard"].ParseStrTo<int>();
- var classmajorID = Request.Form["ddlClassmajor"].ParseStrTo<Guid>();
- var dt = ResitServices.GetResitViewList(conditionView, schoolyearID, examinationBatchID, examinationTypeID, examinationProjectID,
- examinationSubjectID, schoolAreaID, collegeID, null, standardID, classmajorID).Select(x => new
- {
- x.SchoolyearCode,
- x.ExaminationBatchName,
- x.ExaminationTypeName,
- x.ExaminationProjectName,
- x.ExaminationSubjectName,
- x.SchoolAreaName,
- x.CollegeName,
- x.Year,
- x.StandardName,
- x.ClassmajorName,
- x.UserName,
- x.CertificatesTypeName,
- x.IDNumber,
- x.Score,
- Expire = x.Expire.HasValue ? x.Expire.Value.ToString("yyyy-MM-dd") : ""
- }).ToTable();
- string[] liststring = { "学年学期", "考试批次", "考试类型", "项目名称", "科目", "校区", RSL.Get("College"),
- "年级", "专业", "班级", "姓名", "证件类型", "证件号码", "成绩", "有效期" };
- neh.Export(dt, liststring, "项目补考名单" + DateTime.Now.ToString("yyyyMMdd"));
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "导出成功。"
- });
- }
- }
- }
|