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
{
///
/// 授信规则的业务逻辑类
///
public class Pay_CreditLineLevelRuleBLL
{
IPay_CreditLineLevelRuleDAL _IPay_CreditLineLevelRuleDal = null;
///
/// 初始化构造
///
public Pay_CreditLineLevelRuleBLL()
{
//获取Pay_CreditLineLevelRule DAL实现
_IPay_CreditLineLevelRuleDal = Factory.GetDALByInterfaceName(DALInterface.IPay_CreditLineLevelRuleDAL) as IPay_CreditLineLevelRuleDAL;
}
///
/// 新增授信规则
///
///
///
public bool InsertModel(CY.Model.Pay_CreditLineLevelRule rType)
{
try
{
_IPay_CreditLineLevelRuleDal.InserModel(rType);
}
catch (Exception ex)
{
throw ex;
}
return true;
}
///
/// 修改授信规则
///
///
///
public bool UpdateModel(CY.Model.Pay_CreditLineLevelRule rType)
{
try
{
_IPay_CreditLineLevelRuleDal.UpdateModel(rType);
}
catch (Exception ex)
{
throw ex;
}
return true;
}
///
/// 删除授信规则
///
///
///
public bool DeleteModel(CY.Model.Pay_CreditLineLevelRule rType)
{
try
{
_IPay_CreditLineLevelRuleDal.DeleteModel(rType);
}
catch (Exception ex)
{
throw ex;
}
return true;
}
///
/// 查询规则分页列表
///
///
///
public IEnumerable GetModelPageList(Pagination pa)
{
Query query = new Query();
IList criterias = new List()
{
new Criterion(""," "),
new Criterion("orderBy","t.Keyid,Keyid"),
};
query.Criteria = criterias;
return _IPay_CreditLineLevelRuleDal.SelectModelPage(query, pa);
}
///
/// 获取全部规则
///
/// 主键id
///
public IEnumerable GetModelList()
{
Query query = new Query();
return _IPay_CreditLineLevelRuleDal.SelectAllModel(query);
}
///
/// 获取单个规则
///
/// 主键id
///
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;//返回结果
}
///
/// 获取单个规则名称
///
/// 主键id
///
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;//返回结果
}
}
}