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.
 
 
 
 
 
 

121 lines
3.8 KiB

  1. using Learun.Application.WorkFlow;
  2. using Learun.Util;
  3. using System.Web.Mvc;
  4. namespace Learun.Application.Web.Areas.LR_NewWorkFlow.Controllers
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架
  8. /// Copyright (c) 2013-2018 上海力软信息技术有限公司
  9. /// 创建人:力软-框架开发组
  10. /// 日 期:2018.12.07
  11. /// 描 述:流程委托
  12. /// </summary>
  13. public class NWFDelegateController : MvcControllerBase
  14. {
  15. private NWFDelegateIBLL nWFDelegateIBLL = new NWFDelegateBLL();
  16. #region 视图功能
  17. /// <summary>
  18. /// 管理界面
  19. /// </summary>
  20. /// <returns></returns>
  21. [HttpGet]
  22. public ActionResult Index()
  23. {
  24. return View();
  25. }
  26. /// <summary>
  27. /// 表单页面
  28. /// </summary>
  29. /// <returns></returns>
  30. [HttpGet]
  31. public ActionResult Form()
  32. {
  33. return View();
  34. }
  35. #endregion
  36. #region 获取数据
  37. /// <summary>
  38. /// 获取分页数据
  39. /// </summary>
  40. /// <param name="pagination">分页参数</param>
  41. /// <param name="keyword">关键字</param>
  42. /// <returns></returns>
  43. [HttpGet]
  44. [AjaxOnly]
  45. public ActionResult GetPageList(string pagination, string keyword)
  46. {
  47. UserInfo userInfo = LoginUserInfo.Get();
  48. Pagination paginationobj = pagination.ToObject<Pagination>();
  49. var data = nWFDelegateIBLL.GetPageList(paginationobj, keyword, userInfo);
  50. var jsonData = new
  51. {
  52. rows = data,
  53. total = paginationobj.total,
  54. page = paginationobj.page,
  55. records = paginationobj.records,
  56. };
  57. return Success(jsonData);
  58. }
  59. /// <summary>
  60. /// 获取关联模板数据
  61. /// </summary>
  62. /// <param name="keyValue">主键</param>
  63. /// <returns></returns>
  64. [HttpGet]
  65. [AjaxOnly]
  66. public ActionResult GetRelationList(string keyValue)
  67. {
  68. var relationList = nWFDelegateIBLL.GetRelationList(keyValue);
  69. return Success(relationList);
  70. }
  71. #endregion
  72. #region 提交数据
  73. /// <summary>
  74. /// 保存委托信息
  75. /// </summary>
  76. /// <param name="keyValue">主键</param>
  77. /// <param name="strEntity">委托信息实体</param>
  78. /// <param name="strSchemeInfo">模板信息</param>
  79. /// <returns></returns>
  80. [HttpPost]
  81. [ValidateAntiForgeryToken]
  82. [AjaxOnly]
  83. public ActionResult SaveForm(string keyValue, string strEntity, string strSchemeInfo)
  84. {
  85. NWFDelegateRuleEntity entity = strEntity.ToObject<NWFDelegateRuleEntity>();
  86. nWFDelegateIBLL.SaveEntity(keyValue, entity, strSchemeInfo.Split(','));
  87. return Success("保存成功!");
  88. }
  89. /// <summary>
  90. /// 删除模板数据
  91. /// </summary>
  92. /// <param name="keyValue">主键</param>
  93. /// <returns></returns>
  94. [HttpPost]
  95. [AjaxOnly]
  96. public ActionResult DeleteForm(string keyValue)
  97. {
  98. nWFDelegateIBLL.DeleteEntity(keyValue);
  99. return Success("删除成功!");
  100. }
  101. /// <summary>
  102. /// 启用/停用表单
  103. /// </summary>
  104. /// <param name="keyValue">主键</param>
  105. /// <param name="state">状态1启用0禁用</param>
  106. /// <returns></returns>
  107. [HttpPost]
  108. [AjaxOnly]
  109. public ActionResult UpDateSate(string keyValue, int state)
  110. {
  111. nWFDelegateIBLL.UpdateState(keyValue, state);
  112. return Success((state == 1 ? "启用" : "禁用") + "成功!");
  113. }
  114. #endregion
  115. }
  116. }