1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace LYFZ.WeixinServers.WeiXinAPP
- {
- public partial class BondingAccount : System.Web.UI.Page
- {
- public string openid = "";
- public string cusid = "";
- public string appid = "";
- public string jsInfo = "";
- protected void Page_Load(object sender, EventArgs e)
- {
- if(!IsPostBack)
- {
- cusid = Request.QueryString["cusid"];
- openid = Request.QueryString["openid"];
- appid = Request.QueryString["appid"];
- }
- else
- {
- cusid = Request["cusid"];
- openid = Request["openid"];
- appid = Request["appid"];
- }
- }
- public void WriteLog(HttpContext context, string content, string filename = "")
- {
- if (string.IsNullOrEmpty(filename))
- {
- filename = DateTime.Now.ToString("yyyyMMddHHmmssffff");
- }
- string dirPath = context.Server.MapPath("/") + "/WeiXinDir/";
- if (!System.IO.Directory.Exists(dirPath))
- {
- System.IO.Directory.CreateDirectory(dirPath);
- }
- System.IO.File.AppendAllText(dirPath + "/" + filename + ".txt", content + "\r\n");
- }
- protected void Button1_Click(object sender, EventArgs e)
- {
- LYFZ.WeixinServiceDate.Model.Model_CustomerInterfaces cusModel = Global.GetCustomerModelById(Request.Form["cusid"]);
- string openid = Request.Form["openid"];
- string telephone = Request.Form["mobilenumber"];
- string ordernumber = Request.Form["ordernumber"];
- string appid = Request.Form["appid"];
- string paramStr = "openid=" + openid + "&telePhone=" + telephone + "&orderFourNumber=" + ordernumber + "&appid=" + appid;
- string getText = LYFZ.WinAPI.HttpClientHelper.GetResponse(cusModel.GetRequestUrl()
- + "/api/WXApi.ashx/BindWXCustomerAccount?" + paramStr);
- Newtonsoft.Json.Linq.JObject jobject = (Newtonsoft.Json.Linq.JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(getText);
- if (jobject.GetValue("code").ToString().Equals("200"))
- {
- Response.Redirect("BindOK.html");
- }
- else
- {
- jsInfo = "<script>alert('" + jobject.GetValue("info").ToString() + "-" + jobject.GetValue("data").ToString() + "')</script>";
- }
- // WriteLog(HttpContext.Current, getText);
- }
- }
- }
|