using Learun.Util;
using System;
using System.Collections.Generic;
namespace Learun.Application.CRM
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2017-07-11 11:30
/// 描 述:商机管理
///
public class CrmChanceBLL : CrmChanceIBLL
{
private CrmChanceService crmChanceService = new CrmChanceService();
#region 获取数据
///
/// 获取列表
///
/// 分页
/// 查询参数
/// 返回分页列表
public IEnumerable GetPageList(Pagination pagination, string queryJson)
{
try
{
return crmChanceService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
///
/// 获取实体
///
/// 主键值
///
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 验证数据
///
/// 商机名称不能重复
///
/// 名称
/// 主键
///
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 提交数据
///
/// 删除数据
///
/// 主键
public void DeleteEntity(string keyValue)
{
try
{
crmChanceService.DeleteEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
///
/// 保存表单(新增、修改)
///
/// 主键值
/// 实体对象
///
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);
}
}
}
///
/// 商机作废
///
/// 主键值
public void Invalid(string keyValue)
{
try
{
crmChanceService.Invalid(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
///
/// 商机转换客户
///
/// 主键
/// 客户编号
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
}
}