192 lines
5.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Learun.Cache.Base;
using Learun.Cache.Factory;
using Learun.Util;
using System;
using System.Collections.Generic;
namespace Learun.Application.CRM
{
/// <summary>
/// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
/// Copyright (c) 2013-2018 勤一科技
/// 创 建:超级管理员
/// 日 期2017-07-11 11:30
/// 描 述:商机管理
/// </summary>
public class CrmChanceBLL : CrmChanceIBLL
{
private CrmChanceService crmChanceService = new CrmChanceService();
#region
/// <summary>
/// 获取列表
/// </summary>
/// <param name="pagination">分页</param>
/// <param name="queryJson">查询参数</param>
/// <returns>返回分页列表</returns>
public IEnumerable<CrmChanceEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return crmChanceService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 获取实体
/// </summary>
/// <param name="keyValue">主键值</param>
/// <returns></returns>
public CrmChanceEntity GetEntity(string keyValue)
{
try
{
return crmChanceService.GetEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
#region
/// <summary>
/// 商机名称不能重复
/// </summary>
/// <param name="fullName">名称</param>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public bool ExistFullName(string fullName, string keyValue)
{
try
{
return crmChanceService.ExistFullName(fullName, keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
#region
/// <summary>
/// 删除数据
/// </summary>
/// <param name="keyValue">主键</param>
public void DeleteEntity(string keyValue)
{
try
{
crmChanceService.DeleteEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 保存表单(新增、修改)
/// </summary>
/// <param name="keyValue">主键值</param>
/// <param name="entity">实体对象</param>
/// <returns></returns>
public void SaveEntity(string keyValue, CrmChanceEntity entity)
{
try
{
crmChanceService.SaveEntity(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 商机作废
/// </summary>
/// <param name="keyValue">主键值</param>
public void Invalid(string keyValue)
{
try
{
crmChanceService.Invalid(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
/// <summary>
/// 商机转换客户
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="customerCode">客户编号</param>
public void ToCustomer(string keyValue, string customerCode)
{
try
{
crmChanceService.ToCustomer(keyValue, customerCode);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion
}
}