using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using EMIS.CommonLogic.SystemServices; using EMIS.ViewModel.SchedulingManage.SchedulingSettings; using EMIS.ViewModel; namespace EMIS.Web.Controllers.SchedulingManage.SchedulingSettings { [Authorization] public class ClassTimeSettingsController : Controller { public IParameterServices parameterServices { get; set; } // // GET: /ClassTimeSettings/ public ActionResult List() { ClassTimeSettingsView classTimeSettingsView = new ClassTimeSettingsView(); var teacherScheduleContinuousCount = parameterServices.GetParameterValue(ViewModel.CF_ParameterType.TeacherScheduleContinuousCount); //教师连续上课节次限制 var classScheduleContinuousCount = parameterServices.GetParameterValue(ViewModel.CF_ParameterType.ClassScheduleContinuousCount); //班级连续上课节次限制 var classCourseScheduleContinuousCount = parameterServices.GetParameterValue(ViewModel.CF_ParameterType.ClassCourseScheduleContinuousCount); //班级课程连续排课节次限制 //目前用于课程进度报表 var ClassScheduleWeekTimeCount = parameterServices.GetParameterValue(ViewModel.CF_ParameterType.ClassScheduleWeekTimeCount); classTimeSettingsView.TeacherScheduleContinuousCount = teacherScheduleContinuousCount; classTimeSettingsView.ClassScheduleContinuousCount = classScheduleContinuousCount; classTimeSettingsView.ClassCourseScheduleContinuousCount = classCourseScheduleContinuousCount; classTimeSettingsView.ClassScheduleWeekTimeCount = ClassScheduleWeekTimeCount; return View(classTimeSettingsView); } [HttpPost] public ActionResult List(ClassTimeSettingsView classTimeSettingsView) { try { parameterServices.SaveTo(ViewModel.CF_ParameterType.TeacherScheduleContinuousCount, classTimeSettingsView.TeacherScheduleContinuousCount); parameterServices.SaveTo(ViewModel.CF_ParameterType.ClassScheduleContinuousCount, classTimeSettingsView.ClassScheduleContinuousCount); parameterServices.SaveTo(ViewModel.CF_ParameterType.ClassCourseScheduleContinuousCount, classTimeSettingsView.ClassCourseScheduleContinuousCount); parameterServices.SaveTo(ViewModel.CF_ParameterType.ClassScheduleWeekTimeCount, classTimeSettingsView.ClassScheduleWeekTimeCount); return Json(new ReturnMessage() { IsSuccess = true, Message = "保存成功!" }); } catch (Exception ex) { return Json(new ReturnMessage() { IsSuccess = true, Message = "保存失败,原因:" + ex.Message + "!" }); } } } }