SelectCourseConditionController.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.Web.Controls;
  7. using EMIS.CommonLogic.SelectCourse;
  8. using EMIS.ViewModel.SelectCourse;
  9. using EMIS.ViewModel;
  10. namespace EMIS.Web.Controllers.SelectCourseManage
  11. {
  12. [Authorization]
  13. public class SelectCourseConditionController : Controller
  14. {
  15. public IConditionServices ConditionServices { get; set; }
  16. /// <summary>
  17. /// 条件设定页面
  18. /// </summary>
  19. /// <returns></returns>
  20. public ActionResult Index()
  21. {
  22. var conditionView = ConditionServices.GetSelectCourseConditionView();
  23. return View(conditionView);
  24. }
  25. [HttpPost]
  26. public ActionResult Index(SelectCourseConditionView conditionView)
  27. {
  28. try
  29. {
  30. var user = HttpContext.User as EMIS.Utility.FormValidate.CustomPrincipal;
  31. ConditionServices.Save(conditionView);
  32. return Json(new ReturnMessage
  33. {
  34. IsSuccess = true,
  35. Message = "保存成功"
  36. });
  37. }
  38. catch (Exception ex)
  39. {
  40. return Json(new ReturnMessage
  41. {
  42. IsSuccess = false,
  43. Message = "保存失败!" + ex.Message
  44. });
  45. }
  46. }
  47. }
  48. }