1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Bowin.Web.Controls.Mvc;
- using Bowin.Common.Linq.Entity;
- using Bowin.Common.JSON;
- using Bowin.Common.Utility;
- using Bowin.Common.Data;
- using EMIS.CommonLogic.EducationManage;
- using EMIS.ViewModel.EducationManage;
- using EMIS.CommonLogic.EducationSchedule;
- using EMIS.ViewModel;
- using EMIS.ViewModel.EducationSchedule;
- using EMIS.CommonLogic.SystemServices;
- using EMIS.Utility.FormValidate;
- using EMIS.CommonLogic.SchedulingManage.ScheduleApproval;
- using EMIS.Web.Controls;
- using EMIS.CommonLogic.CalendarManage;
- namespace EMIS.Web.Controllers.EducationSchedule
- {
- [Authorization]
- public class EducationScheduleController : Controller
- {
- public IEducationSchedulingClassServices EducationSchedulingClassServices { get; set; }
- public IEducationSchedulingAdjustmentServices EducationSchedulingAdjustmentServices { get; set; }
- public IEducationSchedulingStopServices EducationSchedulingStopServices { get; set; }
- public EMIS.CommonLogic.EducationSchedule.IScheduleServices ScheduleServices { get; set; }
- public ICollegeScheduleApprovalServices CollegeScheduleApprovalServices { get; set; }
- public IParameterServices ParameterServices { get; set; }
- public IUserServices UserServices { get; set; }
- public ISchoolYearServices SchoolYearServices { get; set; }
- public EMIS.CommonLogic.SchedulingManage.SchedulingSettings.ICollegePriorityServices CollegePriorityServices { get; set; }
- protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding, JsonRequestBehavior behavior)
- {
- return new JsonResult()
- {
- Data = data,
- ContentType = contentType,
- ContentEncoding = contentEncoding,
- JsonRequestBehavior = behavior,
- MaxJsonLength = Int32.MaxValue
- };
- }
- public ActionResult List()
- {
- return View();
- }
- public ActionResult DepartmentList()
- {
- return View();
- }
- public ActionResult Edit()
- {
- return View();
- }
- public ActionResult DepartmentEdit()
- {
- return View();
- }
- public ActionResult Setting()
- {
- return View();
- }
- public ActionResult SelectGroup()
- {
- return View();
- }
- [HttpGet]
- public ActionResult Submit()
- {
- return View();
- }
- public ActionResult WeekModify()
- {
- return View();
- }
- public ActionResult ClassroomScheduleView()
- {
- return View();
- }
- public ActionResult ClassroomModify()
- {
- return View();
- }
- public ActionResult SetTeacher()
- {
- return View();
- }
- public ActionResult PreSelectWeeks()
- {
- return View();
- }
- [HttpPost]
- public ActionResult TeacherList(QueryParamsModel pararms)
- {
- var educationSchedulingID = new Guid(Request["EducationSchedulingID"]);
- var teacherList = this.ScheduleServices.GetEducationSchedulingTeacherViewList(educationSchedulingID);
- return Json(new GridResultSet<EducationSchedulingTeacherListView> { rows = teacherList, total = teacherList.Count });
- }
- [HttpPost]
- public ActionResult Submit(CollegeSubmitView collegeSubmitView)
- {
- try
- {
- ScheduleServices.Submit(collegeSubmitView.CollegeID.Value);
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "提交成功!"
- });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage()
- {
- IsSuccess = false,
- Message = "提交失败:" + ex.Message
- });
- }
- }
- public ActionResult Adjustment()
- {
- return View();
- }
- public ActionResult AdjustmentList()
- {
- ViewBag.StartStatusID = this.EducationSchedulingAdjustmentServices.GetStartStatus();
- ViewBag.BackpointIDs = this.EducationSchedulingAdjustmentServices.GetBackpointStatus().ToJson();
- return View();
- }
- [HttpPost]
- public ActionResult AdjustmentList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var coursematerialID = pararms.getExtraGuid("cgbCoursematerial");
- var collegeID = pararms.getExtraGuid("ddlCollege");
- var teacherID = pararms.getExtraGuid("cgbTeacher");
- var classroomID = pararms.getExtraGuid("cbgClassroom");
- var applyUserID = pararms.getExtraGuid("cgbApplyUser");
- var startTime = pararms.getExtraDateTime("txtStartTime");
- var endTime = pararms.getExtraDateTime("txtEndTime");
- var recordStatus = pararms.getExtraInt("ddlRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlRecordStatus");
- var result = EducationSchedulingAdjustmentServices.GetScheduleAdjustmentViewList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID, classroomID, applyUserID, startTime, endTime, recordStatus, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- [HttpPost]
- public ActionResult Adjustment(QueryParamsModel pararms)
- {
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var userID = pararms.getExtraGuid("cgbTeacher");
- var coursematerialID = pararms.getExtraGuid("cgbCoursematerial");
- var educationMissionClassID = pararms.getExtraGuid("cgbEducationMissionClass");
- var weekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum");
- var weekday = pararms.getExtraInt("ddlWeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekDay");
- var courseTimesID = pararms.getExtraGuid("ddlCourseTimes");
- var classroomID = pararms.getExtraGuid("cgbClassroom");
- if (!userID.HasValue)
- {
- return Json(new GridResultSet<ScheduleAdjustmentEditView> { rows = new List<ScheduleAdjustmentEditView>(), total = 0 });
- }
- var scheduleAdjustmentViewList = this.ScheduleServices.GetTeacherScheduleAdjustmentViewList(schoolyearID ?? Guid.Empty,
- userID.Value, coursematerialID, educationMissionClassID, weekNum, weekday, courseTimesID, classroomID);
- return Json(new GridResultSet<ScheduleAdjustmentEditView> { rows = scheduleAdjustmentViewList, total = scheduleAdjustmentViewList.Count });
- }
- [HttpPost]
- public ActionResult Stop(QueryParamsModel pararms)
- {
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var userID = pararms.getExtraGuid("cgbTeacher");
- var coursematerialID = pararms.getExtraGuid("cgbCoursematerial");
- var educationMissionClassID = pararms.getExtraGuid("cgbEducationMissionClass");
- var weekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum");
- var weekday = pararms.getExtraInt("ddlWeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekDay");
- var courseTimesID = pararms.getExtraGuid("ddlCourseTimes");
- var classroomID = pararms.getExtraGuid("cgbClassroom");
- if (!userID.HasValue)
- {
- return Json(new GridResultSet<ScheduleStopEditView> { rows = new List<ScheduleStopEditView>(), total = 0 });
- }
- var scheduleAdjustmentViewList = this.ScheduleServices.GetTeacherScheduleStopViewList(schoolyearID ?? Guid.Empty,
- userID.Value, coursematerialID, educationMissionClassID, weekNum, weekday, courseTimesID, classroomID);
- return Json(new GridResultSet<ScheduleStopEditView> { rows = scheduleAdjustmentViewList, total = scheduleAdjustmentViewList.Count });
- }
- public ActionResult AdjustmentEdit(Guid? EducationSchedulingAdjustmentID, Guid? EducationSchedulingWeekNumID, Guid? UserID)
- {
- if (EducationSchedulingWeekNumID.HasValue)
- {
- var scheduleAdjustmentView = this.ScheduleServices.GetScheduleAdjustmentView(EducationSchedulingWeekNumID.Value);
- var user = this.UserServices.GetUserByID(UserID.Value);
- scheduleAdjustmentView.ToClassroomTypeID = scheduleAdjustmentView.ClassroomTypeID;
- scheduleAdjustmentView.UserID = user.UserID;
- scheduleAdjustmentView.ToUserID = scheduleAdjustmentView.UserID;
- scheduleAdjustmentView.UserName = user.Name;
- return View(scheduleAdjustmentView);
- }
- else
- {
- var scheduleAdjustmentView = this.EducationSchedulingAdjustmentServices.GetScheduleAdjustmentEditView(EducationSchedulingAdjustmentID.Value);
- return View(scheduleAdjustmentView);
- }
- }
- public ActionResult AdjustmentBatchEdit(int? classroomTypeID, string educationSchedulingWeekNumIDs)
- {
- ViewBag.EducationSchedulingWeekNumIDs = educationSchedulingWeekNumIDs;
- ViewBag.WeekNumDropdownItemList = SchoolYearServices.GetCurrentSchoolyearWeekNumList()
- .Select(x => new DropdownListItem { Text = x.ToString(), Value = x.ToString() })
- .ToList();
- return View();
- }
- [HttpPost]
- public ActionResult AdjustmentBatchEdit(string educationSchedulingWeekNumIDs, Guid fromUserID, int? toWeekNum, int? toWeekday, Guid? toUserID,
- Guid? toCoursesTimeID, int? toClassroomType, Guid? toClassroom)
- {
- try
- {
- var educationSchedulingWeekNumIDList = educationSchedulingWeekNumIDs.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- this.EducationSchedulingAdjustmentServices.BatchSave(educationSchedulingWeekNumIDList, fromUserID, toWeekNum, toWeekday, toUserID,
- toCoursesTimeID, toClassroomType, toClassroom);
- return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult AdjustmentEdit(ScheduleAdjustmentEditView scheduleAdjustment)
- {
- try
- {
- this.EducationSchedulingAdjustmentServices.Save(scheduleAdjustment);
- return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult AdjustmentDelete(string educationSchedulingAdjustmentIDs)
- {
- try
- {
- var adjustmentIDList = educationSchedulingAdjustmentIDs.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- this.EducationSchedulingAdjustmentServices.Delete(adjustmentIDList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult AdjustmentSubmit(string educationSchedulingAdjustmentIDs)
- {
- try
- {
- var adjustmentIDList = educationSchedulingAdjustmentIDs.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
-
- this.EducationSchedulingAdjustmentServices.Submit(adjustmentIDList, CustomPrincipal.Current.UserID);
- return Json(new ReturnMessage { IsSuccess = true, Message = "提交成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "提交失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult AdjustmentExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var selectedID = Request.Form["hidEducationSchedulingAdjustmentID"] ?? "";
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var coursematerialID = Request.Form["cgbCoursematerial"].ParseStrTo<Guid>();
- var collegeID = Request.Form["ddlCollege"].ParseStrTo<Guid>();
- var teacherID = Request.Form["cgbTeacher"].ParseStrTo<Guid>();
- var classroomID = Request.Form["cbgClassroom"].ParseStrTo<Guid>();
- var applyUserID = Request.Form["cgbApplyUser"].ParseStrTo<Guid>();
- var startTime = Request.Form["txtStartTime"].ParseStrTo<DateTime>();
- var endTime = Request.Form["txtEndTime"].ParseStrTo<DateTime>();
- var recordStatus = Request.Form["ddlRecordStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlRecordStatus"].ParseStrTo<int>();
- List<ScheduleAdjustmentView> result;
- if (!string.IsNullOrEmpty(selectedID))
- {
- var adjustmentIDList = selectedID.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- result = EducationSchedulingAdjustmentServices.GetScheduleAdjustmentViewList(adjustmentIDList);
- }
- else
- {
- result = EducationSchedulingAdjustmentServices.GetScheduleAdjustmentViewList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID, classroomID, applyUserID, startTime, endTime, recordStatus);
- }
- var dt = result.Select(x => new
- {
- x.SchoolyearCode,
- x.CourseCode,
- x.CourseName,
- x.EducationMissionClassName,
- x.TeacherNames,
- x.TimeDetail,
- x.ClassroomName,
- x.ToTeacherNames,
- x.ToTimeDetail,
- x.ToClassroomName,
- x.ApplyUserName,
- ApplyTime = x.ApplyTime.HasValue ? x.ApplyTime.Value.ToString("yyyy-MM-dd") : "",
- x.RecordStatusName
- }).ToTable();
- string[] liststring = { "学年学期", "课程代码", "课程名称", "任务班名称", "原任课老师", "原上课时间","原教室",
- "任课老师", "上课时间", "教室", "申请人", "申请时间", "状态"};
- neh.Export(dt, liststring, "课程调整信息");
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功!"
- });
- }
- public ActionResult AdjustmentApprove()
- {
- ViewBag.DefaultApproveStatusID = EducationSchedulingAdjustmentServices.GetApproveStatusViewList().Select(x => x.ID).FirstOrDefault();
- return View();
- }
- [HttpPost]
- public ActionResult AdjustmentApproveList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var coursematerialID = pararms.getExtraGuid("cgbCoursematerial");
- var collegeID = pararms.getExtraGuid("ddlCollege");
- var teacherID = pararms.getExtraGuid("cgbTeacher");
- var classroomID = pararms.getExtraGuid("cbgClassroom");
- var applyUserID = pararms.getExtraGuid("cgbApplyUser");
- var startTime = pararms.getExtraDateTime("txtStartTime");
- var endTime = pararms.getExtraDateTime("txtEndTime");
- var recordStatus = pararms.getExtraInt("ddlRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlRecordStatus");
- var result = EducationSchedulingAdjustmentServices.GetScheduleAdjustmentViewApproveList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID, classroomID, applyUserID, startTime, endTime, recordStatus, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- [HttpPost]
- public ActionResult AdjustmentApprove(string educationSchedulingAdjustmentIDs, Guid actionID, string comment)
- {
- var adjustmentIDList = educationSchedulingAdjustmentIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- var curUserID = CustomPrincipal.Current.UserID;
- if (adjustmentIDList.Count == 0)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "请选择至少一条记录进行审核。" });
- }
- try
- {
- this.EducationSchedulingAdjustmentServices.Approve(adjustmentIDList, curUserID, actionID, comment);
- return Json(new ReturnMessage { IsSuccess = true, Message = "审核成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "审核失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult AdjustmentApproveExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var selectedID = Request.Form["hidEducationSchedulingAdjustmentID"] ?? "";
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var coursematerialID = Request.Form["cgbCoursematerial"].ParseStrTo<Guid>();
- var collegeID = Request.Form["ddlCollege"].ParseStrTo<Guid>();
- var teacherID = Request.Form["cgbTeacher"].ParseStrTo<Guid>();
- var classroomID = Request.Form["cbgClassroom"].ParseStrTo<Guid>();
- var applyUserID = Request.Form["cgbApplyUser"].ParseStrTo<Guid>();
- var startTime = Request.Form["txtStartTime"].ParseStrTo<DateTime>();
- var endTime = Request.Form["txtEndTime"].ParseStrTo<DateTime>();
- var recordStatus = Request.Form["ddlRecordStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlRecordStatus"].ParseStrTo<int>();
- List<ScheduleAdjustmentView> result;
- if (!string.IsNullOrEmpty(selectedID))
- {
- var adjustmentIDList = selectedID.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- result = EducationSchedulingAdjustmentServices.GetScheduleAdjustmentViewApproveList(adjustmentIDList);
- }
- else
- {
- result = EducationSchedulingAdjustmentServices.GetScheduleAdjustmentViewApproveList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID, classroomID, applyUserID, startTime, endTime, recordStatus);
- }
- var dt = result.Select(x => new
- {
- x.SchoolyearCode,
- x.CourseCode,
- x.CourseName,
- x.EducationMissionClassName,
- x.TeacherNames,
- x.TimeDetail,
- x.ClassroomName,
- x.ToTeacherNames,
- x.ToTimeDetail,
- x.ToClassroomName,
- x.ApplyUserName,
- ApplyTime = x.ApplyTime.HasValue ? x.ApplyTime.Value.ToString("yyyy-MM-dd") : "",
- x.RecordStatusName
- }).ToTable();
- string[] liststring = { "学年学期", "课程代码", "课程名称", "任务班名称", "原任课老师", "原上课时间","原教室",
- "任课老师","上课时间","教室", "申请人", "申请时间", "状态"};
- neh.Export(dt, liststring, "课程调整信息");
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功!"
- });
- }
- public ActionResult StopList()
- {
- ViewBag.StartStatusID = this.EducationSchedulingStopServices.GetStartStatus();
- ViewBag.BackpointIDs = this.EducationSchedulingStopServices.GetBackpointStatus().ToJson();
- return View();
- }
- public ActionResult StopScheduling()
- {
- return View();
- }
- [HttpPost]
- public ActionResult StopScheduling(string educationSchedulingStopIDs, Guid? UserID)
- {
- try
- {
- var stopIDList = educationSchedulingStopIDs.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- this.EducationSchedulingStopServices.StopSave(stopIDList, UserID);
- return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
- }
- }
- public ActionResult StopEdit(Guid? EducationSchedulingStopID, Guid? EducationSchedulingID, Guid? UserID)
- {
- if (EducationSchedulingID.HasValue)
- {
- var scheduleAdjustmentView = this.ScheduleServices.GetEducationSchedulingStopView(EducationSchedulingID.Value);
- var user = this.UserServices.GetUserByID(UserID.Value);
- scheduleAdjustmentView.UserID = user.UserID;
- return View(scheduleAdjustmentView);
- }
- else
- {
- var scheduleAdjustmentView = this.EducationSchedulingStopServices.GetEducationSchedulingStopView(EducationSchedulingStopID.Value);
- return View(scheduleAdjustmentView);
- }
- }
- [HttpPost]
- public ActionResult StopList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var coursematerialID = pararms.getExtraGuid("cgbCoursematerial");
- var collegeID = pararms.getExtraGuid("ddlCollege");
- var teacherID = pararms.getExtraGuid("cgbTeacher");
- var weekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum");
- var weekDay = pararms.getExtraInt("WeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("WeekDay");
- var coursesTimeID = pararms.getExtraGuid("Times");
- var classroomID = pararms.getExtraGuid("ClassroomID");
- var applyUserID = pararms.getExtraGuid("applyUserID");
- var starDate = pararms.getExtraDateTime("txtStartDate");
- var endDate = pararms.getExtraDateTime("txtEndDate");
- var recordStatus = pararms.getExtraInt("ddlRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlRecordStatus");
- var result = EducationSchedulingStopServices.GetEducationSchedulingStopViewList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID, weekNum, weekDay, coursesTimeID, classroomID, applyUserID, starDate, endDate, recordStatus, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- [HttpPost]
- public ActionResult StopExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var selectedID = Request.Form["hidEducationSchedulingStopID"] ?? "";
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var coursematerialID = Request.Form["cgbCoursematerial"].ParseStrTo<Guid>();
- var collegeID = Request.Form["ddlCollege"].ParseStrTo<Guid>();
- var teacherID = Request.Form["cgbTeacher"].ParseStrTo<Guid>();
- var weekNum = Request.Form["ddlWeekNum"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlWeekNum"].ParseStrTo<int>();
- var weekDay = Request.Form["WeekDay"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["WeekDay"].ParseStrTo<int>();
- var coursesTimeID = Request.Form["Times"].ParseStrTo<Guid>();
- var classroomID = Request.Form["ClassroomID"].ParseStrTo<Guid>();
- var applyUserID = Request.Form["applyUserID"].ParseStrTo<Guid>();
- var starDate = Request.Form["txtStartDate"].ParseStrTo<DateTime>();
- var endDate = Request.Form["txtEndDate"].ParseStrTo<DateTime>();
- var recordStatus = Request.Form["ddlRecordStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlRecordStatus"].ParseStrTo<int>();
- List<EducationSchedulingStopView> result;
- if (!string.IsNullOrEmpty(selectedID))
- {
- var stopIDList = selectedID.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- result = EducationSchedulingStopServices.GetEducationSchedulingStopViewList(stopIDList);
- }
- else
- {
- result = EducationSchedulingStopServices.GetEducationSchedulingStopViewList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID, weekNum, weekDay, coursesTimeID, classroomID, applyUserID, starDate, endDate, recordStatus);
- }
- var dt = result.Select(x => new
- {
- x.SchoolyearCode,
- x.CourseCode,
- x.CourseName,
- x.EducationMissionClassName,
- x.TimeDetail,
- x.ClassroomName,
- x.TeacherNames,
- x.RecordStatusName
- }).ToTable();
- string[] liststring = { "学年学期", "课程代码", "课程名称", "任务班名称", "上课时间","教室", "停课老师", "状态"};
- neh.Export(dt, liststring, "停课信息");
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功!"
- });
- }
- [HttpPost]
- public ActionResult StopDelete(string educationSchedulingStopIDs)
- {
- try
- {
- var stopIDList = educationSchedulingStopIDs.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- this.EducationSchedulingStopServices.Delete(stopIDList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "删除成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "删除失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult StopSubmit(string educationSchedulingStopIDs)
- {
- try
- {
- var stopIDList = educationSchedulingStopIDs.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- this.EducationSchedulingStopServices.Submit(stopIDList, CustomPrincipal.Current.UserID);
- return Json(new ReturnMessage { IsSuccess = true, Message = "提交成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "提交失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult StopEdit(EducationSchedulingStopView scheduleStop)
- {
- try
- {
- this.EducationSchedulingStopServices.Save(scheduleStop);
- return Json(new ReturnMessage { IsSuccess = true, Message = "保存成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "保存失败:" + ex.Message });
- }
- }
- public ActionResult StopApprove()
- {
- ViewBag.DefaultApproveStatusID = EducationSchedulingStopServices.GetApproveStatusViewList().Select(x => x.ID).FirstOrDefault();
- return View();
- }
- [HttpPost]
- public ActionResult StopApproveList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- var schoolyearID = pararms.getExtraGuid("ddlSchoolyear");
- var coursematerialID = pararms.getExtraGuid("cgbCoursematerial");
- var collegeID = pararms.getExtraGuid("ddlCollege");
- var teacherID = pararms.getExtraGuid("cgbTeacher");
- var weekNum = pararms.getExtraInt("ddlWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlWeekNum");
- var weekDay = pararms.getExtraInt("WeekDay") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("WeekDay");
- var coursesTimeID = pararms.getExtraGuid("Times");
- var classroomID = pararms.getExtraGuid("ClassroomID");
- var applyUserID = pararms.getExtraGuid("applyUserID");
- var starDate = pararms.getExtraDateTime("txtStartDate");
- var endDate = pararms.getExtraDateTime("txtEndDate");
- var recordStatus = pararms.getExtraInt("ddlRecordStatus") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ddlRecordStatus");
- var result = EducationSchedulingStopServices.GetEducationSchedulingStopApproveList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID,weekNum,weekDay,coursesTimeID,classroomID,applyUserID,starDate,endDate, recordStatus, (int)pararms.page, (int)pararms.rows);
- return Json(result);
- }
- [HttpPost]
- public ActionResult StopApprove(string educationSchedulingStopIDs, Guid actionID, string comment)
- {
- var schedulingStopIDList = educationSchedulingStopIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- var curUserID = CustomPrincipal.Current.UserID;
- if (schedulingStopIDList.Count == 0)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "请选择至少一条记录进行审核。" });
- }
- try
- {
- this.EducationSchedulingStopServices.Approve(schedulingStopIDList, curUserID, actionID, comment);
- return Json(new ReturnMessage { IsSuccess = true, Message = "审核成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "审核失败:" + ex.Message });
- }
- }
- [HttpPost]
- public ActionResult StopApproveExcel()
- {
- NpoiExcelHelper neh = new NpoiExcelHelper();
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(null);
- var selectedID = Request.Form["hidEducationSchedulingStopID"] ?? "";
- var schoolyearID = Request.Form["ddlSchoolyear"].ParseStrTo<Guid>();
- var coursematerialID = Request.Form["cgbCoursematerial"].ParseStrTo<Guid>();
- var collegeID = Request.Form["ddlCollege"].ParseStrTo<Guid>();
- var teacherID = Request.Form["cgbTeacher"].ParseStrTo<Guid>();
- var weekNum = Request.Form["ddlWeekNum"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlWeekNum"].ParseStrTo<int>();
- var weekDay = Request.Form["WeekDay"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["WeekDay"].ParseStrTo<int>();
- var coursesTimeID = Request.Form["Times"].ParseStrTo<Guid>();
- var classroomID = Request.Form["ClassroomID"].ParseStrTo<Guid>();
- var applyUserID = Request.Form["applyUserID"].ParseStrTo<Guid>();
- var starDate = Request.Form["txtStartDate"].ParseStrTo<DateTime>();
- var endDate = Request.Form["txtEndDate"].ParseStrTo<DateTime>();
- var recordStatus = Request.Form["ddlRecordStatus"].ParseStrTo<int>() == DropdownList.SELECT_ALL ? null : Request.Form["ddlRecordStatus"].ParseStrTo<int>();
- List<EducationSchedulingStopView> result;
- if (!string.IsNullOrEmpty(selectedID))
- {
- var stopIDList = selectedID.Split(',')
- .Where(x => !string.IsNullOrEmpty(x)).Select(x => new Guid(x)).ToList();
- result = EducationSchedulingStopServices.GetEducationSchedulingStopApproveList(stopIDList);
- }
- else
- {
- result = EducationSchedulingStopServices.GetEducationSchedulingStopApproveList(configuretView, schoolyearID, coursematerialID,
- collegeID, teacherID,weekNum,weekDay,coursesTimeID,classroomID,applyUserID,starDate,endDate, recordStatus);
- }
- var dt = result.Select(x => new
- {
- x.SchoolyearCode,
- x.CourseCode,
- x.CourseName,
- x.EducationMissionClassName,
- x.TimeDetail,
- x.ClassroomName,
- x.TeacherNames,
- x.RecordStatusName
- }).ToTable();
- string[] liststring = { "学年学期", "课程代码", "课程名称", "任务班名称", "上课时间", "教室", "停课老师", "状态" };
- neh.Export(dt, liststring, "停课信息");
- return Json(new ReturnMessage()
- {
- IsSuccess = true,
- Message = "保存成功!"
- });
- }
- [HttpPost]
- public ActionResult GetNotUseCoursesTimeDropDown(DropdownListBindType? bindType, Guid schoolyearID,
- int weekday, int toWeekday, Guid courseTimeID, int weekNum, int toWeekNum,
- Guid? fromTeacherID, Guid? replaceTeacherID, Guid educationMissionClassID)
- {
- var notUseCourseTimeViewList = this.ScheduleServices.GetNotUseCoursesTimeViewList(schoolyearID, weekday, toWeekday, courseTimeID,
- weekNum, toWeekNum, fromTeacherID, replaceTeacherID, educationMissionClassID);
- List<DropdownListItem> list = notUseCourseTimeViewList
- .Select(x => new DropdownListItem { Text = x.StartDate + "-" + x.EndDate, Value = x.CoursesTimeID.ToString() }).ToList();
- DropdownListBindType dbt = bindType == null ? DropdownListBindType.SelectAll : bindType.Value;
- DropdownList.FormatDropdownItemList(dbt, list);
- return base.Json(list);
- }
- [HttpPost]
- public ActionResult GetNotUseClassroomList(QueryParamsModel pararms)
- {
- ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
- Guid schoolyearID = pararms.getExtraGuid("SchoolyearID") ?? Guid.Empty;
- int weekday = (pararms.getExtraInt("Weekday") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("Weekday")) ?? -1;
- int toWeekday = (pararms.getExtraInt("ToWeekday") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ToWeekday")) ?? -1;
- Guid coursesTimeID = pararms.getExtraGuid("CoursesTimeID") ?? Guid.Empty;
- Guid toCoursesTimeID = pararms.getExtraGuid("ToCoursesTimeID") ?? Guid.Empty;
- int weekNum = (pararms.getExtraInt("WeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("WeekNum")) ?? -1;
- int toWeekNum = (pararms.getExtraInt("ToWeekNum") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ToWeekNum")) ?? -1;
- int classroomTypeID = (pararms.getExtraInt("ClassroomTypeID") == DropdownList.SELECT_ALL ? null : pararms.getExtraInt("ClassroomTypeID")) ?? -1;
- Guid educationMissionClassID = pararms.getExtraGuid("EducationMissionClassID") ?? Guid.Empty;
- var notUseClassroomViewList = this.ScheduleServices.GetNotUseClassroomViewList(configuretView, schoolyearID, weekday, toWeekday, coursesTimeID,
- toCoursesTimeID, new List<int?> { weekNum }, new List<int?> { toWeekNum }, classroomTypeID, educationMissionClassID, pararms.page, pararms.rows);
- return base.Json(notUseClassroomViewList);
- }
- [HttpPost]
- public ActionResult GetEducationSchedulingClass(Guid schoolyearID, Guid classmajorID)
- {
- var schedulingClassList = EducationSchedulingClassServices.GetEducationSchedulingClassViewList(schoolyearID, classmajorID);
- var draggableList = new GridResultSet<EducationSchedulingClassScheduleView>
- {
- rows = schedulingClassList,
- total = schedulingClassList.Count
- };
- return Json(draggableList);
- }
- [HttpPost]
- public ActionResult GetDepartmentEducationSchedulingClass(Guid schoolyearID, Guid departmentID, string handleModes)
- {
- var handleModeList = handleModes.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (int?)Convert.ToInt32(x)).ToList();
- var schedulingClassList = EducationSchedulingClassServices.GetDepartmentEducationSchedulingClassViewList(schoolyearID, departmentID, handleModeList);
- var draggableList = new GridResultSet<EducationSchedulingClassScheduleView>
- {
- rows = schedulingClassList,
- total = schedulingClassList.Count
- };
- return Json(draggableList);
- }
- [HttpPost]
- public ActionResult GetClassmajorSchedule(Guid schoolyearID, Guid classmajorID)
- {
- var classmajorSchedule = ScheduleServices.GetClassmajorSchedule(schoolyearID, classmajorID);
- return Json(classmajorSchedule);
- }
- [HttpPost]
- public ActionResult GetEducationMissionClassViewBySchedule(Guid? schoolyearID, DateTime date, Guid coursesTimeID, Guid teacherUserID)
- {
- var educationMissionClassView = ScheduleServices.GetEducationMissionClassViewBySchedule(schoolyearID, date, coursesTimeID, teacherUserID);
- return Json(educationMissionClassView);
- }
- [HttpPost]
- public ActionResult GetDepartmentSchedule(Guid schoolyearID, Guid departmentID, string handleModes)
- {
- var handleModeList = handleModes.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (int?)Convert.ToInt32(x)).ToList();
- var departmentSchedule = ScheduleServices.GetDepartmentSchedule(schoolyearID, departmentID, handleModeList);
- return Json(departmentSchedule);
- }
- [HttpPost]
- public ActionResult GetAvailableClassroom(Guid schoolYearID, Guid collegeID, string schedulingWeekListStr, int weekday, Guid courseTimeID, int? classroomTypeID, int? studentNum)
- {
- var schedulingWeekList = schedulingWeekListStr.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (int?)Convert.ToInt32(x)).ToList();
- var classroomList = ScheduleServices.GetAvailableClassroomList(collegeID, schoolYearID, schedulingWeekList,
- weekday, courseTimeID, studentNum, classroomTypeID);
- return Json(classroomList);
- }
- [HttpPost]
- public ActionResult IsEducationSchedulingClassCanAddManualSchedule(Guid educationScheduleClassID, string schedulingWeekListStr, Guid schoolYearID,
- int weekday, Guid courseTimeID)
- {
- try
- {
- var schedulingWeekList = schedulingWeekListStr.JsonToObject<List<SchedulingWeekListView>>().ToList();
- this.ScheduleServices.CheckEducationSchedulingClassCanAddManualSchedule(educationScheduleClassID, schedulingWeekList, schoolYearID,
- weekday, courseTimeID);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (Exception ex)
- {
- if (ex.Data.Count > 0)
- {
- var data = new List<KeyValuePair<Guid, string>>();
- foreach (DictionaryEntry item in ex.Data)
- {
- data.Add(new KeyValuePair<Guid, string>((Guid)item.Key, item.Value.ToString()));
- }
- return Json(new ReturnMessage<List<KeyValuePair<Guid, string>>> { IsSuccess = false, Message = ex.Message, Data = data });
- }
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult IsClassroomIsAvailable(Guid collegeID, Guid schoolYearID, string schedulingWeekListStr,
- int weekday, Guid courseTimeID, Guid classroomID)
- {
- var schedulingWeekList = schedulingWeekListStr.Split(',').Where(x => x != null).Select(x => (int?)Convert.ToInt32(x)).ToList();
- try
- {
- ScheduleServices.CheckClassroomIsAvailable(collegeID, schoolYearID, schedulingWeekList, weekday, courseTimeID, classroomID);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (ClassroomConflictException ex)
- {
- return Json(new ReturnMessage<Guid> { IsSuccess = false, Message = ex.Message, Data = classroomID });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult IsCourseOnWork(Guid coursematerialID, int weekday, Guid courseTimeID)
- {
- try
- {
- this.ScheduleServices.CheckCourseIsOnWork(coursematerialID, weekday, courseTimeID);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult IsTeacherOnWork(Guid educationScheduleClassID, string schedulingWeekListStr, int weekday, Guid courseTimeID)
- {
- try
- {
- var schedulingWeekList = schedulingWeekListStr.JsonToObject<List<SchedulingWeekListView>>().ToList();
- this.ScheduleServices.CheckTeacherIsOnWork(educationScheduleClassID, schedulingWeekList, weekday, courseTimeID);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult GetTeacherContinuousWorkTime(Guid educationScheduleClassID, string schedulingWeekListStr,
- Guid schoolYearID, int weekday)
- {
- var schedulingWeekList = schedulingWeekListStr.JsonToObject<List<SchedulingWeekListView>>().ToList();
- return Json(ScheduleServices.GetTeacherContinuousWorkTime(educationScheduleClassID, schedulingWeekList,
- schoolYearID, weekday));
- }
- [HttpPost]
- public ActionResult GetContinuousLimitView()
- {
- return Json(new ContinuousLimitView
- {
- TeacherScheduleContinuousCount = ParameterServices.GetParameterValue<int>(CF_ParameterType.TeacherScheduleContinuousCount) ?? 0,
- ClassScheduleContinuousCount = ParameterServices.GetParameterValue<int>(CF_ParameterType.ClassScheduleContinuousCount) ?? 0,
- ClassCourseScheduleContinuousCount = ParameterServices.GetParameterValue<int>(CF_ParameterType.ClassCourseScheduleContinuousCount) ?? 0
- });
- }
- [HttpPost]
- public ActionResult AddScheduling(Guid schoolYearID, Guid educationSchedulingClassID, string weekListStr, string teacherStr, int weekday, Guid courseTimeID, Guid classroomID)
- {
- try
- {
- var schedulingWeekList = weekListStr.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (int?)Convert.ToInt32(x)).ToList();
- var teacherList = teacherStr.JsonToObject<List<CourseProcessTeacherView>>();
- EducationSchedulingView educationSchedulingView = new EducationSchedulingView()
- {
- SchoolyearID = schoolYearID,
- EducationSchedulingClassID = educationSchedulingClassID,
- Weekday = weekday,
- CoursesTimeID = courseTimeID,
- ClassroomID = classroomID
- };
- ScheduleServices.AddScheduling(educationSchedulingView, schedulingWeekList, teacherList);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- //[HttpPost]
- //public ActionResult DelScheduling(Guid schoolYearID, Guid educationSchedulingClassID, int weekday, Guid courseTimeID)
- //{
- // try
- // {
- // ScheduleServices.DelScheduling(schoolYearID, educationSchedulingClassID, weekday, courseTimeID);
- // return Json(new ReturnMessage { IsSuccess = true });
- // }
- // catch (Exception ex)
- // {
- // return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- // }
- //}
- [HttpPost]
- public ActionResult DelScheduling(Guid educationSchedulingID)
- {
- try
- {
- ScheduleServices.DelScheduling(educationSchedulingID);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult DeleteWeeks(Guid educationSchedulingID, string weekListStr)
- {
- try
- {
- var deleteWeekList = weekListStr.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (int?)Convert.ToInt32(x)).ToList();
- ScheduleServices.DelWeeks(educationSchedulingID, deleteWeekList);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult GetClassroomScheduleViewList(Guid schoolYearID, Guid classroomID)
- {
- try
- {
- var classroomScheduleViewList = this.ScheduleServices.GetClassroomScheduleViewList(schoolYearID, classroomID);
-
- return Json(new GridResultSet<ClassroomScheduleView> { rows = classroomScheduleViewList, total = classroomScheduleViewList.Count });
- }
- catch (Exception ex)
- {
- throw ex;
- }
- }
- [HttpPost]
- public ActionResult ChangeClassroom(Guid educationSchedulingID, Guid classroomID)
- {
- try
- {
- ScheduleServices.ChangeClassroom(educationSchedulingID, classroomID);
- return Json(new ReturnMessage { IsSuccess = true });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult SetTeacher(Guid educationSchedulingID)
- {
- try
- {
- var teacherViewList = DataGrid.GetTableData<EducationSchedulingTeacherListView>("dgTeacherList");
- ScheduleServices.ChangeTeacher(educationSchedulingID, teacherViewList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "设置教师成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- [HttpPost]
- public ActionResult AutoSchedule(string educationMissionClassIDs)
- {
- try
- {
- var educationMissionClassIDList = educationMissionClassIDs.Split(',').Where(x => !string.IsNullOrEmpty(x)).Select(x => (Guid?)new Guid(x)).ToList();
- ScheduleServices.GenerateSchedule(educationMissionClassIDList);
- return Json(new ReturnMessage { IsSuccess = true, Message = "智能排课成功。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = ex.Message });
- }
- }
- public ActionResult ClearAutoSchedule()
- {
- ClearAutoScheduleView viewmodel = new ClearAutoScheduleView();
- viewmodel.SchoolyearID = BaseExtensions.GetCurrentSchoolYearID();
- return View();
- }
- [HttpPost]
- public ActionResult ClearAutoSchedule(ClearAutoScheduleView viewmodel)
- {
- try
- {
- if (viewmodel.Year == DropdownList.SELECT_ALL)
- {
- viewmodel.Year = null;
- }
- if (viewmodel.StandardID == DropdownList.SELECT_ALL)
- {
- viewmodel.StandardID = null;
- }
- ScheduleServices.ClearAutoSchedule(viewmodel.SchoolyearID, viewmodel.CollegeID, viewmodel.StandardID, viewmodel.Year, viewmodel.ClassmarjorID);
- return Json(new ReturnMessage { IsSuccess = true, Message = "清除智能排课结果完成。" });
- }
- catch (Exception ex)
- {
- return Json(new ReturnMessage { IsSuccess = false, Message = "清除智能排课结果失败," + ex.Message });
- }
- }
- }
- }
|