protected void btn_submit_Click(object sender, EventArgs e) { decimal order_Price = int.Parse(hid_price_yh.Value); string order_id = DateTime.Now.ToString("yyyyMMdd") + "0000" + "MP" + BaseClass.Common.Common.getSuijiString(2); //明细 LVWEIBA.Model.order_Mx modelMx = null; LVWEIBA.BLL.order_Mx bllMx = new LVWEIBA.BLL.order_Mx(); modelMx = new LVWEIBA.Model.order_Mx(); modelMx.order_id = order_id; modelMx.productNum = hid_ticket_id.Value; modelMx.market_price = int.Parse(hid_price_sc.Value); //市场价 modelMx.Transaction_price = int.Parse(hid_price_yh.Value); //优惠价 modelMx.Transfer_price = int.Parse(hid_price_jj.Value); //交接价 modelMx.ProCount = int.Parse(this.hid_count.Value); //商品类型(电子票) modelMx.ProType = "DZP"; //成人和小孩数量(门票默认为0) modelMx.adultCount = 0; modelMx.puppyCount = 0; bllMx.Add(modelMx); //订单 LVWEIBA.Model.order_list model = new LVWEIBA.Model.order_list(); model.order_id = order_id; model.user_id = member; model.order_sj = DateTime.Now; model.order_zt = "DZF";//待支付 model.order_Price = order_Price; model.bz = HiddenFieldBZ.Value; LVWEIBA.BLL.order_list bll = new LVWEIBA.BLL.order_list(); if (bll.Add(model)) { //给订单添加旅客信息 System.Collections.Specialized.NameValueCollection nc = new System.Collections.Specialized.NameValueCollection(Request.Form); string[] arrhotel = nc.GetValues("hotel"); LVWEIBA.BLL.MemberHotelMx bllhotel = new LVWEIBA.BLL.MemberHotelMx(); if (arrhotel != null && arrhotel.Length > 0) { for (int i = 0; i < arrhotel.Length; i++) { if (arrhotel[i] == "") { break; } MemberHotelMx m = new MemberHotelMx(); m.Member = member; m.OrderID = order_id; m.Hotel = int.Parse(arrhotel[i]); m.Sj = DateTime.Now; bllhotel.Add(m); } } else { Jscript.NorefLocation(this.Page, "请选择联系用户!", "showTicket.aspx"); } //1代表门票0代表尾单 Response.Redirect("indent_pay.aspx?ddbm=" + order_id + "&lineid=" + ViewState["ticketId"] + "&type='mp'"); } }
protected void Page_Load(object sender, EventArgs e) { SortedDictionary <string, string> sPara = GetRequestPost(); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]); if (verifyResult)//验证成功 { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表 //商户订单号 openId = Request.Form["body"]; string out_trade_no = Request.Form["out_trade_no"]; //支付宝交易号 string trade_no = Request.Form["trade_no"]; //交易状态 string trade_status = Request.Form["trade_status"]; //总额 string total_fee = Request.Form["total_fee"]; if (Request.Form["trade_status"] == "TRADE_FINISHED") { // } else if (Request.Form["trade_status"] == "TRADE_SUCCESS") { BaseClass.Dal.ChongzhiLog sl = new BaseClass.Dal.ChongzhiLog(); bool isOrderValid = sl.CZisok(out_trade_no, openId); log4netHelper.WriteDebugLog(typeof(notify_url), "订单notify", "订单号:" + out_trade_no + "处理状态:" + isOrderValid); if (isOrderValid) { string mid = openId; decimal money = decimal.Parse(total_fee) / 100; LVWEIBA.DAL.order_list oodd = new LVWEIBA.DAL.order_list(); LVWEIBA.Model.order_list oom = oodd.GetModel(out_trade_no); if (oom.order_zt != "DCX") { //正式状态 oom.order_zt = "DCX"; oodd.Update(oom); //发送短信通知用户和商户 var orderMx = new LVWEIBA.DAL.order_Mx().GetModel(out_trade_no); var member = new LVWEIBA.BLL.MemberInfo().GetModel(mid); //发送短信通知用户和商户(判断是门票还是尾单) if (orderMx.ProType != null && (orderMx.ProType.Equals("DZP") || orderMx.ProType.Equals("ZZP"))) { var bll = new LVWEIBA.DAL.ProviderSpot(); LVWEIBA.Model.ProviderSpot providerSpot = bll.GetModel(int.Parse(orderMx.productNum)); LVWEIBA.MessageService.NotifyUsersTicket(member.Tel, providerSpot.MasterTel, orderMx); providerSpot.Num = providerSpot.Num - orderMx.ProCount; bll.Update(providerSpot); log4netHelper.WriteDebugLog(typeof(notify_url), "订单notify", "修改余量: productNum is:" + orderMx.productNum + "TicketCount is:" + providerSpot.Num); } else { LVWEIBA.Model.LvULines lvModel = new LVWEIBA.DAL.LvULines().GetModel(orderMx.productNum); LVWEIBA.MessageService.NotifyUsers(member.Tel, lvModel.LineMasterMoble, orderMx); //修改线路余量 LVWEIBA.BLL.LvULines lvubLL = new LVWEIBA.BLL.LvULines(); if (lvModel != null) { lvModel.adultTicketCount = lvModel.adultTicketCount - orderMx.adultCount; lvModel.puppyTicketCount = lvModel.puppyTicketCount - orderMx.puppyCount; lvubLL.Update(lvModel); log4netHelper.WriteDebugLog(typeof(notify_url), "订单notify", "修改余量: productNum is:" + orderMx.productNum); } } } } } //——请根据您的业务逻辑来编写程序(以上代码仅作参考)—— Response.Write("success"); //请不要修改或删除 ///////////////////////////////////////////////////////////////////////////////////////////////////////////// } else//验证失败 { string out_trade_no = Request.Form["out_trade_no"]; moneyUnFreeze(out_trade_no, openId); couponUnUse(out_trade_no); Response.Write("fail"); } } else { Response.Write("无通知参数"); } }
protected void Page_Load(object sender, EventArgs e) { int lineid = (string.IsNullOrEmpty(Request.QueryString["lineid"]) ? 0 : int.Parse(Request.QueryString["lineid"])); UserAuthorizationModel userInfo = UserAuthorization.userLogin(this.Page); if (userInfo.openId == null || userInfo.openId == "") { openid = userInfo.mobile; } else { openid = userInfo.openId; } string oid = Request.QueryString["ddbm"]; log4netHelper.WriteDebugLog(typeof(index_indent_pay), "indent_pay", "进入支付 orderid is:" + oid + "用户Id:" + openid); LVWEIBA.Model.order_list oom = new LVWEIBA.Model.order_list(); oom = new LVWEIBA.DAL.order_list().GetModel(oid); LVWEIBA.Model.order_Mx omm = new LVWEIBA.DAL.order_Mx().GetModel(oid); string typeObject = omm.ProType; if (!String.IsNullOrEmpty(typeObject)) { if (typeObject.Equals("DZP")) { type = "mp"; } else { type = "wd"; } } //BaseClass.Common.LoggerUtil.printLog("type is:" + type); shichangjia = omm.market_price.ToString(); youhuijia = omm.Transaction_price.ToString(); LVWEIBA.Model.MemberList mmm = new LVWEIBA.Model.MemberList(); mmm = new LVWEIBA.DAL.MemberList().GetModel(openid); if (mmm == null) { moneyLeft = "0.00"; } else { moneyLeft = mmm.Money.ToString(); } LVWEIBA.DAL.LvULines dallines = new LVWEIBA.DAL.LvULines(); LVWEIBA.Model.LvULines mlines = dallines.GetModel(omm.productNum); //根据订单明细的线路编号获取线路的类别 if ((mlines != null && mlines.Kindof.Equals("jianhang")) || type.Equals("mp")) //建行分期或门票 { HiddenFieldchctt.Value = omm.Transaction_price.ToString().Replace(".", ""); Label1.Text = omm.Transaction_price.ToString();//优惠价 lbl_scsm.Text = ""; lbl_yhsm.Text = "(支付时直接按优惠价价支付)"; type = "jh"; } else { lbl_scsm.Text = "(支付时按市场价支付)"; lbl_yhsm.Text = "(返还差价之后的实际成交价)"; lbl_zyts.Text = @" 重要提示:该产品按市场价支付,旅行结束后48小时内 驴尾巴网将差价返还至会员现金账户,会员可自由选择提现 或二次消费。"; HiddenFieldchctt.Value = omm.market_price.ToString().Replace(".", ""); Label1.Text = omm.market_price.ToString();//市场价 } if (type == null) { type = "default"; } HUserHostAddress = Page.Request.UserHostAddress; //HiddenFieldchctt.Value = omm.Transaction_price.ToString().Replace(".", ""); //Label1.Text = omm.Transaction_price.ToString(); this.hid_order_id.Value = oid; this.hid_order_type.Value = type; }