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;
|
using CY.Model.Pay;
|
namespace CY.BLL
|
{
|
/// <summary>
|
/// 提现申请的业务逻辑类
|
/// </summary>
|
public class Pay_CashApplyBLL
|
{
|
IPay_CashApplyDAL _IPay_CashApplyDal = null;
|
|
/// <summary>
|
/// 初始化构造
|
/// </summary>
|
public Pay_CashApplyBLL()
|
{
|
//获取Pay_CashApply DAL实现
|
_IPay_CashApplyDal = Factory.GetDALByInterfaceName(DALInterface.IPay_CashApplyDAL) as IPay_CashApplyDAL;
|
}
|
|
/// <summary>
|
/// 新增提现申请
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool InsertModel(CY.Model.Pay_CashApply m_Pay_CashApply)
|
{
|
try
|
{
|
return _IPay_CashApplyDal.InserModel(m_Pay_CashApply);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 修改提现申请
|
/// </summary>
|
/// <param name="m_Pay_CashApply"></param>
|
/// <returns></returns>
|
public bool UpdateModel(CY.Model.Pay_CashApply m_Pay_CashApply)
|
{
|
try
|
{
|
return _IPay_CashApplyDal.UpdateModel(m_Pay_CashApply);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
}
|
|
/// <summary>
|
/// 删除提现申请
|
/// </summary>
|
/// <param name="rType"></param>
|
/// <returns></returns>
|
public bool DeleteModel(CY.Model.Pay_CashApply rType)
|
{
|
try
|
{
|
_IPay_CashApplyDal.DeleteModel(rType);
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return true;
|
}
|
|
/// <summary>
|
/// 查询提现记录分页列表,AccountId为0时查询所有
|
/// </summary>
|
/// <param name="pa"></param>
|
/// <param name="AccountId"></param>
|
/// <returns></returns>
|
public IEnumerable<Pay_CashApply> GetModelPageList(Pagination pa, int? AccountId,bool? IsProxy)
|
{
|
string condition = " ";
|
if (AccountId > 0)
|
condition += " and Payid ='" + AccountId + "'";
|
|
if (IsProxy != null)
|
{
|
if (IsProxy == true)
|
{
|
condition += " and ( CashTypeId='2' or CashTypeId ='3' )";
|
}
|
else
|
{
|
condition += " and ( CashTypeId='0' or CashTypeId ='1' )";
|
}
|
}
|
|
Query query = new Query();
|
IList<Criterion> criterias = new List<Criterion>()
|
{
|
new Criterion("", condition),
|
|
new Criterion("orderBy"," Keyid DESC ")
|
};
|
query.Criteria = criterias;
|
return _IPay_CashApplyDal.SelectModelPage(query, pa);
|
}
|
|
/// <summary>
|
/// 根据条件查询提现记录
|
/// </summary>
|
/// <param name="pa"></param>
|
/// <param name="cashTypeId"></param>
|
/// <param name="startDate"></param>
|
/// <param name="endDate"></param>
|
/// <param name="province"></param>
|
/// <param name="city"></param>
|
/// <param name="country"></param>
|
/// <returns></returns>
|
public IEnumerable<Pay_CashApply> GetModelPageList(Pagination pa, int cashTypeId, string startDate, string endDate, string province, string city, string country)
|
{
|
return _IPay_CashApplyDal.GetModelPageList(pa, cashTypeId, startDate, endDate, province, city, country);
|
}
|
|
/// <summary>
|
/// 根据会员ID查询提现申请列表
|
/// </summary>
|
/// <param name="MemberId"></param>
|
/// <returns></returns>
|
public List<Pay_CashApply> GetModelListByMemberId(Guid MemberId)
|
{
|
return _IPay_CashApplyDal.SelectAllModelByMemberId(MemberId);
|
}
|
|
/// <summary>
|
/// 获取单个提现申请
|
/// </summary>
|
/// <param name="Keyid">主键id</param>
|
/// <returns></returns>
|
public Pay_CashApply GetModel(int? Keyid)
|
{
|
Pay_CashApply result = null;
|
try
|
{
|
result = _IPay_CashApplyDal.SelectModelByKeyid(Keyid) as Pay_CashApply;//执行查询
|
}
|
catch (Exception ex)
|
{
|
throw ex;
|
}
|
return result;//返回结果
|
}
|
|
/// <summary>
|
/// 处理提现
|
/// </summary>
|
/// <param name="m_Pay_CashApply"></param>
|
/// <param name="m_Pay_Request"></param>
|
/// <returns></returns>
|
public bool HandleCash(Pay_CashApply m_Pay_CashApply, Pay_Request m_Pay_Request, Pay_PromotionRecord m_Pay_PromotionRecord, Pay_PaymentAccount m_Pay_PaymentAccount)
|
{
|
return _IPay_CashApplyDal.HandleCash(m_Pay_CashApply, m_Pay_Request, m_Pay_PromotionRecord, m_Pay_PaymentAccount);
|
}
|
}
|
}
|