using System;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using BWP.B3QingDaoWanFu.BL;
|
|
using BWP.B3QingDaoWanFu.BO;
|
|
using BWP.BWPTrustPayClient.BO.NamedValueTemplate;
|
|
using BWP.BWPTrustPayClient.TrustPayRequests;
|
|
using BWP.Web.CustomPageLayout;
|
|
using BWP.Web.Layout;
|
|
using BWP.Web.WebControls;
|
|
using TSingSoft.WebControls2;
|
|
|
|
namespace BWP.Web.Pages.B3QingDaoWanFu.TrustPay_ {
|
|
class TrustPayEdit : BaseDmoEditPage<TrustPay, ITrustPayBL> {
|
|
protected override void OnLoad(EventArgs e) {
|
|
if (!IsPostBack && !String.IsNullOrEmpty(Request["MSG"])) {
|
|
var result = new B3PaymentResult(Request["MSG"]).Parse();
|
|
if (result.IsSuccess) {
|
|
mBL.ABCPaySuccess(Dmo);
|
|
AspUtil.AlertAndClose(this, "付款成功");
|
|
} else {
|
|
AspUtil.Alert(this, result.ErrorMessage);
|
|
}
|
|
}
|
|
base.OnLoad(e);
|
|
}
|
|
|
|
protected override void AddActions(ButtonGroup buttonGroup) {
|
|
//AddSaveAction(buttonGroup);
|
|
}
|
|
|
|
protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, PageLayoutSection pageLayoutSection) {
|
|
|
|
var layoutManager = new LayoutManager("", mDFInfo, mDFContainer);
|
|
layoutManager.Add("PayState", new DFValueLabel());
|
|
|
|
layoutManager.Add("Money", new DFTextBox());
|
|
|
|
layoutManager.Add("CreateTime", new DFValueLabel());
|
|
|
|
var config = new AutoLayoutConfig();
|
|
config.Add("AccountCustomer_ID");
|
|
config.Add("Money");
|
|
config.Add("PayState");
|
|
config.Add("CreateTime");
|
|
config.Add("Remark");
|
|
|
|
pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo);
|
|
|
|
layoutManager.Config = config;
|
|
titlePanel.Controls.Add(layoutManager.CreateLayout());
|
|
}
|
|
|
|
|
|
protected override void BuildBody(Control parent) {
|
|
base.BuildBody(parent);
|
|
|
|
AddAbcPay(parent);
|
|
|
|
}
|
|
|
|
public override void AppToUI() {
|
|
base.AppToUI();
|
|
mDFContainer.Readonly = !IsNew;
|
|
}
|
|
|
|
private void AddAbcPay(Control parent) {
|
|
|
|
var titlePanel = new TitlePanel("农行支付");
|
|
parent.Controls.Add(titlePanel);
|
|
|
|
var vPanel = new VLayoutPanel();
|
|
titlePanel.Controls.Add(vPanel);
|
|
|
|
|
|
var layoutManager = new LayoutManager("Pay", mDFInfo, mDFContainer);
|
|
|
|
|
|
var config = new AutoLayoutConfig() {
|
|
|
|
};
|
|
if (IsNew) {
|
|
vPanel.Add(new TSButton("新建付款", delegate {
|
|
mDFContainer.GetFromUI();
|
|
var id = mBL.CreateRequest(Dmo);
|
|
var url = AspUtil.AddParamToUrl(Request.RawUrl, "ID", id.ToString());
|
|
AspUtil.RedirectAndAlert(this, url, "新建付款成功");
|
|
}));
|
|
} else if (MinDmo.PayState == 付款状态.未付款) {
|
|
vPanel.Add(new TSButton("请求付款", delegate {
|
|
mBL.ABCPayRequest(Dmo);
|
|
AspUtil.RedirectAndAlert(this, Request.RawUrl, "请求付款成功");
|
|
}));
|
|
} else {
|
|
layoutManager.Add("ABCPay_No", new DFValueLabel());
|
|
var link = new HyperLink();
|
|
link.Target = "_blank";
|
|
link.Text = "前往支付";
|
|
link.NavigateUrl = MinDmo.ABCPay_PaymentURL;
|
|
|
|
|
|
layoutManager.Add("ABCPay_PaymentURL", link);
|
|
layoutManager["ABCPay_PaymentURL"].NoLabel = true;
|
|
|
|
config.Add("ABCPay_No");
|
|
config.Add("ABCPay_PaymentURL");
|
|
|
|
|
|
layoutManager.Config = config;
|
|
vPanel.Add(layoutManager.CreateLayout());
|
|
|
|
if (MinDmo.PayState == 付款状态.请求支付) {
|
|
vPanel.Add(new TSButton("完成付款", delegate {
|
|
mBL.ABCPaySuccess(Dmo);
|
|
AspUtil.RedirectAndAlert(this, Request.RawUrl, "完成付款成功");
|
|
}));
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|