ClassTimeSettingsController.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.CommonLogic.SystemServices;
  7. using EMIS.ViewModel.SchedulingManage.SchedulingSettings;
  8. using EMIS.ViewModel;
  9. namespace EMIS.Web.Controllers.SchedulingManage.SchedulingSettings
  10. {
  11. [Authorization]
  12. public class ClassTimeSettingsController : Controller
  13. {
  14. public IParameterServices parameterServices { get; set; }
  15. //
  16. // GET: /ClassTimeSettings/
  17. public ActionResult List()
  18. {
  19. ClassTimeSettingsView classTimeSettingsView = new ClassTimeSettingsView();
  20. var teacherScheduleContinuousCount = parameterServices.GetParameterValue<int>(ViewModel.CF_ParameterType.TeacherScheduleContinuousCount); //教师连续上课节次限制
  21. var classScheduleContinuousCount = parameterServices.GetParameterValue<int>(ViewModel.CF_ParameterType.ClassScheduleContinuousCount); //班级连续上课节次限制
  22. var classCourseScheduleContinuousCount = parameterServices.GetParameterValue<int>(ViewModel.CF_ParameterType.ClassCourseScheduleContinuousCount); //班级课程连续排课节次限制
  23. //目前用于课程进度报表
  24. var ClassScheduleWeekTimeCount = parameterServices.GetParameterValue<int>(ViewModel.CF_ParameterType.ClassScheduleWeekTimeCount);
  25. classTimeSettingsView.TeacherScheduleContinuousCount = teacherScheduleContinuousCount;
  26. classTimeSettingsView.ClassScheduleContinuousCount = classScheduleContinuousCount;
  27. classTimeSettingsView.ClassCourseScheduleContinuousCount = classCourseScheduleContinuousCount;
  28. classTimeSettingsView.ClassScheduleWeekTimeCount = ClassScheduleWeekTimeCount;
  29. return View(classTimeSettingsView);
  30. }
  31. [HttpPost]
  32. public ActionResult List(ClassTimeSettingsView classTimeSettingsView)
  33. {
  34. try
  35. {
  36. parameterServices.SaveTo(ViewModel.CF_ParameterType.TeacherScheduleContinuousCount, classTimeSettingsView.TeacherScheduleContinuousCount);
  37. parameterServices.SaveTo(ViewModel.CF_ParameterType.ClassScheduleContinuousCount, classTimeSettingsView.ClassScheduleContinuousCount);
  38. parameterServices.SaveTo(ViewModel.CF_ParameterType.ClassCourseScheduleContinuousCount, classTimeSettingsView.ClassCourseScheduleContinuousCount);
  39. parameterServices.SaveTo(ViewModel.CF_ParameterType.ClassScheduleWeekTimeCount, classTimeSettingsView.ClassScheduleWeekTimeCount);
  40. return Json(new ReturnMessage()
  41. {
  42. IsSuccess = true,
  43. Message = "保存成功!"
  44. });
  45. }
  46. catch (Exception ex)
  47. {
  48. return Json(new ReturnMessage()
  49. {
  50. IsSuccess = true,
  51. Message = "保存失败,原因:" + ex.Message + "!"
  52. });
  53. }
  54. }
  55. }
  56. }