private void Rep_PayRecharge_ItemCommand(object sender, RepeaterCommandEventArgs e) { if (e.CommandName == "Charge") { var button = (LinkButton)sender; var field = button.Parent.FindControl("HiddenFieldPayMentValue") as HiddenField; var field2 = button.FindControl("HiddenFieldOrderNumber") as HiddenField; var field3 = button.FindControl("HiddenFieldOperateMoney") as HiddenField; string timetemp = DateTime.Now.AddMinutes(10.0).Ticks.ToString(); string url = new PayUrlOperate().GetPayUrl(field.Value, field3.Value.Trim(), ShopSettings.siteDomain + "/main/account/A_Index.aspx", "充值", field2.Value, "Recharge", "0", "admin", base.MemLoginID, timetemp); if (url.Length > 0x3e8) { Encoding encoding; if (url.Split(new[] { '|' })[0].IndexOf("UTF") != -1) { encoding = Encoding.UTF8; } else { encoding = Encoding.Default; } Page.Response.ContentEncoding = encoding; Page.Response.Write(url.Split(new[] { '|' })[1]); } else if (hid_PayMent.Value != "线下支付") { Page.Response.Redirect(url); } else { MessageBox.Show("线下支付申请提交成功!请及时汇款!"); } } }
private void Rep_PayRecharge_ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { var label = (Label)e.Item.FindControl("LabelOperateStatus"); var anchor2 = (HtmlAnchor)e.Item.FindControl("deleteData"); var anchor = (HtmlAnchor)e.Item.FindControl("PayUrl"); if (label.Text == "未处理") { anchor2.Visible = true; anchor.Visible = true; var field = (HiddenField)e.Item.FindControl("HiddenFieldPayMentValue"); var field2 = (HiddenField)e.Item.FindControl("HiddenFieldOrderNumber"); var field3 = (HiddenField)e.Item.FindControl("HiddenFieldOperateMoney"); var field4 = (HiddenField)e.Item.FindControl("HiddenFieldPaymentName"); string timetemp = DateTime.Now.AddMinutes(10.0).Ticks.ToString(); string str = new PayUrlOperate().GetPayUrl(field.Value, field3.Value.Trim(), ShopSettings.siteDomain + "/main/account/A_Index.aspx", "充值", field2.Value, "Recharge", "0", "admin", base.MemLoginID, timetemp); if (str.Length > 0x3e8) { anchor.HRef = str.Split(new[] { '|' })[1]; } else { anchor.HRef = str; } if (field4.Value == "线下支付") { anchor.Visible = false; } } else if (label.Text == "已拒绝") { anchor2.Visible = true; anchor.Visible = false; } else { anchor.Visible = false; anchor2.Visible = false; } } }
private void Btn_Confirm_Click(object sender, EventArgs e) { if (hid_PayMentValue.Value == "-1") { MessageBox.Show("请选择支付方式!"); } else { var advancePaymentApplyLog = new ShopNum1_AdvancePaymentApplyLog { Guid = Guid.NewGuid(), OperateType = "1", CurrentAdvancePayment = Convert.ToDecimal(Lab_AdPayment.Text), OperateMoney = Convert.ToDecimal(txt_Recharge.Value), OperateStatus = 0, Date = DateTime.Now }; string str2 = "C" + new Order().CreateOrderNumber(); advancePaymentApplyLog.OrderNumber = str2; advancePaymentApplyLog.MemLoginID = base.MemLoginID; advancePaymentApplyLog.PaymentGuid = new Guid(hid_PayMentValue.Value); advancePaymentApplyLog.PaymentName = hid_PayMent.Value; advancePaymentApplyLog.Memo = txt_Remark.Value.Trim(); advancePaymentApplyLog.UserMemo = DateTime.Now.ToLocalTime().ToString("yyyyMMddhhmmss"); advancePaymentApplyLog.IsDeleted = 0; advancePaymentApplyLog.OrderStatus = 0; string str3 = GetID().ToString(); advancePaymentApplyLog.ID = Convert.ToInt32(str3); var action = (ShopNum1_AdvancePaymentApplyLog_Action)LogicFactory.CreateShopNum1_AdvancePaymentApplyLog_Action(); if (action.ApplyOperateMoney(advancePaymentApplyLog) > 0) { string timetemp = DateTime.Now.AddMinutes(10.0).Ticks.ToString(); string url = new PayUrlOperate().GetPayUrl(hid_PayMentValue.Value, txt_Recharge.Value.Trim(), ShopSettings.siteDomain + "/main/account/A_Index.aspx", "充值", advancePaymentApplyLog.OrderNumber, "Recharge", "0", "admin", base.MemLoginID, timetemp); if (url.Length > 0x3e8) { Encoding encoding; if (url.Split(new[] { '|' })[0].IndexOf("UTF") != -1) { encoding = Encoding.UTF8; } else { encoding = Encoding.Default; } Page.Response.ContentEncoding = encoding; Page.Response.Write(url.Split(new[] { '|' })[1]); } else if (hid_PayMent.Value != "线下支付") { Page.Response.Redirect(url); } else { MessageBox.Show("线下支付申请提交成功!请及时汇款!"); } GetMemInfo(); BindPayment(); method_2(); } else { MessageBox.Show("充值失败!"); } GetMemInfo(); BindPayment(); } }