protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_order_price_edit", "编辑订单金额")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { model = new Lebi_Order(); } }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_edit", "编辑订单")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel(id); if (model == null) { model = new Lebi_Order(); } }
/// <summary> /// 取消订单 /// </summary> public void OrderCancal() { int id = RequestTool.RequestInt("id", 0); string Remark = RequestTool.RequestSafeString("Remark"); Lebi_Order order = B_Lebi_Order.GetModel("User_id=" + CurrentUser.id + " and id = " + id + ""); //增加未审核判断 by lebi.kingdge 2015-04-21 if (order == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } if (!Shop.Bussiness.Order.CancelOrder(order)) { Response.Write("{\"msg\":\"" + Tag("已取消") + "\"}"); return; } if (order.IsShipped == 1 || order.IsShipped_All == 1 || order.IsCompleted == 1 || order.IsReceived == 1 || order.IsReceived_All == 1) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); return; } Lebi_Comment model = new Lebi_Comment(); if (Remark != "") { model.Content = Tag("取消订单") + ":" + Remark; } else { model.Content = Tag("取消订单"); } model.Keyid = order.id; model.TableName = "Order"; model.User_id = CurrentUser.id; model.User_UserName = CurrentUser.UserName; B_Lebi_Comment.Add(model); if (order.IsPaid == 0) { Shop.Bussiness.Order.Order_Cancal(order); } else { order.IsRefund = 2; order.Time_Refund = System.DateTime.Now; B_Lebi_Order.Update(order); } Log.Add("取消订单", "Order", order.id.ToString(), CurrentUser); Response.Write("{\"msg\":\"OK\"}"); }
/** * 生成直接支付url,支付url有效期为2小时,模式二 * @param productId 商品ID * @return 模式二URL */ public static string GetPayUrl(string productId) { //Log.Info(this.GetType().ToString(), "Native pay mode 2 url is producing..."); Lebi_Order order = B_Lebi_Order.GetModel("id=" + productId); if (order == null) { return(""); } Lebi_OnlinePay pay = B_Lebi_OnlinePay.GetModel("id = " + order.OnlinePay_id + " and Code='weixinpayh5'"); if (pay == null) { Log.Add("在线支付接口 weixinpay 配置错误"); return(""); } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); if (pay.FeeRate > 0) { order.Money_OnlinepayFee = order.Money_Pay * pay.FeeRate / 100; } string order_price = (order.Money_Pay * currendy.ExchangeRate * 100 * (1 + (pay.FeeRate / 100))).ToString("0"); WxPayData data = new WxPayData(); data.SetValue("body", "订单号:" + order.Code); //商品描述 data.SetValue("attach", ""); //附加数据 data.SetValue("out_trade_no", order.Code); data.SetValue("total_fee", order_price); //总金额 data.SetValue("time_start", DateTime.Now.ToString("yyyyMMddHHmmss")); //交易起始时间 data.SetValue("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss")); //交易结束时间 data.SetValue("goods_tag", "订单号:" + order.Code); //商品标记 data.SetValue("trade_type", "NATIVE"); //交易类型 data.SetValue("product_id", productId); //商品ID try { WxPayData result = WxPayApi.UnifiedOrder(data); //调用统一下单接口 string url = result.GetValue("code_url").ToString(); //获得统一下单接口返回的二维码链接 //Log.Info(this.GetType().ToString(), "Get native pay mode 2 url : " + url); return(url); } catch (System.NullReferenceException) { return(""); } }
protected void Page_Load(object sender, EventArgs e) { int order_id = RequestTool.RequestInt("order_id", 0); Lebi_Order order = B_Lebi_Order.GetModel(order_id); if (order == null) { Response.Write("ERROR"); Response.End(); return; } Lebi_Language language = B_Lebi_Language.GetModel(order.Language_id); if (order.IsPaid == 1) { Response.Write(Language.Tag("已付款", language.Code)); Response.End(); return; } order.Site_id_pay = CurrentSite.id; order.Language_id = CurrentLanguage.id; pay = Shop.Bussiness.Money.GetOnlinePay(order, "paypal"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } if (pay.FeeRate > 0) { order.Money_OnlinepayFee = order.Money_Pay * pay.FeeRate / 100; } if (order.OnlinePay_id != pay.id) { order.OnlinePay_id = pay.id; order.OnlinePay_Code = pay.Code; order.OnlinePay = pay.Name; } B_Lebi_Order.Update(order); Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); business = pay.UserName; OrderCode = order.Code; Pid = order.Code; Money = (order.Money_Pay * currendy.ExchangeRate * (1 + (pay.FeeRate / 100))).ToString("f" + currendy.DecimalLength + ""); Shop.Bussiness.Site site = new Shop.Bussiness.Site(); ReturnUrl = "http://" + RequestTool.GetRequestDomain() + site.WebPath + "/onlinepay/paypal/ReturnUrl.aspx"; }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { if (CurrentUser.id == 0) { Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + "")); } LoadTheme(themecode, siteid, languagecode, pcode); if (SYS.IsClosetuihuo == "1") { PageError(); } CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'"); path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>»</em><a href=\"" + URL("P_UserReturn", "" + id + "") + "\"><span>" + Tag("退货订单") + "</span></a><em>»</em><a href=\"" + URL("P_UserReturnApply", "") + "\"><span>" + Tag("退货申请") + "</span></a>"; CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserReturnApply'"); id = Rint_Para("0"); order = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + ""); if (order == null) { PageError(); } if (order.User_id != CurrentUser.id) { PageError(); } where = "Order_id=" + order.id + ""; order_products = B_Lebi_Order_Product.GetList(where, "id desc"); if (order.Supplier_id > 0) { Lebi_Supplier supplier = B_Lebi_Supplier.GetModel(order.Supplier_id); if (supplier != null) { shouhuoren = supplier.RealName; shouhuodizhi = supplier.Address; shouhuodianhua = supplier.Phone; shouhuoyoubian = supplier.Postalcode; } } else { Lebi_Express_Shipper shipper = B_Lebi_Express_Shipper.GetList("", "Sort desc", 1, 1).FirstOrDefault(); if (shipper != null) { shouhuoren = shipper.UserName; shouhuodizhi = shipper.Address; shouhuodianhua = shipper.Tel; shouhuoyoubian = shipper.ZipCode; } } }
/// <summary> /// 检查一个订单是否已经支付 /// </summary> public void IsOrderPaid() { int id = RequestTool.RequestInt("id"); Lebi_Order order = B_Lebi_Order.GetModel(id); if (order != null) { if (order.IsPaid == 1) { Response.Write("{\"msg\":\"OK\"}"); return; } } Response.Write("{\"msg\":\"NO\"}"); }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_order_shipping", "订单发货")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { model = new Lebi_Order(); } pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); }
protected void Page_Load(object sender, EventArgs e) { try { string RefId = Request.Params["RefId"]; string ResCode = Request.Params["ResCode"]; SaleOrderId = Convert.ToInt64(Request.Params["SaleOrderId"]); SaleReferenceId = Convert.ToInt64(Request.Params["SaleReferenceId"]); string OrderID = Convert.ToString(SaleOrderId); Lebi_Order order = B_Lebi_Order.GetModel("id=" + OrderID + ""); if (order == null) { Response.Write("416"); //Response.Write("系统错误"); Response.End(); return; } Lebi_OnlinePay pay = Shop.Bussiness.Money.GetOnlinePay(order.Code, "behpardakht"); if (pay == null) { Response.Write("系统错误"); Response.End(); return; } Lebi_Currency currendy = B_Lebi_Currency.GetModel(pay.Currency_id); string Content = ""; Content += "OrderCode:" + order.Code + "<br>"; Content += "ResCode:" + ResCode + "<br>"; Content += "SaleReferenceId:" + SaleReferenceId + "<br>"; if (yanzheng(pay) == 0)//验证成功 { Response.Write("0"); Order.OnlinePaySuccess(order.Code); } else { Response.Write("416"); //SystemLog.Add("paypal验证失败"); } } catch (Exception ex) { //Response.Write("False"); SystemLog.Add("behpardakht验证异常" + ex.Message); } }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_edit", "编辑订单")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); int orderid = RequestTool.RequestInt("orderid", 0); Lebi_Order order = B_Lebi_Order.GetModel(orderid); if (order != null) { order.KeyCode = GetMd5Str(order.Code); B_Lebi_Order.Update(order); } QuickPayURL = "http://" + RequestTool.GetRequestDomain() + WebPath.TrimEnd('/') + "/OrderQuickPay/?k=" + order.KeyCode; }
protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_order_print", "打印订单")) { NewPageNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel(id); if (model == null) { model = new Lebi_Order(); } config = ShopCache.GetBaseConfig(); pros = B_Lebi_Order_Product.GetList("Supplier_id = " + CurrentSupplier.id + " and Order_id=" + model.id + "", ""); comms = B_Lebi_Comment.GetList("Supplier_id = " + CurrentSupplier.id + " and TableName='Order' and Keyid=" + model.id + " and User_id = " + model.User_id + " and Admin_id = 0", "id desc"); }
protected void Page_Load(object sender, EventArgs e) { int id = RequestTool.RequestInt("id", 0); if (!EX_Admin.Power("order_edit", "编辑订单")) { PageReturnMsg = PageNoPowerMsg(); } model = B_Lebi_Order.GetModel(id); if (model == null) { model = new Lebi_Order(); } pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); }
protected string billstatus = "";//发票状态 protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_edit", "编辑订单")) { NewPageNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel(id); if (model == null) { model = new Lebi_Order(); } if (domain3admin && CurrentAdmin.Site_ids != "") { if (!("," + CurrentAdmin.Site_ids + ",").Contains("," + model.Site_id + ",")) { PageError(); return; } } oldmodel = B_Lebi_Order.GetModel(model.Order_id); if (oldmodel == null) { oldmodel = new Lebi_Order(); } //if (model.Type_id_OrderType == 212) // str = "- "; //if (model.Type_id_OrderType == 212) // Response.Redirect("Torder_view.aspx?id=" + id); pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); Logs = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc"); torders = B_Lebi_Transport_Order.GetList("Order_id="+model.id+"", "id desc"); comms = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc"); langs = Language.Languages(); Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id="+model.id+""); if (bill == null) { billstatus = Tag("不开发票"); } else { billstatus = EX_Type.TypeName(bill.Type_id_BillStatus); } }
/** * 下载对账单 * @param WxPayData inputObj 提交给下载对账单API的参数 * @param int timeOut 接口超时时间 * @throws WxPayException * @return 成功时返回,其他抛异常 */ public static WxPayData DownloadBill(WxPayData inputObj, int timeOut = 6) { string Order_Code = inputObj.GetValue("out_trade_no").ToString(); Lebi_Order order = B_Lebi_Order.GetModel("Code = lbsql{'" + Order_Code + "'}"); if (order == null) { throw new WxPayException("订单不存在!"); } WxPayConfig conf = new WxPayConfig(order); string url = "https://api.mch.weixin.qq.com/pay/downloadbill"; //检测必填参数 if (!inputObj.IsSet("bill_date")) { throw new WxPayException("对账单接口中,缺少必填参数bill_date!"); } inputObj.SetValue("appid", conf.APPID); //公众账号ID inputObj.SetValue("mch_id", conf.MCHID); //商户号 inputObj.SetValue("nonce_str", GenerateNonceStr()); //随机字符串 inputObj.SetValue("sign", inputObj.MakeSign(order)); //签名 string xml = inputObj.ToXml(); ////SystemLog.Add("WxPayApi"+ "DownloadBill request : " + xml); string response = HttpService.Post(xml, url, false, timeOut);//调用HTTP通信接口以提交数据到API ////SystemLog.Add("WxPayApi"+ "DownloadBill result : " + response); WxPayData result = new WxPayData(); //若接口调用失败会返回xml格式的结果 if (response.Substring(0, 5) == "<xml>") { result.FromXml(response); } //接口调用成功则返回非xml格式的数据 else { result.SetValue("result", response); } return(result); }
/** * * 查询退款 * 提交退款申请后,通过该接口查询退款状态。退款有一定延时, * 用零钱支付的退款20分钟内到账,银行卡支付的退款3个工作日后重新查询退款状态。 * out_refund_no、out_trade_no、transaction_id、refund_id四个参数必填一个 * @param WxPayData inputObj 提交给查询退款API的参数 * @param int timeOut 接口超时时间 * @throws WxPayException * @return 成功时返回,其他抛异常 */ public static WxPayData RefundQuery(WxPayData inputObj, int timeOut = 6) { string Order_Code = inputObj.GetValue("out_trade_no").ToString(); Lebi_Order order = B_Lebi_Order.GetModel("Code = lbsql{'" + Order_Code + "'}"); if (order == null) { throw new WxPayException("订单不存在!"); } WxPayConfig conf = new WxPayConfig(order); string url = "https://api.mch.weixin.qq.com/pay/refundquery"; //检测必填参数 if (!inputObj.IsSet("out_refund_no") && !inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id") && !inputObj.IsSet("refund_id")) { throw new WxPayException("退款查询接口中,out_refund_no、out_trade_no、transaction_id、refund_id四个参数必填一个!"); } inputObj.SetValue("appid", conf.APPID); //公众账号ID inputObj.SetValue("mch_id", conf.MCHID); //商户号 inputObj.SetValue("nonce_str", GenerateNonceStr()); //随机字符串 inputObj.SetValue("sign", inputObj.MakeSign(order)); //签名 string xml = inputObj.ToXml(); var start = DateTime.Now; //请求开始时间 //SystemLog.Add("WxPayApi"+ "RefundQuery request : " + xml); string response = HttpService.Post(xml, url, false, timeOut);//调用HTTP通信接口以提交数据到API //SystemLog.Add("WxPayApi"+ "RefundQuery response : " + response); var end = DateTime.Now; int timeCost = (int)((end - start).TotalMilliseconds);//获得接口耗时 //将xml格式的结果转换为对象以返回 WxPayData result = new WxPayData(); result.FromXml(response); ReportCostTime(url, timeCost, result); //测速上报 return(result); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_shipping", "订单发货")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); torder = B_Lebi_Transport_Order.GetModel(id); if (torder == null) { Response.Write(Tag("参数错误")); Response.End(); return; } string where = "Order_id = " + torder.Order_id + ""; if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids)) { where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))"; } if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids)) { where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))"; } model = B_Lebi_Order.GetModel(where); if (model == null) { Response.Write(Tag("参数错误")); Response.End(); return; } tps = new List <TransportProduct>(); JavaScriptSerializer jss = new JavaScriptSerializer(); try { tps = jss.Deserialize <List <TransportProduct> >(torder.Product); } catch (Exception) { tps = new List <TransportProduct>(); } }
/** * * 撤销订单API接口 * @param WxPayData inputObj 提交给撤销订单API接口的参数,out_trade_no和transaction_id必填一个 * @param int timeOut 接口超时时间 * @throws WxPayException * @return 成功时返回API调用结果,其他抛异常 */ public static WxPayData Reverse(WxPayData inputObj, int timeOut = 6) { string Order_Code = inputObj.GetValue("out_trade_no").ToString(); Lebi_Order order = B_Lebi_Order.GetModel("Code = lbsql{'" + Order_Code + "'}"); if (order == null) { throw new WxPayException("订单不存在!"); } WxPayConfig conf = new WxPayConfig(order); string url = "https://api.mch.weixin.qq.com/secapi/pay/reverse"; //检测必填参数 if (!inputObj.IsSet("out_trade_no") && !inputObj.IsSet("transaction_id")) { throw new WxPayException("撤销订单API接口中,参数out_trade_no和transaction_id必须填写一个!"); } inputObj.SetValue("appid", conf.APPID); //公众账号ID inputObj.SetValue("mch_id", conf.MCHID); //商户号 inputObj.SetValue("nonce_str", GenerateNonceStr()); //随机字符串 inputObj.SetValue("sign", inputObj.MakeSign(order)); //签名 string xml = inputObj.ToXml(); var start = DateTime.Now;//请求开始时间 ////SystemLog.Add("WxPayApi"+ "Reverse request : " + xml); string response = HttpService.Post(xml, url, true, timeOut); ////SystemLog.Add("WxPayApi"+ "Reverse response : " + response); var end = DateTime.Now; int timeCost = (int)((end - start).TotalMilliseconds); WxPayData result = new WxPayData(); result.FromXml(response); ReportCostTime(url, timeCost, result);//测速上报 return(result); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_shipping", "订单发货")) { WindowNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel(id); if (model == null) { model = new Lebi_Order(); } pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); transport_order = B_Lebi_Transport_Order.GetModel("Order_id = " + id); if (transport_order == null) { transport_order = new Lebi_Transport_Order(); } }
/// <summary> /// 修改订单的自提时间 /// </summary> public void OrderPickUpDate_Edit() { int orderid = RequestTool.RequestInt("orderid", 0); Lebi_Order order = B_Lebi_Order.GetModel("User_id=" + CurrentUser.id + " and id = " + orderid + "");//and IsCompleted = 0 and IsReceived=0 if (order == null) { Response.Write("{\"msg\":\"" + Tag("输入错误") + "\"}"); return; } if (order.IsCompleted == 1 || order.IsReceived != 0) { Response.Write("{\"msg\":\"" + Tag("当前订单状态不允许修改") + "\"}"); return; } DateTime pickupdate = RequestTool.RequestTime("pickupdate"); order.PickUp_Date = pickupdate; B_Lebi_Order.Update(order); Response.Write("{\"msg\":\"OK\"}"); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("express_log_print", "打印打印清单")) { PageNoPower(); } id = RequestTool.RequestString("id"); Tid = RequestTool.RequestInt("Tid", 0); Eid = RequestTool.RequestInt("Eid", 0); model = B_Lebi_Express.GetModel("Transport_Id = " + Tid); if (model == null) { model = new Lebi_Express(); } express_shipper = B_Lebi_Express_Shipper.GetModel("Status = 1"); if (express_shipper == null) { express_shipper = new Lebi_Express_Shipper(); } models = B_Lebi_Order.GetList("id in (lbsql{" + id + "})", "id desc", PageSize, page); }
/// <summary> /// 删除商家 /// </summary> public void User_Del() { if (!EX_Admin.Power("supplier_user_del", "删除商家")) { AjaxNoPower(); return; } string id = RequestTool.RequestString("ids"); if (id == "") { Response.Write("{\"msg\":\"" + Tag("请选择要删除的信息") + "\"}"); return; } B_Lebi_Supplier.Delete("id in (lbsql{" + id + "})"); List <Lebi_Order> modellist = B_Lebi_Order.GetList("Supplier_id in (lbsql{" + id + "})", ""); foreach (Lebi_Order model in modellist) { B_Lebi_Order.Delete("id = " + model.id + ""); B_Lebi_Order_Log.Delete("Order_id = " + model.id + ""); B_Lebi_Order_Product.Delete("Order_id = " + model.id + ""); } B_Lebi_Brand.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_ProPerty.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_ProPerty_Tag.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Cash.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Message.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Supplier_Money.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Supplier_Bank.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Supplier_BillType.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Supplier_ProductType.Delete("Supplier_id in (lbsql{" + id + "})"); //B_Lebi_Supplier_Verified.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Supplier_Verified_Log.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_Log.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_ServicePanel.Delete("Supplier_id in (lbsql{" + id + "})"); B_Lebi_ServicePanel_Group.Delete("Supplier_id in (lbsql{" + id + "})"); Log.Add("删除商家", "Supplier_User", id.ToString(), CurrentAdmin, id.ToString()); Response.Write("{\"msg\":\"OK\"}"); }
/** * * 关闭订单 * @param WxPayData inputObj 提交给关闭订单API的参数 * @param int timeOut 接口超时时间 * @throws WxPayException * @return 成功时返回,其他抛异常 */ public static WxPayData CloseOrder(WxPayData inputObj, int timeOut = 6) { string Order_Code = inputObj.GetValue("out_trade_no").ToString(); Lebi_Order order = B_Lebi_Order.GetModel("Code = lbsql{'" + Order_Code + "'}"); if (order == null) { throw new WxPayException("订单不存在!"); } WxPayConfig conf = new WxPayConfig(order); string url = "https://api.mch.weixin.qq.com/pay/closeorder"; //检测必填参数 if (!inputObj.IsSet("out_trade_no")) { throw new WxPayException("关闭订单接口中,out_trade_no必填!"); } inputObj.SetValue("appid", conf.APPID); //公众账号ID inputObj.SetValue("mch_id", conf.MCHID); //商户号 inputObj.SetValue("nonce_str", GenerateNonceStr()); //随机字符串 inputObj.SetValue("sign", inputObj.MakeSign(order)); //签名 string xml = inputObj.ToXml(); var start = DateTime.Now; //请求开始时间 string response = HttpService.Post(xml, url, false, timeOut); var end = DateTime.Now; int timeCost = (int)((end - start).TotalMilliseconds); WxPayData result = new WxPayData(); result.FromXml(response); ReportCostTime(url, timeCost, result); //测速上报 return(result); }
protected void Page_Load(object sender, EventArgs e) { if (!EX_Admin.Power("order_status_ispaid", "订单支付")) { WindowNoPower(); } id = RequestTool.RequestInt("id", 0); string where = "id = " + id + ""; if (!string.IsNullOrEmpty(EX_Admin.Project().Site_ids)) { where += " and (Site_id in (" + EX_Admin.Project().Site_ids + "))"; } if (!string.IsNullOrEmpty(EX_Admin.Project().Supplier_ids)) { where += " and (Supplier_id in (" + EX_Admin.Project().Supplier_ids + "))"; } model = B_Lebi_Order.GetModel(where); if (model == null) { model = new Lebi_Order(); } }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { if (CurrentUser.id == 0) { Response.Redirect(URL("P_Login", "" + HttpUtility.UrlEncode(RequestTool.GetRequestUrlNonDomain()) + "," + GetUrlToken(RequestTool.GetRequestUrlNonDomain()) + "")); } LoadTheme(themecode, siteid, languagecode, pcode); CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserOrderDetails'"); id = Rint("id"); order = B_Lebi_Order.GetModel("(IsDel!=1 or IsDel is null) and User_id = " + CurrentUser.id + " and id = " + id + ""); if (order == null) { PageError(); } if (order.User_id != CurrentUser.id) { PageError(); } if (order.Type_id_OrderType == 212) { Response.Redirect(URL("P_UserReturnDetails", id)); } path = "<a href=\"" + URL("P_Index", "") + "\" class=\"home\" title=\"" + Tag("首页") + "\"><span>" + Tag("首页") + "</span></a><em class=\"home\">»</em><a href=\"" + URL("P_UserCenter", "") + "\"><span>" + Tag("会员中心") + "</span></a><em>»</em><a href=\"" + URL("P_UserOrders", "") + "\"><span>" + Tag("我的订单") + "</span></a><em>»</em><a href=\"" + URL("P_UserOrderDetails", id) + "\"><span>" + Tag("订单") + ":" + order.Code + "</span></a>"; CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserOrderDetails'"); id = Rint_Para("0"); comments = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + order.id, "id desc"); transport_orders = B_Lebi_Transport_Order.GetList("Order_id=" + order.id, "id desc"); bills = B_Lebi_Bill.GetList("Order_id=" + order.id, "id desc"); order_products = B_Lebi_Order_Product.GetList("Order_id=" + order.id, "id desc"); pay = B_Lebi_Pay.GetModel(order.Pay_id); if (pay == null) { pay = new Lebi_Pay(); } if (order.OnlinePay_id > 0) { pay.Code = "OnlinePay"; } }
protected string billstatus = "";//发票状态 protected void Page_Load(object sender, EventArgs e) { if (!Power("supplier_order_edit", "编辑订单")) { NewPageNoPower(); } int id = RequestTool.RequestInt("id", 0); model = B_Lebi_Order.GetModel("Supplier_id = " + CurrentSupplier.id + " and id = " + id); if (model == null) { model = new Lebi_Order(); } if (CurrentSupplier.id != model.Supplier_id) { PageError(); return; } //if (model.Type_id_OrderType == 212) // str = "- "; //if (model.Type_id_OrderType == 212) // Response.Redirect("Torder_view.aspx?id=" + id); pros = B_Lebi_Order_Product.GetList("Order_id=" + model.id + "", ""); Logs = B_Lebi_Log.GetList("TableName='Order' and Keyid='" + model.id + "'", "id desc"); torders = B_Lebi_Transport_Order.GetList("Order_id=" + model.id + "", "id desc"); comms = B_Lebi_Comment.GetList("TableName='Order' and Keyid=" + model.id + "", "id desc"); langs = Language.Languages(); Lebi_Bill bill = B_Lebi_Bill.GetModel("Order_id=" + model.id + ""); if (bill == null) { billstatus = Tag("不开发票"); } else { billstatus = Tag(EX_Type.TypeName(bill.Type_id_BillStatus)); } }
protected void Page_Load(object sender, EventArgs e) { int orderid = RequestTool.RequestInt("orderid", 0); int id = RequestTool.RequestInt("id", 0); string pnumber = RequestTool.RequestString("pnumber").Trim(); order = B_Lebi_Order.GetModel(orderid); orderproduct = B_Lebi_Order_Product.GetModel(id); if (orderproduct == null) { product = B_Lebi_Product.GetModel("Number=lbsql{'" + pnumber + "'} order by id desc"); orderproduct = new Lebi_Order_Product(); } else { product = B_Lebi_Product.GetModel(orderproduct.Product_id); } if (order == null || product == null) { Response.Write(Tag("参数错误")); Response.End(); return; } //int pid = product.Product_id == 0 ? product.id : product.Product_id; if (product.Product_id > 0) { models = B_Lebi_Product.GetList("Product_id=" + product.Product_id + "", ""); } else { models = B_Lebi_Product.GetList("Product_id=" + product.id + "", ""); if (models.Count == 0) { models = new List <Lebi_Product>(); models.Add(product); } } }
protected override void LoadPage(string themecode, int siteid, string languagecode, string pcode) { if (CurrentUser.id == 0) { PageError(); } LoadTheme(themecode, siteid, languagecode, pcode); CurrentPage = B_Lebi_Theme_Page.GetModel("Code='P_UserOrderCancel'"); id = Rint("id"); order = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + ""); if (order == null) { PageError(); } if (order.User_id != CurrentUser.id) { PageError(); } if (!Shop.Bussiness.Order.CancelOrder(order)) { Response.Redirect(URL("P_UserOrders", "")); } }
/** * 生成扫描支付模式一URL * @param productId 商品ID * @return 模式一URL */ public static string GetPrePayUrl(string productId) { Lebi_Order order = B_Lebi_Order.GetModel("id = lbsql{" + productId + "}"); if (order == null) { throw new WxPayException("订单不存在!"); SystemLog.Add("weixinpay-NativePay" + "productId : " + productId); } WxPayConfig conf = new WxPayConfig(order); WxPayData data = new WxPayData(); data.SetValue("appid", conf.APPID); //公众帐号id data.SetValue("mch_id", conf.MCHID); //商户号 data.SetValue("time_stamp", TenpayUtil.getTimestamp()); //时间戳 data.SetValue("nonce_str", TenpayUtil.getNoncestr()); //随机字符串 data.SetValue("product_id", productId); //商品ID data.SetValue("sign", data.MakeSign(order)); //签名 string str = ToUrlParams(data.GetValues()); //转换为URL串 string url = "weixin://wxpay/bizpayurl?" + str; return(url); }
public void LoadPage() { int orderid = RequestTool.RequestInt("orderid"); int pickupid = RequestTool.RequestInt("pickupid"); selectedday = RequestTool.RequestString("selectedday"); callback = RequestTool.RequestString("callback"); order = B_Lebi_Order.GetModel(orderid); if (order == null) { order = new Lebi_Order(); } start = Convert.ToDateTime(order.Time_Add.ToString("yyyy-MM") + "-1"); pick = B_Lebi_PickUp.GetModel(pickupid); if (pick == null) { Response.Write(Tag("参数错误")); Response.End(); return; } sumdays = sumdays + order.Time_Add.Day; }
/// <summary> /// 编辑订单-订单状态变更 /// </summary> public void Order_Status() { if (CurrentUser.id > 0)//已经登录 { int id = RequestTool.RequestInt("id", 0); string type = RequestTool.RequestSafeString("type"); Lebi_Order model = B_Lebi_Order.GetModel("User_id = " + CurrentUser.id + " and id = " + id + ""); if (model == null) { Response.Write("{\"msg\":\"" + Tag("参数错误") + "\"}"); } else { if (type == "invalid") { if (Shop.Bussiness.Order.CancelOrder(model)) { model.IsInvalid = 1; model.Time_Completed = System.DateTime.Now; //if (model.IsPaid == 1) //如果已付款,返回到预存款账户 by lebi.kingdge 20151018 //{ // model.IsPaid = 0; // Money.AddMoney(CurrentUser, model.Money_Pay + model.Money_UserCut, 195, null, Tag("取消订单") + " " + model.Code, Tag("取消订单") + " " + model.Code); //} B_Lebi_Order.Update(model); } } //if (type == "received") //{ // model.IsReceived = 1; // model.Time_Received = System.DateTime.Now; // B_Lebi_Order.Update(model); //} } Response.Write("{\"msg\":\"OK\"}"); } }