123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using EMIS.CommonLogic.RetakeManage;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.CommonLogic.RetakeManage.General;
- using EMIS.ViewModel.RetakeManage;
- using EMIS.Utility.FormValidate;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.RetakeManage.General
- {
- [Authorization]
- public class RetakePlanListController : Controller
- {
- public IRetakePlanListServices RetakePlanServices { get; set; }
- public IRetakePlanStudentServices RetakePlanStudentServices { 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 schoolyearID = pararms.getExtraGuid("SchoolYearDropdown").ToString() == DropdownList.SELECT_ALL.ToString() ? null : pararms.getExtraGuid("SchoolYearDropdown");
- 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 educationID = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var learningformID = pararms.getExtraInt("DictionaryLearningform") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryLearningform");
- var learnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var classmajorID = pararms.getExtraGuid("ClassmajorDropdown");
- var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
- //在校状态
- var inSchoolStatus = pararms.getExtraInt("DictionaryInschoolStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryInschoolStatus");
- //重修任务状态
- var retakePlanStatusID = pararms.getExtraInt("DictionaryRetakePlanStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryRetakePlanStatus");
- //报名状态
- var generalPurposeID = pararms.getExtraInt("DictionaryGeneralPurpose") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGeneralPurpose");
- return Json(RetakePlanServices.GetRetakePlanStudentView(configuretView, schoolyearID, collegeID, yearID, standardID,
- educationID, learningformID, learnSystem, classmajorID, coursematerialID, inSchoolStatus, retakePlanStatusID,
- generalPurposeID, (int)pararms.page, (int)pararms.rows));
- }
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="RetakePlanStudentIDs"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Delete(string RetakePlanStudentIDs)
- {
- try
- {
- List<Guid?> list = RetakePlanStudentIDs.Split(',').Where(x => !string.IsNullOrEmpty(x))
- .Select(x => (Guid?)new Guid(x)).ToList();
- RetakePlanServices.DeleteRetakePlanStudent(list);
- 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 schoolyearID = Request.Form["SchoolYearDropdown"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["SchoolyearDropdown"].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 educationID = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var learningformID = Request.Form["DictionaryLearningform"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryLearningform"].ParseStrTo<int>();
- var learnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- var classmajorID = Request.Form["ClassmajorDropdown"].ParseStrTo<Guid>();
- var coursematerialID = Request.Form["CoursematerialComboGrid"].ParseStrTo<Guid>();
- //在校状态
- var inSchoolStatus = Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryInschoolStatus"].ParseStrTo<int>();
- //重修任务状态
- var retakePlanStatusID = Request.Form["DictionaryRetakePlanStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryRetakePlanStatus"].ParseStrTo<int>();
- //报名状态
- var generalPurposeID = Request.Form["DictionaryGeneralPurpose"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryGeneralPurpose"].ParseStrTo<int>();
- var dt = RetakePlanServices.GetRetakePlanStudentViewList(configuretView, schoolyearID, collegeID, yearID, standardID,
- educationID, learningformID, learnSystem, classmajorID, coursematerialID, inSchoolStatus,
- retakePlanStatusID, generalPurposeID)
- .Select(x => new
- {
- x.SchoolyearCode,
- x.ClassName,
- x.RetakeTypeName,
- x.LoginID,
- x.UserName,
- x.SexName,
- x.Gradeyear,
- x.StandardID,
- x.StandardCode,
- x.StandardDesc,
- x.EducationName,
- x.LearningformName,
- x.LearnSystem,
- x.ClassmajorCode,
- x.ClassmajorName,
- x.GrademajorCode,
- x.GrademajorName,
- x.CollegeNo,
- x.CollegeName,
- x.CourseCode,
- x.CourseName,
- x.CourseTypeDesc,
- x.CourseCredit,
- x.SchoolyearNumDesc,
- x.StarttermDesc,
- x.DepartmentCode,
- x.DepartmentName,
- x.InSchoolStatusName,
- x.StudentStatusName,
- x.RecordStatusName,
- x.ApplyStatusName
- }).ToTable();
- string[] liststring = {
- "重修学年学期", "重修班级名称", "重修类型", "学号", "姓名", "性别", "年级", "专业ID(Value)",
- "专业代码", "专业名称", RSL.Get("EducationID"), "学习形式", "学制", "班级编号", "班级名称",
- "年级专业编号", "年级专业名称", RSL.Get("CollegeCode"), RSL.Get("CollegeName"), "课程代码",
- "课程名称", "课程类型", "课程学分", "开课学年", "开课学期", "开课教研室代码", "开课教研室",
- "在校状态", "学籍状态", "重修任务状态", "报名状态"
- };
- neh.Export(dt, liststring, "重修任务名单信息" + DateTime.Now.ToString("yyyyMMddhhmmss"));
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功。",
- url = Url.Content("~/RetakePlanTask/List").AddMenuParameter()
- });
- }
- }
- }
|