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 { /// /// 提现申请的业务逻辑类 /// public class Pay_CashApplyBLL { IPay_CashApplyDAL _IPay_CashApplyDal = null; /// /// 初始化构造 /// public Pay_CashApplyBLL() { //获取Pay_CashApply DAL实现 _IPay_CashApplyDal = Factory.GetDALByInterfaceName(DALInterface.IPay_CashApplyDAL) as IPay_CashApplyDAL; } /// /// 新增提现申请 /// /// /// public bool InsertModel(CY.Model.Pay_CashApply m_Pay_CashApply) { try { return _IPay_CashApplyDal.InserModel(m_Pay_CashApply); } catch (Exception ex) { throw ex; } } /// /// 修改提现申请 /// /// /// public bool UpdateModel(CY.Model.Pay_CashApply m_Pay_CashApply) { try { return _IPay_CashApplyDal.UpdateModel(m_Pay_CashApply); } catch (Exception ex) { throw ex; } } /// /// 删除提现申请 /// /// /// public bool DeleteModel(CY.Model.Pay_CashApply rType) { try { _IPay_CashApplyDal.DeleteModel(rType); } catch (Exception ex) { throw ex; } return true; } /// /// 查询提现记录分页列表,AccountId为0时查询所有 /// /// /// /// public IEnumerable 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 criterias = new List() { new Criterion("", condition), new Criterion("orderBy"," Keyid DESC ") }; query.Criteria = criterias; return _IPay_CashApplyDal.SelectModelPage(query, pa); } /// /// 根据条件查询提现记录 /// /// /// /// /// /// /// /// /// public IEnumerable 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); } /// /// 根据会员ID查询提现申请列表 /// /// /// public List GetModelListByMemberId(Guid MemberId) { return _IPay_CashApplyDal.SelectAllModelByMemberId(MemberId); } /// /// 获取单个提现申请 /// /// 主键id /// 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;//返回结果 } /// /// 处理提现 /// /// /// /// 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); } } }