ExaminationNoticeSettingController.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.ExaminationManage;
  8. using EMIS.ViewModel;
  9. namespace EMIS.Web.Controllers.ExaminationManage
  10. {
  11. [Authorization]
  12. public class ExaminationNoticeSettingController : Controller
  13. {
  14. //
  15. // GET: /ExaminationNoticeSetting/
  16. public IParameterServices parameterServices { get; set; }
  17. [HttpGet]
  18. public ActionResult List()
  19. {
  20. ExaminationNoticeSettingView examinationNoticeSettingView = new ExaminationNoticeSettingView();
  21. var notice=parameterServices.GetParameterValue(CF_ParameterType.ExaminationNotice);
  22. examinationNoticeSettingView.Notice = notice;
  23. return View(examinationNoticeSettingView);
  24. }
  25. /// <summary>
  26. /// 保存
  27. /// </summary>
  28. /// <param name="pararms"></param>
  29. /// <returns></returns>
  30. [HttpPost]
  31. public ActionResult List(ExaminationNoticeSettingView examinationNoticeSettingView)
  32. {
  33. try
  34. {
  35. parameterServices.SaveTo(ViewModel.CF_ParameterType.ExaminationNotice, examinationNoticeSettingView.Notice);
  36. return Json(new ReturnMessage()
  37. {
  38. IsSuccess = true,
  39. Message = "保存成功!"
  40. });
  41. }
  42. catch (Exception ex)
  43. {
  44. return Json(new ReturnMessage()
  45. {
  46. IsSuccess = true,
  47. Message = "保存失败,原因:" + ex.Message + "!"
  48. });
  49. }
  50. }
  51. }
  52. }