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.
 
 
 
 
 
 

163 lines
4.6 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Data;
  4. using System.Collections.Generic;
  5. namespace Learun.Application.Base.CodeSchemaModule
  6. {
  7. /// <summary>
  8. /// 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架
  9. /// Copyright (c) 2013-2018 上海力软信息技术有限公司
  10. /// 创 建:超级管理员
  11. /// 日 期:2019-03-01 11:09
  12. /// 描 述:代码模板
  13. /// </summary>
  14. public class CodeSchemaBLL : CodeSchemaIBLL
  15. {
  16. private CodeSchemaService codeSchemaService = new CodeSchemaService();
  17. #region 获取数据
  18. /// <summary>
  19. /// 获取页面显示列表数据
  20. /// </summary>
  21. /// <param name="pagination">分页参数</param>
  22. /// <param name="queryJson">查询参数</param>
  23. /// <returns></returns>
  24. public IEnumerable<LR_Base_CodeSchemaEntity> GetPageList(Pagination pagination, string queryJson)
  25. {
  26. try
  27. {
  28. return codeSchemaService.GetPageList(pagination, queryJson);
  29. }
  30. catch (Exception ex)
  31. {
  32. if (ex is ExceptionEx)
  33. {
  34. throw;
  35. }
  36. else
  37. {
  38. throw ExceptionEx.ThrowBusinessException(ex);
  39. }
  40. }
  41. }
  42. /// <summary>
  43. /// 获取LR_Base_CodeSchema表实体数据
  44. /// </summary>
  45. /// <param name="keyValue">主键</param>
  46. /// <returns></returns>
  47. public LR_Base_CodeSchemaEntity GetLR_Base_CodeSchemaEntity(string keyValue)
  48. {
  49. try
  50. {
  51. return codeSchemaService.GetLR_Base_CodeSchemaEntity(keyValue);
  52. }
  53. catch (Exception ex)
  54. {
  55. if (ex is ExceptionEx)
  56. {
  57. throw;
  58. }
  59. else
  60. {
  61. throw ExceptionEx.ThrowBusinessException(ex);
  62. }
  63. }
  64. }
  65. /// <summary>
  66. /// 获取左侧树形数据
  67. /// </summary>
  68. /// <returns></returns>
  69. public List<TreeModel> GetTree()
  70. {
  71. try
  72. {
  73. DataTable list = codeSchemaService.GetSqlTree();
  74. List<TreeModel> treeList = new List<TreeModel>();
  75. foreach (DataRow item in list.Rows)
  76. {
  77. TreeModel node = new TreeModel
  78. {
  79. id = item["f_itemdetailid"].ToString(),
  80. text = item["f_itemname"].ToString(),
  81. value = item["f_itemdetailid"].ToString(),
  82. showcheck = false,
  83. checkstate = 0,
  84. isexpand = true,
  85. parentId = item["f_parentid"].ToString()
  86. };
  87. treeList.Add(node); }
  88. return treeList.ToTree();
  89. }
  90. catch (Exception ex)
  91. {
  92. if (ex is ExceptionEx)
  93. {
  94. throw;
  95. }
  96. else
  97. {
  98. throw ExceptionEx.ThrowBusinessException(ex);
  99. }
  100. }
  101. }
  102. #endregion
  103. #region 提交数据
  104. /// <summary>
  105. /// 删除实体数据
  106. /// </summary>
  107. /// <param name="keyValue">主键</param>
  108. public void DeleteEntity(string keyValue)
  109. {
  110. try
  111. {
  112. codeSchemaService.DeleteEntity(keyValue);
  113. }
  114. catch (Exception ex)
  115. {
  116. if (ex is ExceptionEx)
  117. {
  118. throw;
  119. }
  120. else
  121. {
  122. throw ExceptionEx.ThrowBusinessException(ex);
  123. }
  124. }
  125. }
  126. /// <summary>
  127. /// 保存实体数据(新增、修改)
  128. /// </summary>
  129. /// <param name="keyValue">主键</param>
  130. /// <param name="entity">实体</param>
  131. public void SaveEntity(string keyValue, LR_Base_CodeSchemaEntity entity)
  132. {
  133. try
  134. {
  135. codeSchemaService.SaveEntity(keyValue, entity);
  136. }
  137. catch (Exception ex)
  138. {
  139. if (ex is ExceptionEx)
  140. {
  141. throw;
  142. }
  143. else
  144. {
  145. throw ExceptionEx.ThrowBusinessException(ex);
  146. }
  147. }
  148. }
  149. #endregion
  150. }
  151. }