using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using CY.IDAL;
|
using CY.Model;
|
using AbstractFactory;
|
using CY.IBaseDAL;
|
using CY.Infrastructure.DESEncrypt;
|
using CY.Infrastructure.Query;
|
namespace CY.BLL
|
{
|
/// <summary>
|
/// 授信规则的业务逻辑类
|
/// </summary>
|
public class Pay_CreditLineLevelRuleBLL
|
{
|
IPay_CreditLineLevelRuleDAL _IPay_CreditLineLevelRuleDal = null;
|
/// <summary>
|
/// 初始化构造
|
/// </summary>
|
public Pay_CreditLineLevelRuleBLL()
|
{
|
//获取Pay_CreditLineLevelRule DAL实现
|
_IPay_CreditLineLevelRuleDal = Factory.GetDALByInterfaceName(DALInterface.IPay_CreditLineLevelRuleDAL) as IPay_CreditLineLevelRuleDAL;
|
}
|
/// <summary>
|
/// 新增授信规则
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool InsertModel(CY.Model.Pay_CreditLineLevelRule rType)
|
{
|
try
|
{
|
_IPay_CreditLineLevelRuleDal.InserModel(rType);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
/// <summary>
|
/// 修改授信规则
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool UpdateModel(CY.Model.Pay_CreditLineLevelRule rType)
|
{
|
try
|
{
|
_IPay_CreditLineLevelRuleDal.UpdateModel(rType);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
|
/// <summary>
|
/// 删除授信规则
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool DeleteModel(CY.Model.Pay_CreditLineLevelRule rType)
|
{
|
try
|
{
|
_IPay_CreditLineLevelRuleDal.DeleteModel(rType);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
|
/// <summary>
|
/// 查询规则分页列表
|
/// </summary>
|
/// <param name="pa"></param>
|
/// <returns></returns>
|
public IEnumerable<Pay_CreditLineLevelRule> GetModelPageList(Pagination pa)
|
{
|
Query query = new Query();
|
IList<Criterion> criterias = new List<Criterion>()
|
{
|
new Criterion(""," "),
|
new Criterion("orderBy","t.Keyid,Keyid"),
|
};
|
query.Criteria = criterias;
|
return _IPay_CreditLineLevelRuleDal.SelectModelPage(query, pa);
|
}
|
|
/// <summary>
|
/// 获取全部规则
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public IEnumerable<Pay_CreditLineLevelRule> GetModelList()
|
{
|
Query query = new Query();
|
return _IPay_CreditLineLevelRuleDal.SelectAllModel(query);
|
}
|
|
/// <summary>
|
/// 获取单个规则
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public Pay_CreditLineLevelRule GetModel(int? Keyid)
|
{
|
Pay_CreditLineLevelRule result = null;
|
try
|
{
|
result = _IPay_CreditLineLevelRuleDal.SelectModelByKeyid(Keyid) as Pay_CreditLineLevelRule;//执行查询
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return result;//返回结果
|
}
|
|
/// <summary>
|
/// 获取单个规则名称
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public string GetModelName(int? Keyid)
|
{
|
Pay_CreditLineLevelRule result = null;
|
try
|
{
|
result = _IPay_CreditLineLevelRuleDal.SelectModelByKeyid(Keyid) as Pay_CreditLineLevelRule;//执行查询
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return result==null?"":result.LevelName;//返回结果
|
}
|
}
|
}
|