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.
 
 
 
 
 
 

167 lines
4.5 KiB

  1. using Learun.Util;
  2. using System;
  3. using System.Collections.Generic;
  4. namespace Learun.Application.CRM
  5. {
  6. /// <summary>
  7. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  8. /// Copyright (c) 2013-2018 北京泉江科技有限公司
  9. /// 创 建:超级管理员
  10. /// 日 期:2017-07-11 09:43
  11. /// 描 述:客户管理
  12. /// </summary>
  13. public class CrmCustomerBLL : CrmCustomerIBLL
  14. {
  15. private CrmCustomerService crmCustomerService = new CrmCustomerService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 获取列表
  19. /// </summary>
  20. /// <returns></returns>
  21. public IEnumerable<CrmCustomerEntity> GetList()
  22. {
  23. try
  24. {
  25. return crmCustomerService.GetList();
  26. }
  27. catch (Exception ex)
  28. {
  29. if (ex is ExceptionEx)
  30. {
  31. throw;
  32. }
  33. else
  34. {
  35. throw ExceptionEx.ThrowBusinessException(ex);
  36. }
  37. }
  38. }
  39. /// <summary>
  40. /// 获取列表
  41. /// </summary>
  42. /// <param name="pagination">分页</param>
  43. /// <param name="queryJson">查询参数</param>
  44. /// <returns>返回分页列表</returns>
  45. public IEnumerable<CrmCustomerEntity> GetPageList(Pagination pagination, string queryJson)
  46. {
  47. try
  48. {
  49. return crmCustomerService.GetPageList(pagination, queryJson);
  50. }
  51. catch (Exception ex)
  52. {
  53. if (ex is ExceptionEx)
  54. {
  55. throw;
  56. }
  57. else
  58. {
  59. throw ExceptionEx.ThrowBusinessException(ex);
  60. }
  61. }
  62. }
  63. /// <summary>
  64. /// 获取实体
  65. /// </summary>
  66. /// <param name="keyValue">主键值</param>
  67. /// <returns></returns>
  68. public CrmCustomerEntity GetEntity(string keyValue)
  69. {
  70. try
  71. {
  72. return crmCustomerService.GetEntity(keyValue);
  73. }
  74. catch (Exception ex)
  75. {
  76. if (ex is ExceptionEx)
  77. {
  78. throw;
  79. }
  80. else
  81. {
  82. throw ExceptionEx.ThrowBusinessException(ex);
  83. }
  84. }
  85. }
  86. #endregion
  87. #region 验证数据
  88. /// <summary>
  89. /// 客户名称不能重复
  90. /// </summary>
  91. /// <param name="fullName">名称</param>
  92. /// <param name="keyValue">主键</param>
  93. /// <returns></returns>
  94. public bool ExistFullName(string fullName, string keyValue)
  95. {
  96. try
  97. {
  98. return crmCustomerService.ExistFullName(fullName, keyValue);
  99. }
  100. catch (Exception ex)
  101. {
  102. if (ex is ExceptionEx)
  103. {
  104. throw;
  105. }
  106. else
  107. {
  108. throw ExceptionEx.ThrowBusinessException(ex);
  109. }
  110. }
  111. }
  112. #endregion
  113. #region 提交数据
  114. /// <summary>
  115. /// 删除数据
  116. /// </summary>
  117. /// <param name="keyValue">主键</param>
  118. public void DeleteEntity(string keyValue)
  119. {
  120. try
  121. {
  122. crmCustomerService.DeleteEntity(keyValue);
  123. }
  124. catch (Exception ex)
  125. {
  126. if (ex is ExceptionEx)
  127. {
  128. throw;
  129. }
  130. else
  131. {
  132. throw ExceptionEx.ThrowBusinessException(ex);
  133. }
  134. }
  135. }
  136. /// <summary>
  137. /// 保存表单(新增、修改)
  138. /// </summary>
  139. /// <param name="keyValue">主键值</param>
  140. /// <param name="entity">实体对象</param>
  141. /// <returns></returns>
  142. public void SaveEntity(string keyValue, CrmCustomerEntity entity)
  143. {
  144. try
  145. {
  146. crmCustomerService.SaveEntity(keyValue, entity);
  147. }
  148. catch (Exception ex)
  149. {
  150. if (ex is ExceptionEx)
  151. {
  152. throw;
  153. }
  154. else
  155. {
  156. throw ExceptionEx.ThrowBusinessException(ex);
  157. }
  158. }
  159. }
  160. #endregion
  161. }
  162. }