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.
 
 
 
 
 
 

125 lines
3.6 KiB

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