protected void QueryGridView_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "refund")
{
int rowIndex = Convert.ToInt32(e.CommandArgument);
string billNo = bills[rowIndex].billNo;
int totalFee = bills[rowIndex].totalFee;
if (typeChannel == "Ali")
{
BCRefund refund = new BCRefund(billNo, DateTime.Today.ToString("yyyyMMdd") + BCUtil.GetUUID().Substring(0, 8), totalFee);
refund.channel = BCPay.RefundChannel.ALI.ToString();
try
{
refund = BCPay.BCRefundByChannel(refund);
Response.Redirect(refund.url);
}
catch (Exception excption)
{
Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
}
}
if (typeChannel == "WX")
{
BCRefund refund = new BCRefund(billNo, DateTime.Today.ToString("yyyyMMdd") + BCUtil.GetUUID().Substring(0, 8), totalFee);
refund.channel = BCPay.RefundChannel.WX.ToString();
try
{
refund = BCPay.BCRefundByChannel(refund);
Response.Write("<script>alert('退款成功!')</script>");
}
catch (Exception excption)
{
Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
}
}
if (typeChannel == "UN")
{
BCRefund refund = new BCRefund(billNo, DateTime.Today.ToString("yyyyMMdd") + BCUtil.GetUUID().Substring(0, 8), totalFee);
refund.channel = BCPay.RefundChannel.UN.ToString();
try
{
refund = BCPay.BCRefundByChannel(refund);
Response.Write("<script>alert('退款成功!')</script>");
}
catch (Exception excption)
{
Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
}
}
if (typeChannel == "JD")
{
BCRefund refund = new BCRefund(billNo, DateTime.Today.ToString("yyyyMMdd") + BCUtil.GetUUID().Substring(0, 8), totalFee);
refund.channel = BCPay.RefundChannel.JD.ToString();
try
{
refund = BCPay.BCRefundByChannel(refund);
Response.Write("<script>alert('退款成功!')</script>");
}
catch (Exception excption)
{
Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
}
}
if (typeChannel == "YEE")
{
BCRefund refund = new BCRefund(billNo, DateTime.Today.ToString("yyyyMMdd") + BCUtil.GetUUID().Substring(0, 8), totalFee);
refund.channel = BCPay.RefundChannel.YEE.ToString();
try
{
refund = BCPay.BCRefundByChannel(refund);
Response.Write("<script>alert('退款成功!')</script>");
}
catch (Exception excption)
{
Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
}
}
if (typeChannel == "KUAIQIAN")
{
BCRefund refund = new BCRefund(billNo, DateTime.Today.ToString("yyyyMMdd") + BCUtil.GetUUID().Substring(0, 8), totalFee);
refund.channel = BCPay.RefundChannel.KUAIQIAN.ToString();
try
{
refund = BCPay.BCRefundByChannel(refund);
Response.Write("<script>alert('退款成功!')</script>");
}
catch (Exception excption)
{
Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
}
}
if (typeChannel == "BC_GATEWAY")
{
BCRefund refund = new BCRefund(billNo, DateTime.Today.ToString("yyyyMMdd") + BCUtil.GetUUID().Substring(0, 8), totalFee);
refund.channel = BCPay.RefundChannel.BC.ToString();
try
{
refund = BCPay.BCRefundByChannel(refund);
Response.Write("<script>alert('退款成功!')</script>");
}
catch (Exception excption)
{
Response.Write("<span style='color:#00CD00;font-size:20px'>" + excption.Message + "</span><br/>");
}
}
}
}