public override void ProcessNotify() { WxPayData notifyData = GetNotifyData(); kyfly.BLL.yewu_dingdanxinxiB bll = new kyfly.BLL.yewu_dingdanxinxiB(); //检查支付结果中transaction_id是否存在 if (!notifyData.IsSet("transaction_id")) { //若transaction_id不存在,则立即返回结果给微信支付后台 WxPayData res = new WxPayData(); res.SetValue("return_code", "FAIL"); res.SetValue("return_msg", "支付结果中微信订单号不存在"); Log.Error(this.GetType().ToString(), "The Pay result is error : " + res.ToXml()); page.Response.Write(res.ToXml()); page.Response.End(); } string transaction_id = notifyData.GetValue("transaction_id").ToString(); //string out_trade_no = notifyData.GetValue("out_trade_no").ToString(); string out_trade_no = "149551405220180120213713862"; string zhuangtai = "已付款"; bll.Updatestate(zhuangtai, out_trade_no); //查询订单,判断订单真实性 if (!QueryOrder(transaction_id)) { //若订单查询失败,则立即返回结果给微信支付后台 WxPayData res = new WxPayData(); res.SetValue("return_code", "FAIL"); res.SetValue("return_msg", "订单查询失败"); Log.Error(this.GetType().ToString(), "Order query failure : " + res.ToXml()); page.Response.Write(res.ToXml()); page.Response.End(); } //查询订单成功 else { WxPayData res = new WxPayData(); res.SetValue("return_code", "SUCCESS"); res.SetValue("return_msg", "OK"); Log.Info(this.GetType().ToString(), "order query success : " + res.ToXml()); page.Response.Write(res.ToXml()); page.Response.End(); } }
public override void ProcessRequest(HttpContext context) { kyfly.BLL.yewu_tuifeilipeiGJB bll = new kyfly.BLL.yewu_tuifeilipeiGJB(context); base.ProcessRequest(context); context.Response.ContentType = "text/plain"; mycommonClass mycommonClassobj = new mycommonClass(); context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); if (context.Request.QueryString["type"] == "edit")//获取编辑信息 { if (context.Request.QueryString["Id"] != null) { string strret = bll.Geteditdata(context.Request.QueryString["Id"].ToString());//aa1 //writeFile("f"); //writeFile(strret); context.Response.Write(strret); } } else if (context.Request.QueryString["type"] == "del")//删除信息 { if (context.Request.QueryString["Id"] == null) { return; } string Id = context.Request.QueryString["Id"].ToString(); bll.Delete(int.Parse(Id)); } else if (context.Request.QueryString["type"] == "combox")//保存修改或添加 信息 aa2 { if (context.Request.QueryString["comboxname"] == "dingdanbiaoId") { kyfly.BLL.yewu_dingdanxinxiB bllzd = new kyfly.BLL.yewu_dingdanxinxiB(); string strret = bllzd.GetListByColumn_tojson("Id", "1=1", ""); context.Response.Write(strret); } } else if (context.Request.QueryString["type"] == "save")//保存修改或添加 { string xingming = context.Request.QueryString["xingming"]; string shoujianrenshouJH = context.Request.QueryString["shoujianrenshouJH"]; string OpenId = context.Request.QueryString["OpenId"]; string dizhi = context.Request.QueryString["dizhi"]; string zhuangtai = context.Request.QueryString["zhuangtai"]; string peisongrenshouJH = context.Request.QueryString["peisongrenshouJH"]; string peisongshijian = context.Request.QueryString["peisongshijian"]; string shenherenshouJH = context.Request.QueryString["shenherenshouJH"]; string shenhejieguo = context.Request.QueryString["shenhejieguo"]; string jine = context.Request.QueryString["jine"]; string tuikuanjine = context.Request.QueryString["tuikuanjine"]; string leibie = context.Request.QueryString["leibie"]; string dingdanbiaoId = context.Request.QueryString["dingdanbiaoId"]; string zhifudanhao = context.Request.QueryString["zhifudanhao"]; string weixindingdh = context.Request.QueryString["weixindingdh"]; string tuikuandanhao = context.Request.QueryString["tuikuandanhao"]; string beizhu = context.Request.QueryString["beizhu"]; if (context.Request.QueryString["Id"] != null && context.Request.QueryString["Id"] != "") { bll.Update(context.Request.QueryString["Id"].ToString(), xingming, shoujianrenshouJH, OpenId, dizhi, zhuangtai, peisongrenshouJH, peisongshijian, shenherenshouJH, shenhejieguo, jine, tuikuanjine, leibie, dingdanbiaoId, zhifudanhao, weixindingdh, tuikuandanhao, beizhu); } else { bll.Add(xingming, shoujianrenshouJH, OpenId, dizhi, zhuangtai, peisongrenshouJH, peisongshijian, shenherenshouJH, shenhejieguo, jine, tuikuanjine, leibie, dingdanbiaoId, zhifudanhao, weixindingdh, tuikuandanhao, beizhu); } context.Response.Write("true"); } else if (Convert.ToString(context.Request.Form["action"]) == "query") { //string strret = bll.GetListByPageColumns_tojson("id,产品名称,产品数量,产品规格,备注", "1=1", "产品数量"); 加权限, 1=1 改为:部门编号 like '1010%' string strret = bll.GetListByPageColumns_tojson("Id,姓名,收件人手机号,OpenId,地址,状态,配送人手机号,配送时间,审核人手机号,审核结果,金额,退款金额,类别,订单表Id,支付单号,微信订单号,退款单号,备注", pagestrif, "Id", 0); //writeFile("f"); //writeFile(strret); context.Response.Write(strret); return; } else { } }
//public WxPayData unifiedOrderResult { get; set; } public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; writeFile("coming2"); string openid = HttpContext.Current.Request.QueryString["openid"]; string total_fee = HttpContext.Current.Request.QueryString["jiage"]; string goods = HttpContext.Current.Request.QueryString["wupinglx"]; string huowuguizhongF = HttpContext.Current.Request.QueryString["huowuguizhongF"]; string qujianhao = HttpContext.Current.Request.QueryString["qujianhao"]; string huojiahao = HttpContext.Current.Request.QueryString["huojiahao"]; string zhongliangleibie = HttpContext.Current.Request.QueryString["zhongliangleibie"]; string name = HttpContext.Current.Request.QueryString["shouhuoren"]; string tel = HttpContext.Current.Request.QueryString["tel"]; string kuaididizhi = HttpContext.Current.Request.QueryString["kuaididizhi"]; JsApiPay jsApiPay = new JsApiPay(context); jsApiPay.openid = openid; writeFile(jsApiPay.openid); jsApiPay.goods = goods; writeFile(jsApiPay.goods.ToString()); jsApiPay.total_fee = int.Parse(total_fee); double price = jsApiPay.total_fee / 100.0; writeFile(jsApiPay.total_fee.ToString()); //统一下单 WxPayData data = new WxPayData(); data.SetValue("body", goods); writeFile(data.GetValue("body").ToString()); data.SetValue("attach", goods); writeFile(data.GetValue("attach").ToString()); data.SetValue("out_trade_no", WxPayApi.GenerateOutTradeNo()); string out_trade_no = data.GetValue("out_trade_no").ToString(); writeFile(data.GetValue("out_trade_no").ToString()); data.SetValue("total_fee", total_fee); writeFile(data.GetValue("total_fee").ToString()); data.SetValue("time_start", DateTime.Now.ToString("yyyyMMddHHmmss")); writeFile(data.GetValue("time_start").ToString()); data.SetValue("time_expire", DateTime.Now.AddMinutes(10).ToString("yyyyMMddHHmmss")); writeFile(data.GetValue("time_expire").ToString()); data.SetValue("goods_tag", goods); writeFile(data.GetValue("goods_tag").ToString()); data.SetValue("trade_type", "JSAPI"); writeFile(data.GetValue("trade_type").ToString()); data.SetValue("openid", openid); writeFile(data.GetValue("openid").ToString()); WxPayData result = UnifiedOrder(data); writeFile("over..."); if (!result.IsSet("appid") || !result.IsSet("prepay_id") || result.GetValue("prepay_id").ToString() == "") { Log.Error(this.GetType().ToString(), "UnifiedOrder response error!"); throw new WxPayException("UnifiedOrder response error!"); } writeFile("overing"); kyfly.BLL.yewu_dingdanxinxiB bll = new kyfly.BLL.yewu_dingdanxinxiB(context); string jiedanshijian = DateTime.Now.Date.ToString(); string peisongshijian = DateTime.Now.Date.ToString(); string xiuzhengshijian = DateTime.Now.Date.ToString(); WxPayData unifiedOrderResult = jsApiPay.GetUnifiedOrderResult(); //此处有问题! context.Response.Write(jsApiPay.GetJsApiParameters()); //获取H5调起JS API参数 bll.Add(name, tel, goods, "", kuaididizhi, "待付款", jiedanshijian, qujianhao, huojiahao, huowuguizhongF, zhongliangleibie, price.ToString(), "", peisongshijian, "", "", xiuzhengshijian, out_trade_no, "", "", ""); }
public void ProcessRequest(HttpContext context) { kyfly.BLL.yewu_dingdanxinxiB bll = new kyfly.BLL.yewu_dingdanxinxiB(context); kyfly.BLL.jichu_zidianbiao bllzd = new kyfly.BLL.jichu_zidianbiao(); DataSet dd = new DataSet(); DataSet dt = new DataSet(); context.Response.ContentType = "text/plain"; mycommonClass mycommonClassobj = new mycommonClass(); context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); if (context.Request.QueryString["type"] == "edit")//获取编辑信息 { if (context.Request.QueryString["Id"] != null) { string strret = bll.Geteditdata(context.Request.QueryString["Id"].ToString());//aa1 writeFile("f"); writeFile(strret); context.Response.Write(strret); } } else if (context.Request.QueryString["type"] == "del")//删除信息 { if (context.Request.QueryString["Id"] == null) { return; } string Id = context.Request.QueryString["Id"].ToString(); bll.Delete(int.Parse(Id)); } else if (context.Request.QueryString["type"] == "combox")//保存修改或添加 信息 aa2 { } else if (context.Request.QueryString["type"] == "save")//保存修改或添加 { writeFile("going"); string xingming = context.Request.QueryString["xingming"]; string shoujianrenshouJH = context.Request.QueryString["shoujianrenshouJH"]; string wupinleixing = context.Request.QueryString["wupinleixing"]; string zhanpian = context.Request.QueryString["zhanpian"]; string peisongdizhi = context.Request.QueryString["peisongdizhi"]; string zhuangtai = context.Request.QueryString["zhuangtai"]; string jiedanshijian = DateTime.Now.Date.ToString(); string qujianhao = context.Request.QueryString["qujianhao"]; string huojiahao = context.Request.QueryString["huojiahao"]; string huowuguizhongF = context.Request.QueryString["huowuguizhongF"]; string zhongliangleibie = context.Request.QueryString["zhongliangleibie"]; string peisongjine = context.Request.QueryString["peisongjine"]; string peisongrenshouJH = context.Request.QueryString["peisongrenshouJH"]; string peisongshijian = DateTime.Now.Date.ToString(); string shenherenshouJH = context.Request.QueryString["shenherenshouJH"]; string dingdanxiuzheng = context.Request.QueryString["dingdanxiuzheng"]; string xiuzhengshijian = DateTime.Now.Date.ToString(); string zhifudanhao = context.Request.QueryString["zhifudanhao"]; string weixindingdh = context.Request.QueryString["weixindingdh"]; string pingjia = context.Request.QueryString["pingjia"]; string beizhu = context.Request.QueryString["beizhu"]; writeFile(xingming); writeFile(shoujianrenshouJH); writeFile(peisongdizhi); writeFile(zhuangtai); writeFile(qujianhao); writeFile(huowuguizhongF); writeFile(zhongliangleibie); dd = bllzd.GetList("字段名称='" + wupinleixing + "'"); zhanpian = dd.Tables[0].Rows[0]["字段值"].ToString(); dd = bllzd.GetList("字段名称='" + zhongliangleibie + "'"); dt = bllzd.GetList("字段名称='" + huowuguizhongF + "'"); string str = dd.Tables[0].Rows[0]["字段值"].ToString(); float pricef = float.Parse(dd.Tables[0].Rows[0]["字段值"].ToString().Trim()); float prices = float.Parse(dt.Tables[0].Rows[0]["字段值"].ToString().Trim()); writeFile(pricef.ToString()); writeFile(prices.ToString()); peisongjine = (pricef * prices).ToString(); writeFile(peisongjine); if (context.Request.QueryString["Id"] != null && context.Request.QueryString["Id"] != "") { bll.Update(context.Request.QueryString["Id"].ToString(), xingming, shoujianrenshouJH, wupinleixing, zhanpian, peisongdizhi, zhuangtai, jiedanshijian, qujianhao, huojiahao, huowuguizhongF, zhongliangleibie, peisongjine, peisongrenshouJH, peisongshijian, shenherenshouJH, dingdanxiuzheng, xiuzhengshijian, zhifudanhao, weixindingdh, pingjia, beizhu); } else { bll.Add(xingming, shoujianrenshouJH, wupinleixing, zhanpian, peisongdizhi, zhuangtai, jiedanshijian, qujianhao, huojiahao, huowuguizhongF, zhongliangleibie, peisongjine, peisongrenshouJH, peisongshijian, shenherenshouJH, dingdanxiuzheng, xiuzhengshijian, zhifudanhao, weixindingdh, pingjia, beizhu); } context.Response.Write(peisongjine); } else if (Convert.ToString(context.Request.Form["action"]) == "query") { //string strret = bll.GetListByPageColumns_tojson("id,产品名称,产品数量,产品规格,备注", "1=1", "产品数量"); 加权限, 1=1 改为:部门编号 like '1010%' string strret = bll.GetListByPageColumns_tojson("Id,姓名,收件人手机号,物品类型,照片,配送地址,状态,接单时间,取件号,货架号,货物贵重否,重量类别,配送金额,配送人手机号,配送时间,审核人手机号,订单修正,修正时间,支付单号,微信订单号,评价,备注", "", "Id", 0); writeFile("S"); writeFile(strret); context.Response.Write(strret); return; } else if (context.Request.QueryString["action"] == "query") { string phone = ""; string status = ""; string strret = ""; string statust = ""; string pagestr = ""; int Id = 0; if (context.Request.QueryString["phone"] != null && context.Request.QueryString["status"] != null) { phone = context.Request.QueryString["phone"].ToString(); status = context.Request.QueryString["status"].ToString(); writeFile(phone); writeFile(status); } if (status == "0") { pagestr = "收件人手机号='" + phone + "'"; strret = bll.GetListByPageColumns_tojson("Id,姓名,收件人手机号,物品类型,照片,配送地址,状态,接单时间,取件号,货架号,货物贵重否,重量类别,配送金额,配送人手机号,配送时间,审核人手机号,订单修正,修正时间,支付单号,微信订单号,评价,备注", pagestr, "Id", 1); strret = Regex.Replace(strret, "(?<=\"ZT\":\")[^\",]*", status); } else { if (context.Request.QueryString["Id"] != null) { Id = int.Parse(context.Request.QueryString["Id"].ToString()); pagestr = "Id=" + Id; dd = bll.GetList(pagestr); statust = dd.Tables[0].Rows[0]["状态"].ToString(); dt = bllzd.GetList("字段名称='" + statust + "'" + "and " + "类别='" + "状态" + "'"); status = dt.Tables[0].Rows[0]["字段值"].ToString(); strret = bll.GetListByPageColumns_tojson("Id,姓名,收件人手机号,物品类型,照片,配送地址,状态,接单时间,取件号,货架号,货物贵重否,重量类别,配送金额,配送人手机号,配送时间,审核人手机号,订单修正,修正时间,支付单号,微信订单号,评价,备注", pagestr, "Id", 1); strret = Regex.Replace(strret, "(?<=\"ZT\":\")[^\",]*", status); } else { dd = bllzd.GetList("字段值='" + status + "'" + "and " + "类别='" + "状态" + "'"); statust = dd.Tables[0].Rows[0]["字段名称"].ToString(); writeFile(statust); pagestr = "收件人手机号='" + phone + "'" + "and " + "状态='" + statust + "'"; writeFile(pagestr); strret = bll.GetListByPageColumns_tojson("Id,姓名,收件人手机号,物品类型,照片,配送地址,状态,接单时间,取件号,货架号,货物贵重否,重量类别,配送金额,配送人手机号,配送时间,审核人手机号,订单修正,修正时间,支付单号,微信订单号,评价,备注", pagestr, "Id", 1); strret = Regex.Replace(strret, "(?<=\"ZT\":\")[^\",]*", status); writeFile(strret); } } writeFile("S"); writeFile(strret); context.Response.Write(strret); } else if (context.Request.QueryString["type"] == "compute") { string huowuguizhongF = context.Request.QueryString["huowuguizhongF"]; string zhongliangleibie = context.Request.QueryString["zhongliangleibie"]; dd = bllzd.GetList("字段名称='" + zhongliangleibie + "'"); dt = bllzd.GetList("字段名称='" + huowuguizhongF + "'"); float pricef = float.Parse(dd.Tables[0].Rows[0]["字段值"].ToString().Trim()); float prices = float.Parse(dt.Tables[0].Rows[0]["字段值"].ToString().Trim()); writeFile(pricef.ToString()); writeFile(prices.ToString()); string peisongjine = (pricef * prices).ToString(); context.Response.Write(peisongjine); } }
public override void ProcessRequest(HttpContext context) { kyfly.BLL.yewu_dingdanxinxiB bll = new kyfly.BLL.yewu_dingdanxinxiB(context); base.ProcessRequest(context); context.Response.ContentType = "text/plain"; mycommonClass mycommonClassobj = new mycommonClass(); context.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); if (context.Request.QueryString["type"] == "edit")//获取编辑信息 { if (context.Request.QueryString["Id"] != null) { string strret = bll.Geteditdata(context.Request.QueryString["Id"].ToString());//aa1 writeFile("f"); writeFile(strret); context.Response.Write(strret); } } else if (context.Request.QueryString["type"] == "del")//删除信息 { if (context.Request.QueryString["Id"] == null) { return; } string Id = context.Request.QueryString["Id"].ToString(); bll.Delete(int.Parse(Id)); } else if (context.Request.QueryString["type"] == "combox")//保存修改或添加 信息 aa2 { } else if (context.Request.QueryString["type"] == "save")//保存修改或添加 { string xingming = context.Request.QueryString["xingming"]; string shoujianrenshouJH = context.Request.QueryString["shoujianrenshouJH"]; string wupinleixing = context.Request.QueryString["wupinleixing"]; string zhanpian = context.Request.QueryString["zhanpian"]; string peisongdizhi = context.Request.QueryString["peisongdizhi"]; string zhuangtai = context.Request.QueryString["zhuangtai"]; string jiedanshijian = context.Request.QueryString["jiedanshijian"]; string qujianhao = context.Request.QueryString["qujianhao"]; string huojiahao = context.Request.QueryString["huojiahao"]; string huowuguizhongF = context.Request.QueryString["huowuguizhongF"]; string zhongliangleibie = context.Request.QueryString["zhongliangleibie"]; string peisongjine = context.Request.QueryString["peisongjine"]; string peisongrenshouJH = context.Request.QueryString["peisongrenshouJH"]; string peisongshijian = context.Request.QueryString["peisongshijian"]; string shenherenshouJH = context.Request.QueryString["shenherenshouJH"]; string dingdanxiuzheng = context.Request.QueryString["dingdanxiuzheng"]; string xiuzhengshijian = context.Request.QueryString["xiuzhengshijian"]; string zhifudanhao = context.Request.QueryString["zhifudanhao"]; string weixindingdh = context.Request.QueryString["weixindingdh"]; string pingjia = context.Request.QueryString["pingjia"]; string beizhu = context.Request.QueryString["beizhu"]; if (context.Request.QueryString["Id"] != null && context.Request.QueryString["Id"] != "") { bll.Update(context.Request.QueryString["Id"].ToString(), xingming, shoujianrenshouJH, wupinleixing, zhanpian, peisongdizhi, zhuangtai, jiedanshijian, qujianhao, huojiahao, huowuguizhongF, zhongliangleibie, peisongjine, peisongrenshouJH, peisongshijian, shenherenshouJH, dingdanxiuzheng, xiuzhengshijian, zhifudanhao, weixindingdh, pingjia, beizhu); } else { bll.Add(xingming, shoujianrenshouJH, wupinleixing, zhanpian, peisongdizhi, zhuangtai, jiedanshijian, qujianhao, huojiahao, huowuguizhongF, zhongliangleibie, peisongjine, peisongrenshouJH, peisongshijian, shenherenshouJH, dingdanxiuzheng, xiuzhengshijian, zhifudanhao, weixindingdh, pingjia, beizhu); } context.Response.Write("true"); } else if (Convert.ToString(context.Request.Form["action"]) == "query") { //string strret = bll.GetListByPageColumns_tojson("id,产品名称,产品数量,产品规格,备注", "1=1", "产品数量"); 加权限, 1=1 改为:部门编号 like '1010%' string strret = bll.GetListByPageColumns_tojson("Id,姓名,收件人手机号,物品类型,照片,配送地址,状态,接单时间,取件号,货架号,货物贵重否,重量类别,配送金额,配送人手机号,配送时间,审核人手机号,订单修正,修正时间,支付单号,微信订单号,评价,备注", pagestrif, "Id", 0); //writeFile("S"); // writeFile(strret); context.Response.Write(strret); return; } else if (context.Request.QueryString["action"] == "query") { string strret = bll.GetListByPageColumns_tojson("Id,姓名,收件人手机号,物品类型,照片,配送地址,状态,接单时间,取件号,货架号,货物贵重否,重量类别,配送金额,配送人手机号,配送时间,审核人手机号,订单修正,修正时间,支付单号,微信订单号,评价,备注", pagestrif, "Id", 1); writeFile("S"); writeFile(strret); context.Response.Write(strret); } }