Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        err_username.InnerHtml   = "";
        err_phone_code.InnerHtml = "";
        err_page_code.InnerHtml  = "";
        err_email.InnerHtml      = "";
        err_password.InnerHtml   = "";
        Top1.Welcome             = "号码百事通用户注册";
        backCount.Value          = Convert.ToString((Convert.ToInt32(backCount.Value) - 1));

        if (!Page.IsPostBack)
        {
            //地区联动--start
            ProvinceInfoManager proInfo = new ProvinceInfoManager();
            object  ProData             = proInfo.GetProvinceData(this.Context);
            DataSet ds = (DataSet)ProData;
            this.proInfoList.DataSource     = ds;
            this.proInfoList.DataTextField  = "ProvinceName";
            this.proInfoList.DataValueField = "ProvinceID";
            this.proInfoList.DataBind();

            ListItem li = new ListItem("请选择", "-999");
            proInfoList.Items.Add(li);
            proInfoList.SelectedIndex = proInfoList.Items.Count - 1;

            this.areaInfoList.Items.Add(li);
            areaInfoList.SelectedIndex = areaInfoList.Items.Count - 1;

            SPID      = Request["SPID"] == null ? ConstHelper.DefaultInstance.BesttoneSPID : HttpUtility.HtmlDecode(Request["SPID"]);
            ReturnUrl = Request["ReturnUrl"] == null ? ConstHelper.DefaultInstance.BesttoneLoginPage : HttpUtility.HtmlDecode(Request["ReturnUrl"]);
            HiddenField_SPID.Value = SPID;
            HiddenField_URL.Value  = ReturnUrl;

            btn_OK.Attributes.Add("onclick", "return CheckInput();");
            CertificateType.Attributes.Add("onchange", "ShowCertificateInfo()");
        }

        if (proInfoList.SelectedIndex != proInfoList.Items.Count - 1)
        {
            PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            object        areaData        = areaInfo.GetPhoneAreaData(this.Context, proInfoList.Value);
            PhoneAreaData pad             = (PhoneAreaData)areaData;
            this.areaInfoList.DataSource     = pad;
            this.areaInfoList.DataTextField  = "AreaName";
            this.areaInfoList.DataValueField = "AreaID";
            this.areaInfoList.DataBind();
        }
        else
        {
            areaInfoList.Value = "请选择";
        }
    }
Example #2
0
    public void cityId()
    {
        string htmlpid = HttpUtility.HtmlDecode(Request.QueryString["pid"].ToString());
        string r       = null;
        PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
        object  areaData = areaInfo.GetPhoneAreaData(HttpContext.Current);
        DataSet pad      = (DataSet)areaData;

        DataRow[] rows = pad.Tables["area"].Select("ProvinceID='" + htmlpid + "'");
        for (int i = 0; i < rows.Length; i++)
        {
            r = r + rows[i]["AreaId"].ToString() + "count" + rows.Length.ToString() + "count" + "";
        }
        Response.Write(r);
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Top1.Welcome = "号码百事通用户注册";

        if (!Page.IsPostBack)
        {
            //地区联动--start
            ProvinceInfoManager proInfo = new ProvinceInfoManager();
            object  ProData             = proInfo.GetProvinceData(this.Context);
            DataSet ds = (DataSet)ProData;
            this.proInfoList.DataSource     = ds;
            this.proInfoList.DataTextField  = "ProvinceName";
            this.proInfoList.DataValueField = "ProvinceID";
            this.proInfoList.DataBind();

            ListItem li = new ListItem("请选择", "-999");
            proInfoList.Items.Add(li);
            proInfoList.SelectedIndex = proInfoList.Items.Count - 1;

            this.areaInfoList.Items.Add(li);
            areaInfoList.SelectedIndex = areaInfoList.Items.Count - 1;

            HiddenField_SPID.Value = Request["SPID"] == null ? ConstHelper.DefaultInstance.BesttoneSPID : HttpUtility.HtmlDecode(Request["SPID"]);
            HiddenField_URL.Value  = Request["ReturnUrl"] == null ? ConstHelper.DefaultInstance.BesttoneLoginPage : HttpUtility.HtmlDecode(Request["ReturnUrl"]);
        }

        if (proInfoList.SelectedIndex != proInfoList.Items.Count - 1)
        {
            PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            object        areaData        = areaInfo.GetPhoneAreaData(this.Context, proInfoList.Value);
            PhoneAreaData pad             = (PhoneAreaData)areaData;
            this.areaInfoList.DataSource     = pad;
            this.areaInfoList.DataTextField  = "AreaName";
            this.areaInfoList.DataValueField = "AreaID";
            this.areaInfoList.DataBind();
        }
        else
        {
            areaInfoList.Value = "请选择";
        }
    }
