123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.CommonLogic.RetakeManage;
- using EMIS.ViewModel;
- using EMIS.Utility.FormValidate;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel.RetakeManage;
- using EMIS.ViewModel.EducationManage;
- using EMIS.Web.Controls;
- using Bowin.Common.Data;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Utility;
- namespace EMIS.Web.Controllers.RetakeManage
- {
- [Authorization]
- public class RetakePlanController : Controller
- {
- public IRetakePlanServices RetakePlanServices { get; set; }
- public IRetakePlanStudentServices RetakePlanStudentServices { get; set; }
- public ActionResult StudentList()
- {
- return View();
- }
- public ActionResult ApproveList()
- {
- return View();
- }
- public ActionResult List()
- {
- return View();
- }
- public ActionResult SelectMission(Guid coursematerialID)
- {
- return View();
- }
- [HttpPost]
- public ActionResult StudentList(QueryParamsModel pararms)
- {
- var userID = CustomPrincipal.Current.UserID;
- var list = RetakePlanStudentServices.GetRetakeStudentApplyViewStudentList(userID);
- return Json(new GridResultSet<RetakeStudentApplyView> { rows = list, total = list.Count });
- }
- [HttpPost]
- public ActionResult EducationMissionList(QueryParamsModel pararms, Guid coursematerialID)
- {
- var list = RetakePlanStudentServices.GetEducationMissionImportClassViewList(coursematerialID);
- return Json(new GridResultSet<EducationMissionImportClassView> { rows = list, total = list.Count });
- }
- [HttpPost]
- public ActionResult CheckCanSubmit(Guid retakePlanStudentID)
- {
- try
- {
- RetakePlanStudentServices.CheckCanSubmit(retakePlanStudentID);
- return Json(new ReturnMessage { IsSuccess = true, Message = "校验成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "申请失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult Submit(Guid retakePlanStudentID, Guid educationMissionID)
- {
- try
- {
- RetakePlanStudentServices.Submit(retakePlanStudentID, educationMissionID);
- return Json(new ReturnMessage { IsSuccess = true, Message = "提交成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "提交失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult ApproveList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolYear");
- var collegeID = pararms.getExtraGuid("cbgCollege");
- var gradeYearID = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var standardID = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard");
- var classmajorID = pararms.getExtraGuid("cbgClassmajor");
- var learningformID = pararms.getExtraInt("LearningformDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("LearningformDictionaryDropDown");
- var education = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var list = RetakePlanStudentServices.GetRetakeStudentApproveViewList(configuretView, schoolyearID, collegeID, gradeYearID, standardID, classmajorID,
- learningformID, education, LearnSystem,pararms.page.Value, pararms.rows.Value);
- return Json(list);
- }
- [HttpPost]
- public ActionResult ApproveStudent(string retakePlanStudentIDs, Guid actionID, string comment)
- {
- var retakePlanStudentIDList = retakePlanStudentIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- var curUserID = CustomPrincipal.Current.UserID;
- if (retakePlanStudentIDList.Count == 0)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "请选择至少一条记录进行审核。" });
- }
- try
- {
- this.RetakePlanStudentServices.Approve(retakePlanStudentIDList, curUserID, actionID, comment);
- 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 StudentExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var retakePlanStudentIDString = Request.Form["SelectedID"];
- var retakePlanStudentIDList = retakePlanStudentIDString.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- var schoolyearID = Request.Form["ddlSchoolYear"].ParseStrTo<Guid>();
- var collegeID = Request.Form["cbgCollege"].ParseStrTo<Guid>();
- var gradeYearID = Request.Form["ddlYear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>();
- var standardID = Request.Form["cbgStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["cbgStandard"].ParseStrTo<int>();
- var classmajorID = Request.Form["cbgClassmajor"].ParseStrTo<Guid>();
- var dt = RetakePlanStudentServices.GetRetakeStudentApproveViewList(configuretView, retakePlanStudentIDList, schoolyearID, collegeID, gradeYearID, standardID,
- classmajorID).Select(x => new
- {
- x.SchoolyearCode,
- x.LoginID,
- x.UserName,
- x.ClassmajorName,
- x.CourseCode,
- x.CourseName,
- x.ClassName,
- x.TeacherName,
- x.ScheduleDateString,
- x.CourseTimeDesc,
- x.Credit,
- ScheduledTimes = x.TotalHours,
- x.ClassroomName
- }).ToTable();
- string[] liststring = { "学年学期", "学号", "姓名", "班级名称", "课程代码", "课程名称", "重修班级", "任课教师", "上课日期",
- "课时类别", "学分", "总学时", "课室" };
- neh.Export(dt, liststring, "重修审核列表");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Action("AporoveList").AddMenuParameter()
- });
- }
- [HttpPost]
- public ActionResult List(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolYear");
- var collegeID = pararms.getExtraGuid("cbgCollege");
- var gradeYearID = pararms.getExtraInt("ddlYear") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlYear");
- var standardID = pararms.getExtraInt("cbgStandard") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("cbgStandard");
- var classmajorID = pararms.getExtraGuid("cbgClassmajor");
- var learningformID = pararms.getExtraInt("LearningformDictionaryDropDown") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("LearningformDictionaryDropDown");
- var education = pararms.getExtraInt("DictionaryEducation") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryEducation");
- var LearnSystem = pararms.getExtraString("DictionaryLearnSystem");
- var list = RetakePlanStudentServices.GetFinalRetakeStudentApproveViewList(configuretView, schoolyearID, collegeID, gradeYearID, standardID, classmajorID,
- learningformID, education, LearnSystem,pararms.page.Value, pararms.rows.Value);
- return Json(list);
- }
- /// <summary>
- /// 导出Excel
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StudentListExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var retakePlanStudentIDString = Request.Form["SelectedID"];
- var retakePlanStudentIDList = retakePlanStudentIDString.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- var schoolyearID = Request.Form["ddlSchoolYear"].ParseStrTo<Guid>();
- var collegeID = Request.Form["cbgCollege"].ParseStrTo<Guid>();
- var gradeYearID = Request.Form["ddlYear"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlYear"].ParseStrTo<int>();
- var standardID = Request.Form["cbgStandard"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["cbgStandard"].ParseStrTo<int>();
- var classmajorID = Request.Form["cbgClassmajor"].ParseStrTo<Guid>();
- var learningformID = Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["LearningformDictionaryDropDown"].ParseStrTo<int>();
- var education = Request.Form["DictionaryEducation"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryEducation"].ParseStrTo<int>();
- var LearnSystem = Request.Form["DictionaryLearnSystem"].ToString();
- var dt = RetakePlanStudentServices.GetFinalRetakeStudentApproveViewList(configuretView, retakePlanStudentIDList, schoolyearID, collegeID, gradeYearID, standardID,
- classmajorID, learningformID, education, LearnSystem).Select(x => new
- {
- x.SchoolyearCode,
- x.LoginID,
- x.UserName,
- x.ClassmajorName,
- x.CourseCode,
- x.CourseName,
- x.ClassName,
- x.TeacherName,
- x.ScheduleDateString,
- x.CourseTimeDesc,
- x.Credit,
- ScheduledTimes = x.TotalHours,
- x.ClassroomName
- }).ToTable();
- string[] liststring = { "学年学期", "学号", "姓名", "班级名称", "课程代码", "课程名称", "重修班级", "任课教师", "上课日期",
- "课时类别", "学分", "总学时", "课室" };
- neh.Export(dt, liststring, "重修审核列表");
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功!",
- url = Url.Action("AporoveList").AddMenuParameter()
- });
- }
- }
- }
|