LevelSettingController.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using EMIS.ViewModel;
  7. using EMIS.Web.Controls;
  8. using EMIS.CommonLogic.ExamManage;
  9. using EMIS.ViewModel.ExamManage;
  10. using Bowin.Web.Controls.Mvc;
  11. using Bowin.Common.Utility;
  12. namespace EMIS.Web.Controllers.ScoreManage
  13. {
  14. [Authorization]
  15. public class LevelSettingController : Controller
  16. {
  17. public ILevelSettingSubjectServices levelSettingSubjectServices { get; set; }
  18. //
  19. public ActionResult List()
  20. {
  21. return View();
  22. }
  23. [HttpPost]
  24. public ActionResult List(QueryParamsModel pararms)
  25. {
  26. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  27. var examinationSubjectID = pararms.getExtraGuid("ExaminationSubjectDropdown");
  28. var examinationTypeID = pararms.getExtraGuid("ExaminationTypeDropdown");
  29. return Json(levelSettingSubjectServices.GetLevelSettingViewGrid(configuretView, examinationTypeID, examinationSubjectID, (int)pararms.page, (int)pararms.rows));
  30. }
  31. public ActionResult Edit(Guid? LevelSettingID)
  32. {
  33. ViewBag.Url = Request.Url.Host;
  34. LevelSettingView levelSettingView = new LevelSettingView();
  35. if (LevelSettingID != null && LevelSettingID != Guid.Empty)
  36. {
  37. levelSettingView = levelSettingSubjectServices.GetLevelSettingView(LevelSettingID);
  38. }
  39. ViewBag.ID = LevelSettingID;
  40. return View(levelSettingView);
  41. }
  42. [HttpPost]
  43. public ActionResult Edit(LevelSettingView levelSettingView)
  44. {
  45. try
  46. {
  47. var LevelSettingSubject = DataGrid.GetTableData<LevelSettingSubjectView>("dgLevelSettingSubjectList");
  48. levelSettingSubjectServices.Edit(levelSettingView, LevelSettingSubject);
  49. return Json(new ReturnMessage()
  50. {
  51. IsSuccess = true,
  52. Message = "保存成功!"
  53. });
  54. }
  55. catch (Exception ex)
  56. {
  57. return Json(new ReturnMessage()
  58. {
  59. IsSuccess = false,
  60. Message = "保存失败:" + ex.Message
  61. });
  62. }
  63. }
  64. [HttpPost]
  65. public ActionResult Delete(string levelSettingIDs)
  66. {
  67. try
  68. {
  69. var levelSettingIDList = levelSettingIDs.Split(',').Select(x => (Guid?)new Guid(x)).ToList();
  70. levelSettingSubjectServices.Delete(levelSettingIDList);
  71. return base.Json("删除成功");
  72. }
  73. catch (Exception ex)
  74. {
  75. return base.Json("删除失败,原因:" + ex.Message + "!");
  76. }
  77. }
  78. public ActionResult ExaminationSubjectSelect(Guid? examinationProjectID)
  79. {
  80. ViewBag.ExaminationProjectID = examinationProjectID;
  81. return View();
  82. }
  83. [HttpPost]
  84. public ActionResult GetLevelSettingSubjectList(QueryParamsModel pararms, Guid? levelSettingID)
  85. {
  86. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  87. var levelSettingSubjectView = levelSettingSubjectServices.GetLevelSettingSubjectViewGridByID(levelSettingID, (int)pararms.page, (int)pararms.rows);
  88. return Json(levelSettingSubjectView);
  89. }
  90. [HttpPost]
  91. public ActionResult GetExaminationSubjectSelect(QueryParamsModel pararms, Guid? examinationProjectID)
  92. {
  93. ConfiguretView configuretView = ConfiguretExtensions.GetConfiguretermsView(pararms);
  94. //var examinationProjectID = pararms.getExtraGuid("examinationProjectID");
  95. //var examinationProjectID = Request.Form["examinationProjectID"].ParseStrTo<Guid>();
  96. return Json(levelSettingSubjectServices.GetExaminationSubjectDicSelect(examinationProjectID, (int)pararms.page, (int)pararms.rows));
  97. }
  98. }
  99. }