Example #4
0
    protected DataTable GetCityName(string ProvinceID)
    {
        DataTable dt = new DataTable();

        dt.Columns.Add(new DataColumn("AreaName", typeof(string)));
        dt.Columns.Add(new DataColumn("AreaId", typeof(string)));
        PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
        object  areaData = areaInfo.GetPhoneAreaData(HttpContext.Current);
        DataSet pad      = (DataSet)areaData;

        DataRow[] rows = pad.Tables["Area"].Select("ProvinceID='" + ProvinceID + "'");
        for (int i = 0; i < rows.Length; i++)
        {
            DataRow dr = dt.NewRow();
            dr["AreaName"] = rows[i]["AreaName"].ToString();
            dr["AreaId"]   = rows[i]["AreaId"].ToString();

            dt.Rows.Add(dr);
        }

        return(dt);
    }
Example #5
0
    public static bool PhoneNumValid(HttpContext context, string PhoneNum, out string OutPhone)
    {
        bool result = true;

        OutPhone = "";

/*
 *          //string dStyle = @"^0\d{2,3}[1-9]\d{6,7}$";
 *          string dStyle = @"^(\d{3,4}\d{7,8})$";
 *          if (CommonUtility.ValidateStr(PhoneNum, dStyle))
 *          {
 *              result = false;
 *          }
 *          if (PhoneNum.Length != 11 & PhoneNum.Length != 12)
 *          {
 *              result = false;
 *          }
 */
        string dStyle = @"^(\d{3,4}\d{7,8})$";

        if (!CommonUtility.ValidateStr(PhoneNum, dStyle))
        {
            result = false;
        }
        string leftStr = PhoneNum.Substring(0, 1);

        if (leftStr == "0")
        {
            string leftStr2 = PhoneNum.Substring(1, 1);
            string leftStr3 = PhoneNum.Substring(2, 1);
            switch (leftStr2)
            {
            case "1":
                if (leftStr3 == "0")
                {
                    if (PhoneNum.Length == 11)
                    {
                        OutPhone = PhoneNum;
                        result   = true;
                    }
                    else
                    {
                        result = false;
                    }
                }
                else
                {
                    if (PhoneNum.Length == 12)
                    {
                        OutPhone = PhoneNum.Substring(1, 11);
                        string LeftPhone = OutPhone.Substring(0, 1);
                        if (LeftPhone == "0")
                        {
                            PhoneAreaInfoManager Pam = new PhoneAreaInfoManager();
                            //HttpContext context
                            Object SPData = Pam.GetPhoneAreaData(context);

                            string areaname = Pam.GetProvinceIDByPhoneNumber(OutPhone, SPData);
                            if (areaname == "")
                            {
                                result = false;
                            }
                            else
                            {
                                result = true;
                            }
                        }
                    }
                    else
                    {
                        result = false;
                    }
                }
                break;

            case "2":
                if (PhoneNum.Length == 11)
                {
                    OutPhone = PhoneNum;
                    result   = true;
                }
                else
                {
                    result = false;
                }
                break;

            default:
                if (PhoneNum.Length == 12 || PhoneNum.Length == 11)
                {
                    OutPhone = PhoneNum;
                    result   = true;
                }
                else
                {
                    result = false;
                }
                break;
            }
        }
        else if (leftStr == "1")
        {
            if (PhoneNum.Length != 11)
            {
                result = false;
            }
            OutPhone = PhoneNum;
        }
        else
        {
            result = false;
        }

        return(result);
    }
