コード例 #1
0
ファイル: Member.aspx.cs プロジェクト: Thn123/hmj
 protected void Page_Load(object sender, EventArgs e)
 {
     //Session["FromUserName"] = "******";
     //Session["ToUserName"] = "******";
     if (!IsPostBack)
     {
         Base();
         if (Request.QueryString["s"] == null)
         {
             if ((Request.QueryString["FromUserName"] != null || Session["FromUserName"] != null) && (Request.QueryString["ToUserName"] != null || Session["ToUserName"] != null))
             {
                 string user  = Request.QueryString["FromUserName"] == null ? Session["FromUserName"].ToString() : Request.QueryString["FromUserName"].ToString();
                 string user2 = Request.QueryString["ToUserName"] == null ? Session["ToUserName"].ToString() : Request.QueryString["ToUserName"].ToString();
                 Session["FromUserName"] = user;
                 Session["ToUserName"]   = user2;
                 try
                 {
                     Bind(user);
                 }
                 catch (Exception ex)
                 {
                     WXLOG log = new WXLOG();
                     log.CON  = ex.Message.ToString() + "Member";
                     log.TIME = DateTime.Now;
                     mss.SaveLog(log);
                 }
             }
             else
             {
                 Response.Redirect(AuthCode(Request.Url.AbsoluteUri));
             }
         }
         else if (Request.QueryString["s"] != null)
         {
             string      html = "<option value='0'>请选择城市</option>";
             List <City> list = mss.GetCityByReg(Request.QueryString["s"]);
             foreach (City c in list)
             {
                 html += "<option value='" + c.CityCode + "'>" + c.CityName + "</option>";
             }
             Response.Write(html);
             Response.End();
         }
     }
 }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.QueryString["s"] == null)
                {
                    //Session["FromUserName"] = "******";
                    //Session["ToUserName"] = "******";
                    Base();
                    if ((Request.QueryString["FromUserName"] != null || Session["FromUserName"] != null) && (Request.QueryString["ToUserName"] != null || Session["ToUserName"] != null))
                    {
                        string user  = Request.QueryString["FromUserName"] == null ? Session["FromUserName"].ToString() : Request.QueryString["FromUserName"].ToString();
                        string user2 = Request.QueryString["ToUserName"] == null ? Session["ToUserName"].ToString() : Request.QueryString["ToUserName"].ToString();
                        Session["FromUserName"] = user;
                        Session["ToUserName"]   = user2;
                        CUST_INFO c = mss.GetCust(user);
                        if (c != null)
                        {
                            Response.Redirect("https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx32364024f2c86185&redirect_uri=http://wechat.censh.com/wechat/NewMember/ka.aspx&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect");
                        }
                    }
                    List <Region> list = mss.GetRegion();

                    DataTable dt = ListToDataTable(list);

                    ddlS.Items.Clear();
                    ddlS.Items.Add(new ListItem("请选择省份", "0"));
                    foreach (DataRow dr in dt.Rows)
                    {
                        ddlS.Items.Add(new ListItem(dr["RegionName"].ToString(), dr["RegionCode"].ToString()));
                    }
                }
                else if (Request.QueryString["s"] != null)
                {
                    string      html = "<option value='0'>请选择城市</option>";
                    List <City> list = mss.GetCityByReg(Request.QueryString["s"]);
                    foreach (City c in list)
                    {
                        html += "<option value='" + c.CityCode + "'>" + c.CityName + "</option>";
                    }
                    Response.Write(html);
                    Response.End();
                }
            }
        }