username@email.com
2025-05-21 a980cd04341d71216e0f59bd4b7327fe9fc50032
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
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);
        }
    }
}