Example #6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        err_username.InnerHtml   = "";
        err_phone_code.InnerHtml = "";
        err_page_code.InnerHtml  = "";
        err_email.InnerHtml      = "";
        err_password.InnerHtml   = "";
        Top1.Welcome             = "号码百事通用户注册";
        backCount.Value          = Convert.ToString((Convert.ToInt32(backCount.Value) - 1));

        if (!Page.IsPostBack)
        {
            //地区联动--start
            ProvinceInfoManager proInfo = new ProvinceInfoManager();
            object  ProData             = proInfo.GetProvinceData(this.Context);
            DataSet ds = (DataSet)ProData;
            this.proInfoList.DataSource     = ds;
            this.proInfoList.DataTextField  = "ProvinceName";
            this.proInfoList.DataValueField = "ProvinceID";
            this.proInfoList.DataBind();

            //PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            //object areaData = areaInfo.GetPhoneAreaData(this.Context);
            //PhoneAreaData pad = (PhoneAreaData)areaData;
            //this.areaInfoList.DataSource = pad;
            //this.areaInfoList.DataTextField = "AreaName";
            //this.areaInfoList.DataValueField = "AreaID";
            //this.areaInfoList.DataBind();
            ListItem li = new ListItem("请选择", "-999");
            proInfoList.Items.Add(li);
            proInfoList.SelectedIndex = proInfoList.Items.Count - 1;



            //this.areaInfoList.Items.Add("北京");
            this.areaInfoList.Items.Add(li);
            areaInfoList.SelectedIndex = areaInfoList.Items.Count - 1;

            //地区联动--end

            if (!CommonBizRules.IsUrlParams(HttpContext.Current.Request.Url.OriginalString))
            {
                //  CommonBizRules.ErrorHappenedRedircet(-1, "URL参数不存在", "用户注册", this.Context);
            }
            //SPID = HttpUtility.HtmlDecode(Request.QueryString["SPID"].ToString());
            //ReturnUrl = HttpUtility.HtmlDecode(Request.QueryString["ReturnUrl"].ToString());
            SPID      = Request["SPID"] == null ? ConstHelper.DefaultInstance.BesttoneSPID : HttpUtility.HtmlDecode(Request["SPID"]);
            ReturnUrl = Request["ReturnUrl"] == null ? ConstHelper.DefaultInstance.BesttoneLoginPage : HttpUtility.HtmlDecode(Request["ReturnUrl"]);
            HiddenField_SPID.Value = SPID;
            HiddenField_URL.Value  = ReturnUrl;

            btn_OK.Attributes.Add("onclick", "return CheckInput();");
            CertificateType.Attributes.Add("onchange", "f_show()");
            //CertificateType.Attributes["onchange"] = "javascript:showText()";
            //RegisterStartupScript("Startup", "<script language='javascript'>function window.onload(){showText();}</" + "script>");
        }

        if (proInfoList.SelectedIndex != proInfoList.Items.Count - 1)
        {
            PhoneAreaInfoManager areaInfo = new PhoneAreaInfoManager();
            object        areaData        = areaInfo.GetPhoneAreaData(this.Context, proInfoList.Value);
            PhoneAreaData pad             = (PhoneAreaData)areaData;
            this.areaInfoList.DataSource     = pad;
            this.areaInfoList.DataTextField  = "AreaName";
            this.areaInfoList.DataValueField = "AreaID";
            this.areaInfoList.DataBind();
        }
        else
        {
            areaInfoList.Value = "请选择";
        }
    }