public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; HttpRequest Request = context.Request; HttpResponse Response = context.Response; JsonObject json = new JsonObject(); if (!string.IsNullOrEmpty(Request.Form["cid"]) && !string.IsNullOrEmpty(Request.Form["mids"]) && !string.IsNullOrEmpty(Request.Form["uid"]) && !string.IsNullOrEmpty(Request.Form["uEmail"]) && !string.IsNullOrEmpty(Request.Form["uName"]) && !string.IsNullOrEmpty(Request.Form["SellerId"]) && !string.IsNullOrEmpty(Request.Form["tprice"])) { int cid = int.Parse(Request.Form["cid"]); string mids = Request.Form["mids"]; int type = -1; if(mids.Contains(',')) { mids = mids.TrimEnd(','); type = 1; } else { type = 0; } int uid = int.Parse(Request.Form["uid"]); string email = Request.Form["uEmail"]; int sellerId = int.Parse(Request.Form["SellerId"]); decimal totalPrice = decimal.Parse(Request.Form["tprice"]); string uName = Request.Form["uName"]; Model.Tao.Orders orderList = new Model.Tao.Orders(); orderList.BuyerID = uid; orderList.Email = email; orderList.Amount = totalPrice; orderList.UserName = uName; orderList.SellerID = sellerId; BLL.Tao.Orders orderBll = new BLL.Tao.Orders(); int OId = orderBll.CreateNewOrderInfo(orderList, cid, mids, type); if (OId > 0) { json.Put(TAO_KEY_STATUS, TAO_STATUS_SUCCESS); json.Put(TAO_KEY_DATA, OId); } else { json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED); } } else { json.Put(TAO_KEY_STATUS, TAO_STATUS_FAILED); } context.Response.Write(json.ToString()); }
protected void btnNext_Click(object sender, EventArgs e) { Model.Tao.Orders model = new Model.Tao.Orders(); if (fsRadio.Checked) { List<Maticsoft.Payment.Model.PaymentModeInfo> listPay = Maticsoft.Payment.BLL.PaymentModeManage.GetPaymentModes(); if (listPay != null) { if (listPay.Count == 0) { //Session["CurrentError"] = "没有可用的支付方式!"; //throw new Exception("1"); Server.Transfer("~/ErrorPage.aspx"); } if (listPay[0].ModeId <= 0) { //throw new Exception("2"); Server.Transfer("~/ErrorPage.aspx"); } if (!string.IsNullOrEmpty(this.hfOrderId.Value)) { model.PaymentTypeId = listPay[0].ModeId;//支付类型接口 model.OrderID = int.Parse(this.hfOrderId.Value); BLL.Tao.Orders order = new BLL.Tao.Orders(); order.UpdatePaymentID(model); } } else { //Session["CurrentError"] = "没有可用的支付方式!"; Server.Transfer("~/ErrorPage.aspx"); } } if (string.IsNullOrEmpty(this.hfOrderId.Value)) { //Session["CurrentError"] = "没找到该订单信息,请联系管理员!"; Server.Transfer("~/ErrorPage.aspx"); } int resOrderId = int.Parse(this.hfOrderId.Value); if (resOrderId > 0) { Response.Redirect(string.Format("/PurchaseHandler.aspx?OrderIds={0}", resOrderId)); } else { Session["CurrentError"] = "订单生成失败,请联系管理员!"; Server.Transfer("~/ErrorPage.aspx"); } }
protected void btnNext_Click(object sender, EventArgs e) { //生成订单 Model.Tao.Orders model = new Model.Tao.Orders(); BLL.Tao.Orders orderBll = new BLL.Tao.Orders(); model.BuyerID = CurrentUser.UserID;//充值人的ID model.UserName = CurrentUser.TrueName;//充值人姓名 model.Email = this.litAccount.Text;//充值人的Email decimal totalMoney = Common.Globals.SafeDecimal(Request.QueryString["total_fee"], 0); if (totalMoney == 0) { Server.Transfer("~/ErrorPage.aspx"); } model.Amount = totalMoney;//充值金额 List<Maticsoft.Payment.Model.PaymentModeInfo> listPay = Maticsoft.Payment.BLL.PaymentModeManage.GetPaymentModes(); if (listPay.Count == 0) { Server.Transfer("~/ErrorPage.aspx"); } if (listPay[0].ModeId <= 0) { Server.Transfer("~/ErrorPage.aspx"); } model.PaymentTypeId = listPay[0].ModeId;//支付类型接口 int resOrderId = orderBll.Rechange(model); if (resOrderId > 0) { model.OrderID = resOrderId; orderBll.UpdatePaymentID(model); Response.Redirect(string.Format("/SendPayment.aspx?OrderIds={0}", resOrderId)); } else { Maticsoft.Common.MessageBox.ShowFailTip(this, "订单生成失败,请联系管理员!"); return; } }