Пример #1
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();
                }
            }
        }
Пример #2
0
        public void Bind(string FromUserName)
        {
            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()));
            }
            CUST_INFO cust = mss.GetCust(FromUserName);

            if (cust != null && !string.IsNullOrEmpty(cust.CardNo))
            {
                Z_LOY_BP_GETDETAILResponse zloy = SelectMember(cust.CardNo);
                if (zloy.T_CENTRAL != null && zloy.T_CENTRAL.Length > 0)
                {
                    address   = zloy.T_ADDRESSDATA[0].STREET;
                    nameval   = zloy.T_CENTRALDATAPERSON[0].LASTNAME;
                    cardnoval = zloy.E_USER_NO;
                    City c = mss.GetCityByCode(int.Parse(zloy.T_ADDRESSDATA[0].CITY));
                    ddlC.Items.Clear();
                    ddlC.Items.Add(new ListItem(c.CityName, c.CityCode.ToString()));
                    ddlS.SelectedValue = zloy.T_ADDRESSDATA[0].REGION;
                    cardno.InnerHtml   = "<em id='cardval'>" + zloy.E_USER_NO + "</em>";
                    name.InnerHtml     = "<em id='nameval'>" + zloy.T_CENTRALDATAPERSON[0].LASTNAME + "</em>";
                    phone.InnerHtml    = "<em id='phoneval'>" + zloy.T_TELEFONDATA[0].TELEPHONE + "</em>";
                    if (zloy.T_CENTRAL[0].TITLE_KEY == "Z001")
                    {
                        sex.InnerHtml = "<span class='nandeicon'><em id='sexval'>先生</em></span>";
                    }
                    else
                    {
                        sex.InnerHtml = "<span class='nvdeicon'><em id='sexval'>女士</em></span>";
                    }
                    string birth  = zloy.T_CENTRALDATAPERSON[0].BIRTHDATE;
                    string zctime = zloy.T_ADDRESSDATA[0].STR_SUPPL3;
                    if (birth.Length > 6)
                    {
                        bir.InnerHtml = "<strong>您的生日</strong><span><bdo>" + birth.Substring(0, 4) + "年" + birth.Substring(4, 2) + "月" + birth.Substring(6, 2) + "日</bdo></span>";
                    }
                    else
                    {
                        create.InnerHtml = "<strong>您的生日</strong><span><bdo>未填写</bdo></span>";
                    }
                    if (zctime.Length > 6)
                    {
                        create.InnerHtml = "<strong>注册时间</strong><span><bdo>" + zctime.Substring(0, 4) + "年" + zctime.Substring(4, 2) + "月" + zctime.Substring(6, 2) + "日</bdo></span>";
                    }
                    else
                    {
                        create.InnerHtml = "<strong>注册时间</strong><span><bdo>未填写</bdo></span>";
                    }
                    guitai.InnerHtml = "<strong>注册柜台</strong><span><bdo>" + zloy.T_CENTRAL[0].TITLELETTER + "</bdo></span>";

                    if (zloy.T_CUSTOMER06[0].ZA39 == "X")
                    {
                        radsj.InnerHtml = "<input name='' type='radio' value='手机' class='radiocss checked2'>";
                    }
                    if (zloy.T_CUSTOMER06[0].ZA40 == "X")
                    {
                        raddx.InnerHtml = "<input name='' type='radio' value='短信' class='radiocss checked2'>";
                    }
                    if (zloy.T_CUSTOMER06[0].ZA41 == "X")
                    {
                        radyj.InnerHtml = "<input name='' type='radio' value='邮件' class='radiocss checked2'>";
                    }
                    if (zloy.T_CUSTOMER06[0].ZA42 == "X")
                    {
                        radlp.InnerHtml = "<input name='' type='radio' value='礼品' class='radiocss checked2'>";
                    }
                    if (zloy.T_CUSTOMER06[0].ZA43 == "X")
                    {
                        radzy.InnerHtml = "<input name='' type='radio' value='直邮' class='radiocss checked2'>";
                    }
                    if (zloy.T_CUSTOMER06[0].ZA44 == "X")
                    {
                        radhd.InnerHtml = "<input name='' type='radio' value='活动' class='radiocss checked2'>";
                    }
                }
            }
            else
            {
                Response.Redirect("https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx32364024f2c86185&redirect_uri=http://wechat.censh.com/wechat/NewMember/Band.aspx&response_type=code&scope=snsapi_base&state=STATE&connect_redirect=1#wechat_redirect");
            }
        }