You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

114 lines
3.3 KiB

  1. using Learun.Util;
  2. using System.Data;
  3. using System.Web.Mvc;
  4. using System.Collections.Generic;
  5. using Learun.Application.TwoDevelopment.EvaluationTeach;
  6. namespace Learun.Application.Web.Areas.EvaluationTeach.Controllers
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  11. /// 创 建:超级管理员
  12. /// 日 期:2019-04-23 15:59
  13. /// 描 述:问卷题目管理
  14. /// </summary>
  15. public class Eval_QuestionController : MvcControllerBase
  16. {
  17. private Eval_QuestionIBLL ask_QuestionIBLL = new Eval_QuestionBLL();
  18. #region 视图功能
  19. /// <summary>
  20. /// 主页面
  21. /// <summary>
  22. /// <returns></returns>
  23. [HttpGet]
  24. public ActionResult Index()
  25. {
  26. return View();
  27. }
  28. /// <summary>
  29. /// 表单页
  30. /// <summary>
  31. /// <returns></returns>
  32. [HttpGet]
  33. public ActionResult Form()
  34. {
  35. ViewBag.QSerial = "Question_" + CommonHelper.CreateNo();
  36. return View();
  37. }
  38. #endregion
  39. #region 获取数据
  40. /// <summary>
  41. /// 获取页面显示列表数据
  42. /// <summary>
  43. /// <param name="queryJson">查询参数</param>
  44. /// <returns></returns>
  45. [HttpGet]
  46. [AjaxOnly]
  47. public ActionResult GetPageList(string pagination, string queryJson)
  48. {
  49. Pagination paginationobj = pagination.ToObject<Pagination>();
  50. var data = ask_QuestionIBLL.GetPageList(paginationobj, queryJson);
  51. var jsonData = new
  52. {
  53. rows = data,
  54. total = paginationobj.total,
  55. page = paginationobj.page,
  56. records = paginationobj.records
  57. };
  58. return Success(jsonData);
  59. }
  60. /// <summary>
  61. /// 获取表单数据
  62. /// <summary>
  63. /// <returns></returns>
  64. [HttpGet]
  65. [AjaxOnly]
  66. public ActionResult GetFormData(string keyValue)
  67. {
  68. var Eval_QuestionData = ask_QuestionIBLL.GetEval_QuestionEntity(keyValue);
  69. var jsonData = new
  70. {
  71. Eval_Question = Eval_QuestionData,
  72. };
  73. return Success(jsonData);
  74. }
  75. #endregion
  76. #region 提交数据
  77. /// <summary>
  78. /// 删除实体数据
  79. /// <param name="keyValue">主键</param>
  80. /// <summary>
  81. /// <returns></returns>
  82. [HttpPost]
  83. [AjaxOnly]
  84. public ActionResult DeleteForm(string keyValue)
  85. {
  86. ask_QuestionIBLL.DeleteEntity(keyValue);
  87. return Success("删除成功!");
  88. }
  89. /// <summary>
  90. /// 保存实体数据(新增、修改)
  91. /// <param name="keyValue">主键</param>
  92. /// <summary>
  93. /// <returns></returns>
  94. [HttpPost]
  95. [ValidateAntiForgeryToken]
  96. [AjaxOnly]
  97. public ActionResult SaveForm(string keyValue, string strEntity)
  98. {
  99. Eval_QuestionEntity entity = strEntity.ToObject<Eval_QuestionEntity>();
  100. ask_QuestionIBLL.SaveEntity(keyValue, entity);
  101. return Success("保存成功!");
  102. }
  103. #endregion
  104. }
  105. }