protected void Page_Load(object sender, EventArgs e) { if (CurrentMember == null) { Response.Write("<script>history.go(-1);</script>"); } else { string orderNum = Request.QueryString["OrderNum"]; var order = OrderBLL.SelectOrder(orderNum); if (order == null) { JsBox.Jump("-1"); } else { string msg = ""; bool success = OrderBLL.PaySuccessHandler(orderNum, CurrentMember.UserName, order.TotalMoney, out msg); if (success) { JsBox.Alert("支付成功!", "MemberOrder.aspx"); } else { Response.Write(msg); } } } }
protected void Page_Load(object sender, EventArgs e) { if (CurrentMember == null) { Response.Redirect("MemberLogin.aspx?ReturnUrl=" + Server.UrlEncode(CurrentUrl)); } if (MyGoods == null) { JsBox.Alert("商品不存在!", "-1"); } if (MyGoods.IsOut == 1) { JsBox.Alert("商品已下架!", "-1"); } if (!Page.IsPostBack) { tbRealName.Text = CurrentMember.RealName; tbPhone.Text = CurrentMember.Phone; } }
protected void btnSubmit_Click(object sender, EventArgs e) { string realName = tbRealName.Text.Trim(); string phone = tbPhone.Text.Trim(); string address = tbAddress.Text.Trim(); int buyNum = ddlBuyNum.SelectedValue.ToArrowInt(); if (realName.ValidateIsNullOrEmpty("请输入联系人姓名!")) { return; } if (phone.ValidateIsNullOrEmpty("请输入联系电话!")) { return; } if (address.ValidateIsNullOrEmpty("请输入收获地址!")) { return; } if ((buyNum == 0).ValidateSuccess("兑换数量必须大于0")) { return; } string msg = ""; bool success = MemberBLL.ExchangeGoods(CurrentMember.UserName, MyGoods.ID, buyNum, address, realName, phone, out msg); if (success) { JsBox.Alert("申请兑换成功!", "MemberExchange.aspx"); } else { JsBox.Alert(msg); } }