RetakeParameterController.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.RetakeManage;
  7. using EMIS.ViewModel.RetakeManage;
  8. using Bowin.Web.Controls.Mvc;
  9. using EMIS.ViewModel;
  10. using Bowin.Common.Linq.Entity;
  11. namespace EMIS.Web.Controllers.RetakeManage
  12. {
  13. [Authorization]
  14. public class RetakeParameterController : Controller
  15. {
  16. public IRetakeParameterServices RetakeParameterServices { get; set; }
  17. /// <summary>
  18. /// 重修参数设定页面
  19. /// </summary>
  20. /// <returns></returns>
  21. public ActionResult Index()
  22. {
  23. var retakeParameterView = RetakeParameterServices.GetRetakeParameterView();
  24. return View(retakeParameterView);
  25. }
  26. /// <summary>
  27. /// 重修参数设定设置
  28. /// </summary>
  29. /// <param name="retakeParameterView"></param>
  30. /// <returns></returns>
  31. [HttpPost]
  32. public ActionResult Index(RetakeParameterView retakeParameterView)
  33. {
  34. var retakeExamsCategoryViewList = DataGrid.GetTableData<RetakeExamsCategoryView>("dgRetakeExamsCategoryList");
  35. try
  36. {
  37. RetakeParameterServices.SaveParameterView(retakeParameterView, retakeExamsCategoryViewList);
  38. return Json(new ReturnMessage()
  39. {
  40. IsSuccess = true,
  41. Message = "设置成功。"
  42. });
  43. }
  44. catch (Exception ex)
  45. {
  46. return Json(new ReturnMessage()
  47. {
  48. IsSuccess = false,
  49. Message = "设置失败,原因:" + ex.Message
  50. });
  51. }
  52. }
  53. /// <summary>
  54. /// 重修预查考试性质列表查询
  55. /// </summary>
  56. /// <param name="pararms"></param>
  57. /// <returns></returns>
  58. [HttpPost]
  59. public ActionResult RetakeExamsCategoryList(QueryParamsModel pararms)
  60. {
  61. var retakeExamsCategoryList = RetakeParameterServices.GetExamsCategoryViewList();
  62. return Json(new GridResultSet<RetakeExamsCategoryView> { total = retakeExamsCategoryList.Count, rows = retakeExamsCategoryList });
  63. }
  64. }
  65. }