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.
 
 
 
 
 
 

190 lines
5.2 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 11:30
  11. /// 描 述:商机管理
  12. /// </summary>
  13. public class CrmChanceBLL : CrmChanceIBLL
  14. {
  15. private CrmChanceService crmChanceService = new CrmChanceService();
  16. #region 获取数据
  17. /// <summary>
  18. /// 获取列表
  19. /// </summary>
  20. /// <param name="pagination">分页</param>
  21. /// <param name="queryJson">查询参数</param>
  22. /// <returns>返回分页列表</returns>
  23. public IEnumerable<CrmChanceEntity> GetPageList(Pagination pagination, string queryJson)
  24. {
  25. try
  26. {
  27. return crmChanceService.GetPageList(pagination, queryJson);
  28. }
  29. catch (Exception ex)
  30. {
  31. if (ex is ExceptionEx)
  32. {
  33. throw;
  34. }
  35. else
  36. {
  37. throw ExceptionEx.ThrowBusinessException(ex);
  38. }
  39. }
  40. }
  41. /// <summary>
  42. /// 获取实体
  43. /// </summary>
  44. /// <param name="keyValue">主键值</param>
  45. /// <returns></returns>
  46. public CrmChanceEntity GetEntity(string keyValue)
  47. {
  48. try
  49. {
  50. return crmChanceService.GetEntity(keyValue);
  51. }
  52. catch (Exception ex)
  53. {
  54. if (ex is ExceptionEx)
  55. {
  56. throw;
  57. }
  58. else
  59. {
  60. throw ExceptionEx.ThrowBusinessException(ex);
  61. }
  62. }
  63. }
  64. #endregion
  65. #region 验证数据
  66. /// <summary>
  67. /// 商机名称不能重复
  68. /// </summary>
  69. /// <param name="fullName">名称</param>
  70. /// <param name="keyValue">主键</param>
  71. /// <returns></returns>
  72. public bool ExistFullName(string fullName, string keyValue)
  73. {
  74. try
  75. {
  76. return crmChanceService.ExistFullName(fullName, keyValue);
  77. }
  78. catch (Exception ex)
  79. {
  80. if (ex is ExceptionEx)
  81. {
  82. throw;
  83. }
  84. else
  85. {
  86. throw ExceptionEx.ThrowBusinessException(ex);
  87. }
  88. }
  89. }
  90. #endregion
  91. #region 提交数据
  92. /// <summary>
  93. /// 删除数据
  94. /// </summary>
  95. /// <param name="keyValue">主键</param>
  96. public void DeleteEntity(string keyValue)
  97. {
  98. try
  99. {
  100. crmChanceService.DeleteEntity(keyValue);
  101. }
  102. catch (Exception ex)
  103. {
  104. if (ex is ExceptionEx)
  105. {
  106. throw;
  107. }
  108. else
  109. {
  110. throw ExceptionEx.ThrowBusinessException(ex);
  111. }
  112. }
  113. }
  114. /// <summary>
  115. /// 保存表单(新增、修改)
  116. /// </summary>
  117. /// <param name="keyValue">主键值</param>
  118. /// <param name="entity">实体对象</param>
  119. /// <returns></returns>
  120. public void SaveEntity(string keyValue, CrmChanceEntity entity)
  121. {
  122. try
  123. {
  124. crmChanceService.SaveEntity(keyValue, entity);
  125. }
  126. catch (Exception ex)
  127. {
  128. if (ex is ExceptionEx)
  129. {
  130. throw;
  131. }
  132. else
  133. {
  134. throw ExceptionEx.ThrowBusinessException(ex);
  135. }
  136. }
  137. }
  138. /// <summary>
  139. /// 商机作废
  140. /// </summary>
  141. /// <param name="keyValue">主键值</param>
  142. public void Invalid(string keyValue)
  143. {
  144. try
  145. {
  146. crmChanceService.Invalid(keyValue);
  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. /// <summary>
  161. /// 商机转换客户
  162. /// </summary>
  163. /// <param name="keyValue">主键</param>
  164. /// <param name="customerCode">客户编号</param>
  165. public void ToCustomer(string keyValue, string customerCode)
  166. {
  167. try
  168. {
  169. crmChanceService.ToCustomer(keyValue, customerCode);
  170. }
  171. catch (Exception ex)
  172. {
  173. if (ex is ExceptionEx)
  174. {
  175. throw;
  176. }
  177. else
  178. {
  179. throw ExceptionEx.ThrowBusinessException(ex);
  180. }
  181. }
  182. }
  183. #endregion
  184. }
  185. }