username@email.com
2025-05-14 99ddfbcecf0fa2881eb3a91028257eef87dab6de
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL;
using CY.Model;
using CY.Infrastructure.Query;
using CY.Infrastructure.Common;
using CY.BLL.Sys;
using CY.Config;
 
namespace CY.WebForm.Pages.pay
{
    //吴辉
    //新增/修改银行卡信息
    public partial class BankInfoEdit : BasePage
    {
        Pay_BankInfoBLL bll_Pay_BankInfoBLL = null;
 
        //初始化
        public BankInfoEdit()
        {
            bll_Pay_BankInfoBLL = new Pay_BankInfoBLL();
        }
 
        //页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request["Keyid"] != null)
                {
                    Pay_BankInfo m_Pay_BankInfo = bll_Pay_BankInfoBLL.GetModel(Request["Keyid"].ToInt32());
                    this.txtBankName.Value = m_Pay_BankInfo.BankName.ToString2();
                    this.txtBankNum.Value = m_Pay_BankInfo.BankNum.ToString2();
                    this.txtCardholder.Value = m_Pay_BankInfo.Cardholder.ToString2();
                }
            }
        }
 
        //提交事件
        protected void btn_Submit_Config(object sender, EventArgs e)
        {
            Pay_BankInfo m_Pay_BankInfo = new Pay_BankInfo();
            Guid NewGuid = Guid.NewGuid();
            try
            {
                if (Request["Keyid"] != null)
                    m_Pay_BankInfo = bll_Pay_BankInfoBLL.GetModel(Request["Keyid"].ToInt32());
 
                m_Pay_BankInfo.BankName = this.txtBankName.Value.ToString2();
                m_Pay_BankInfo.BankNum=this.txtBankNum.Value.ToString2();
                m_Pay_BankInfo.Cardholder=this.txtCardholder.Value.ToString2();
                m_Pay_BankInfo.BankTypeId = 0;
                m_Pay_BankInfo.Remark = "";
                m_Pay_BankInfo.LastUpdateTime = DateTime.Now;
                m_Pay_BankInfo.Operator = CurrentUser.ShortName;
 
                #region 添加或编辑
 
                if (Request["Keyid"] != null)
                {
                    bool result = bll_Pay_BankInfoBLL.UpdateModel(m_Pay_BankInfo);//更新信息
                    if (result)
                        JavaScript.RefreshDIVOpener(this);
                    else
                        JavaScript.MessageBox("操作失败", this);
                }
                else
                {
                    int MyCount = bll_Pay_BankInfoBLL.GetModelListByMemberId(CurrentUser.MemberId).Count;
                    if (MyCount >= WebInfo.Instance.BankInfoNumber.ToInt32())
                        JavaScript.MessageBox("最大可设置银行卡数为" + WebInfo.Instance.BankInfoNumber + "条", this);
                    else
                    {
                        m_Pay_BankInfo.MemberId = CurrentUser.MemberId;
                        bool result = bll_Pay_BankInfoBLL.InsertModel(m_Pay_BankInfo);//添加信息
                        if (result)
                            JavaScript.MessageBox("添加成功", this, "top.frmright.ReLoad();top.Dialog.close();");
                        else
                            JavaScript.MessageBox("添加失败", this);
                    }
                }
                #endregion
            }
            catch (Exception ex)
            {
                PAGEHandleException(ex);
                throw ex;
            }
        }
 
    }
}