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; } } } }