ExaminationModeSettingController.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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.ExaminationManage;
  7. using EMIS.ViewModel;
  8. using EMIS.ViewModel.ExaminationManage;
  9. using EMIS.Web.Controls;
  10. using Bowin.Common.Linq.Entity;
  11. using Bowin.Web.Controls.Mvc;
  12. namespace EMIS.Web.Controllers.ExaminationManage
  13. {
  14. [Authorization]
  15. public class ExaminationModeSettingController : Controller
  16. {
  17. public IExaminationModeSettingServices ExaminationModeSettingServices { get; set; }
  18. public ActionResult List()
  19. {
  20. return View();
  21. }
  22. [HttpPost]
  23. public ActionResult List(QueryParamsModel pararms)
  24. {
  25. var examinationModeSettingList = ExaminationModeSettingServices.GetExaminationModeSettingViewList();
  26. return Json(new GridResultSet<ExaminationModeSettingView>() { rows = examinationModeSettingList, total = examinationModeSettingList.Count });
  27. }
  28. [HttpPost]
  29. public ActionResult Edit()
  30. {
  31. try
  32. {
  33. var list = DataGrid.GetTableData<ExaminationModeSettingView>("dgExaminationModeSettingList");
  34. ExaminationModeSettingServices.Save(list);
  35. return RedirectToAction("MsgShow", "Common", new
  36. {
  37. WindowID = "none",
  38. msg = "保存成功!",
  39. url = Url.Content("~/ExaminationModeSetting/List").AddMenuParameter()
  40. });
  41. }
  42. catch (Exception ex)
  43. {
  44. return RedirectToAction("MsgShow", "Common", new
  45. {
  46. WindowID = "none",
  47. msg = "保存失败!" + ex.Message,
  48. url = Url.Content("~/ExaminationModeSetting/List").AddMenuParameter()
  49. });
  50. }
  51. }
  52. }
  53. }