123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using EMIS.ViewModel;
- using EMIS.CommonLogic.RetakeManage.General;
- using EMIS.Utility.FormValidate;
- using EMIS.CommonLogic.RetakeManage;
- using EMIS.Web.Controls;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.Utility;
- namespace EMIS.Web.Controllers.RetakeManage.General
- {
- [Authorization]
- public class RetakePlanStudentApplyController : Controller
- {
- public IRetakePlanStudentApplyServices RetakePlanStudentApplyServices { get; set; }
- public IRetakeOpenControlServices IRetakeOpenControlServices { 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);
- Guid UserID = EMIS.Utility.FormValidate.CustomPrincipal.Current.UserID;
- var schoolyearID = pararms.getExtraGuid("ddlSchoolYear");
- var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
- //报名状态
- var generalPurposeID = pararms.getExtraInt("DictionaryGeneralPurpose") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryGeneralPurpose");
- return base.Json(RetakePlanStudentApplyServices.GetRetakePlanStudentApplyView(configuretView, UserID, schoolyearID,
- coursematerialID, generalPurposeID, pararms.page, pararms.rows));
- }
- /// <summary>
- /// 查询重修报名时间
- /// </summary>
- /// <returns></returns>
- public ActionResult RetakeOpenControl(QueryParamsModel pararms)
- {
- try
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolYear");
- var retakeOpenTime = IRetakeOpenControlServices.GetRetakeApplyDateTime(schoolyearID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = retakeOpenTime
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = ex.Message
- });
- }
- }
- /// <summary>
- /// 学生平台重修报名(注:1、检测重修开放时间,2、检测人数上限,3、检测重修课程重复,4、检测重修收费控制-暂时不考虑,5、检测排课冲突)
- /// </summary>
- /// <param name="RetakePlanStudentID"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Apply(Guid RetakePlanStudentID)
- {
- try
- {
- this.RetakePlanStudentApplyServices.Apply(RetakePlanStudentID, CustomPrincipal.Current.UserID);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "报名成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "报名失败,原因:" + ex.Message + "。"
- });
- }
- }
- /// <summary>
- /// 学生平台重修取消报名(注:1、检测重修开放时间,2、取消报名控制-暂时不考虑)
- /// </summary>
- /// <param name="RetakePlanStudentID"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult CancelApply(Guid RetakePlanStudentID)
- {
- try
- {
- this.RetakePlanStudentApplyServices.CancleApply(RetakePlanStudentID, CustomPrincipal.Current.UserID);
- return Json(new ReturnMessage
- {
- IsSuccess = true,
- Message = "取消报名成功。"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage
- {
- IsSuccess = false,
- Message = "取消报名失败,原因:" + ex.Message + "。"
- });
- }
- }
- /// <summary>
- /// Excel导出(学生平台进入报名页面Excel导出)
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult Excel()
- {
- return null;
- }
- /// <summary>
- /// 重修课程页面(学生平台)
- /// </summary>
- /// <returns></returns>
- public ActionResult StudentRetakeCourseList()
- {
- return View();
- }
- /// <summary>
- /// 重修课程页面列表查询(学生平台)
- /// </summary>
- /// <param name="pararms"></param>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StudentRetakeCourseList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- Guid UserID = CustomPrincipal.Current.UserID;
- var schoolyearID = pararms.getExtraGuid("ddlSchoolYear");
- var coursematerialID = pararms.getExtraGuid("CoursematerialComboGrid");
- //重修任务状态
- var retakePlanStatusID = pararms.getExtraInt("DictionaryRetakePlanStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("DictionaryRetakePlanStatus");
- return base.Json(RetakePlanStudentApplyServices.GetStudentRetakeCourseView(configuretView, UserID, schoolyearID,
- coursematerialID, retakePlanStatusID, pararms.page, pararms.rows));
- }
- /// <summary>
- /// Excel导出(学生平台重修课程页面Excel导出)
- /// </summary>
- /// <returns></returns>
- [HttpPost]
- public ActionResult StudentRetakeCourse_Excel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- Guid UserID = CustomPrincipal.Current.UserID;
- var schoolyearID = Request.Form["ddlSchoolYear"] == DropdownList.SELECT_ALL.ToString() ? null : Request.Form["ddlSchoolYear"].ParseStrTo<Guid>();
- var coursematerialID = Request.Form["CoursematerialComboGrid"].ParseStrTo<Guid>();
- //重修任务状态
- var retakePlanStatusID = Request.Form["DictionaryRetakePlanStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["DictionaryRetakePlanStatus"].ParseStrTo<int>();
- var dt = RetakePlanStudentApplyServices.GetStudentRetakeCourseView(configuretView, UserID, schoolyearID,
- coursematerialID, retakePlanStatusID)
- .Select(x => new
- {
- x.LoginID,
- x.UserName,
- x.SexName,
- x.ClassmajorName,
- x.SchoolyearCode,
- x.ClassName,
- x.RetakeTypeName,
- x.CourseCode,
- x.CourseName,
- x.CourseTypeName,
- x.Credit,
- x.Totalhours,
- x.StartEndWeeklyNum,
- x.WeekdayTimesSegmentName,
- x.ClassroomName,
- x.TeacherName,
- x.DepartmentName,
- x.CourseCollegeName,
- x.RecordStatusName,
- x.ApplyStatusName
- }).ToTable();
- string[] liststring = {
- "学号", "姓名", "性别", "班级名称", "重修学年学期", "重修班级名称",
- "重修类型", "课程代码", "课程名称", "课程类型", "课程学分", "总学时",
- "起止周次", "上课时间", "教室", "任课教师", "开课教研室",
- "开课" + RSL.Get("CollegeName"), "重修任务状态", "报名状态"
- };
- neh.Export(dt, liststring, "重修课程信息" + DateTime.Now.ToString("yyyyMMddhhmmss"));
- return RedirectToAction("MsgShow", "Common", new
- {
- msg = "导出成功。",
- url = Url.Content("~/RetakePlanStudentApply/StudentRetakeCourseList").AddMenuParameter()
- });
- }
- }
- }
|