protected void btnReg_Click(object sender, EventArgs e)
 {
     if (this.CheckCodeReg.Visible)
     {
         if (this.tbRegCheckCode.Text.Trim() == "")
         {
             JavaScript.Alert(this.Page, "请输入验证码!");
             return;
         }
         if (!this.ShoveCheckCode2.Valid(this.tbRegCheckCode.Text.Trim()))
         {
             JavaScript.Alert(this.Page, "验证码输入有误!");
             return;
         }
     }
     long num = -1L;
     long num2 = -1L;
     string pID = "";
     FirstUrl url = new FirstUrl();
     string str2 = url.Get();
     if (!str2.StartsWith("http://"))
     {
         char ch = '?';
         str2 = ("http://" + str2).Split(ch.ToString().ToCharArray())[0];
     }
     DataTable table = new Tables.T_Cps().Open("id, [ON], [Name]", "SiteID = " + base._Site.ID.ToString() + " and( DomainName = '" + str2 + "' or DomainName='" + Shove._Web.Utility.GetUrl() + "')", "");
     if (_Convert.StrToLong(url.CpsID, -1L) > 0L)
     {
         num = _Convert.StrToLong(url.CpsID, -1L);
     }
     else if ((table != null) && (table.Rows.Count > 0))
     {
         num = _Convert.StrToLong(table.Rows[0]["ID"].ToString(), -1L);
         pID = url.PID;
     }
     Thread.Sleep(500);
     string str3 = this.tbRegUserName.Text.Trim();
     string str4 = this.tbFormPassword.Text.Trim();
     this.tbPassword2.Text.Trim();
     string str5 = this.tbEmail.Text.Trim();
     string str6 = this.tbRealityName.Text.Trim();
     Users users = new Users(base._Site.ID)
     {
         Name = str3,
         Password = str4,
         Email = str5,
         RealityName = str6,
         UserType = 2,
         CommenderID = num2,
         CpsID = num,
         Memo = pID
     };
     string returnDescription = "";
     if (users.Add(ref returnDescription) < 0)
     {
         new Log("Users").Write("会员注册不成功:" + returnDescription);
         JavaScript.Alert(this, returnDescription);
     }
     else if (users.Login(ref returnDescription) < 0)
     {
         new Log("Users").Write("注册成功后登录失败:" + returnDescription);
         JavaScript.Alert(this, returnDescription);
     }
     else
     {
         base.Response.Redirect("UserRegSuccess.aspx");
     }
 }
Exemple #2
0
    protected void btnReg_Click(object sender, EventArgs e)
    {
        if (CheckCodeReg.Visible)
        {
            if (tbRegCheckCode.Text.Trim() == "")
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入验证码!");

                return;
            }
        }

        long CpsID = -1;
        long CommenderID = -1;
        string Memo = "";
        FirstUrl firstUrl = new FirstUrl();
        string URL = firstUrl.Get();

        if (!URL.StartsWith("http://"))
        {
            URL = "http://" + URL;
            URL = URL.Split('?'.ToString().ToCharArray())[0];
        }

        DataTable dt = new DAL.Tables.T_Cps().Open("id, [ON], [Name]", "SiteID = " + _Site.ID.ToString() + " and( DomainName = '" + URL + "' or DomainName='" + Shove._Web.Utility.GetUrl() + "')", "");

        if (Shove._Convert.StrToLong(firstUrl.CpsID, -1) > 0) //读取第一次访问页面时保存的CPS ID
        {
            CpsID = Shove._Convert.StrToLong(firstUrl.CpsID, -1);
        }
        else if ((dt != null) && (dt.Rows.Count > 0))
        {
            CpsID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);
            Memo = firstUrl.PID;//联盟商推广URL的PID
        }

        System.Threading.Thread.Sleep(500);

        string Name = tbRegUserName.Text.Trim();
        string Password = tbFormPassword.Text.Trim();
        string Password2 = tbPassword2.Text.Trim();
        string Email = tbEmail.Text.Trim();
        string RealityName = tbRealityName.Text.Trim();
        //string IDCardNumber = tbIDCardNumber.Text.Trim();

        Users user = new Users(_Site.ID);

        user.Name = Name;
        user.Password = Password;
        user.Email = Email;
        user.RealityName = RealityName;
        //user.IDCardNumber = IDCardNumber;
        user.UserType = 2;
        user.CommenderID = CommenderID;
        user.CpsID = CpsID;
        user.Memo = Memo;

        string ReturnDescription = "";
        int Result = user.Add(ref ReturnDescription);

        if (Result < 0)
        {
            new Log("Users").Write("会员注册不成功:" + ReturnDescription);
            Shove._Web.JavaScript.Alert(this, ReturnDescription);

            return;
        }

        Result = user.Login(ref ReturnDescription);

        if (Result < 0)
        {
            new Log("Users").Write("注册成功后登录失败:" + ReturnDescription);
            Shove._Web.JavaScript.Alert(this, ReturnDescription);

            return;
        }
        //if (this.ckbHomePage.Checked == true)
        //{
 
        //}
        Response.Redirect("Home/Room/UserRegSuccess.aspx");
    }
Exemple #3
0
    protected void btnOK_Click(object sender, EventArgs e)
    {
        if (tbName.Text.Trim() == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入用户名。");

            return;
        }

        if (string.IsNullOrEmpty(tbRealityName.Text.Trim()))
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入真实姓名。");

            return;
        }

        if (CheckCode.Visible)
        {
            if (tbCheckCode.Text.Trim() == "")
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入验证码!");

                return;
            }
            else
            {
                if (!ShoveCheckCode1.Valid(tbCheckCode.Text.Trim()))
                {
                    Shove._Web.JavaScript.Alert(this.Page, "验证码输入有误!");

                    return;
                }
            }

        }

        System.Threading.Thread.Sleep(500);

        Sites site = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];

        if (site == null)
        {
            return;
        }

        long CpsID = -1;
        string URL = new FirstUrl().Get();
        if (!URL.StartsWith("http://"))
        {
            URL = "http://" + URL;
            URL = URL.Split('?'.ToString().ToCharArray())[0];
        }
        DataTable dt = new DAL.Tables.T_Cps().Open("id, [ON], [Name]", "SiteID = " + _Site.ID.ToString() + " and DomainName = '" + URL + "' or DomainName='" + Shove._Web.Utility.GetUrl() + "'", "");

        if ((dt != null) && (dt.Rows.Count > 0))
        {
            if (Shove._Convert.StrToBool(dt.Rows[0]["ON"].ToString(), false))
            {
                CpsID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);
            }
        }

        string Password = GetRandPassword();

        Users user = new Users(site.ID);

        user.Name = tbName.Text.Trim();
        user.RealityName = tbRealityName.Text.Trim();
        user.Password = Password;
        user.PasswordAdv = Password;
        user.CityID = 1;
        user.Email = labAccount.Text.Trim();
        user.ComeFrom = 4;
        user.UserType = 2;
        user.CpsID = CpsID;
        user.CommenderID = -1;

        string ReturnDescription = "";

        if (user.Add(ref ReturnDescription) < 0)
        {
            Shove._Web.JavaScript.Alert(this.Page, ReturnDescription + "用户添加失败");

            return;
        }

        DAL.Tables.T_Users T_Users = new DAL.Tables.T_Users();
        T_Users.AlipayName.Value = labAccount.Text;
        T_Users.AlipayID.Value = hidUserID.Value;
        T_Users.isAlipayNameValided.Value = true;
        T_Users.Update("[ID] = " + user.ID.ToString());

        user.LoginDirect(ref ReturnDescription);

        this.Response.Redirect("UserRegSuccess.aspx", true);
    }
 protected void btnOK_Click(object sender, EventArgs e)
 {
     if (this.tbName.Text.Trim() == "")
     {
         JavaScript.Alert(this.Page, "请输入用户名。");
     }
     else if (this.tbPassword.Text == "")
     {
         JavaScript.Alert(this.Page, "请输入用户密码。");
     }
     else if (this.tbPassword.Text.Length < 6)
     {
         JavaScript.Alert(this.Page, "用户密码长度不足 6 位。");
     }
     else if (this.tbPassword.Text != this.tbPassword2.Text)
     {
         JavaScript.Alert(this.Page, "输入的两次密码不一致。");
     }
     else
     {
         if (this.CheckCode.Visible)
         {
             if (this.tbCheckCode.Text.Trim() == "")
             {
                 JavaScript.Alert(this.Page, "请输入验证码!");
                 return;
             }
             if (!this.ShoveCheckCode1.Valid(this.tbCheckCode.Text.Trim()))
             {
                 JavaScript.Alert(this.Page, "验证码输入有误!");
                 return;
             }
         }
         Thread.Sleep(500);
         Sites sites = new Sites()[Shove._Web.Utility.GetUrlWithoutHttp()];
         if (sites != null)
         {
             long num = -1L;
             string str = new FirstUrl().Get();
             if (!str.StartsWith("http://"))
             {
                 char ch = '?';
                 str = ("http://" + str).Split(ch.ToString().ToCharArray())[0];
             }
             DataTable table = new Tables.T_Cps().Open("id, [ON], [Name]", "SiteID = " + base._Site.ID.ToString() + " and DomainName = '" + str + "' or DomainName='" + Shove._Web.Utility.GetUrl() + "'", "");
             if (((table != null) && (table.Rows.Count > 0)) && _Convert.StrToBool(table.Rows[0]["ON"].ToString(), false))
             {
                 num = _Convert.StrToLong(table.Rows[0]["ID"].ToString(), -1L);
             }
             string str2 = Shove._Web.Utility.GetRequest("real_name").Trim();
             Users users = new Users(sites.ID)
             {
                 Name = this.tbName.Text.Trim(),
                 RealityName = str2,
                 Password = this.tbPassword.Text.Trim(),
                 PasswordAdv = this.tbPassword.Text.Trim(),
                 CityID = 1,
                 Email = this.labAccount.Text.Trim(),
                 ComeFrom = 4,
                 UserType = 2,
                 CpsID = num,
                 CommenderID = -1L
             };
             string returnDescription = "";
             if (users.Add(ref returnDescription) < 0)
             {
                 JavaScript.Alert(this.Page, returnDescription + "用户添加失败");
             }
             else
             {
                 Member member = new Member();
                 string realityName = "";
                 long num2 = member.Query(this.labAccount.Text, ref realityName);
                 if (num2 < 0L)
                 {
                     JavaScript.Alert(this.Page, "输入的账号在支付宝网站验证失败(不存在账号或者网络通讯故障," + num2.ToString() + "),请重新填写一个账号名称。");
                 }
                 else
                 {
                     new Tables.T_Users { AlipayID = { Value = this.tbAlipayID.Text }, AlipayName = { Value = this.labAccount.Text }, isAlipayNameValided = { Value = true } }.Update("[ID] = " + users.ID.ToString());
                     users.LoginDirect(ref returnDescription);
                     long buyID = -1L;
                     if ((base.Request.Url.AbsoluteUri.IndexOf("?BuyID") > 0) && (base.Request.Url.AbsoluteUri.IndexOf("&") > 0))
                     {
                         buyID = _Convert.StrToLong(HttpUtility.UrlDecode(base.Request.Url.AbsoluteUri).Split(new char[] { '?' })[1].Split(new char[] { '&' })[0].Replace("BuyID=", ""), -1L);
                     }
                     if (buyID > 0L)
                     {
                         this.GoBuy(buyID);
                     }
                     else
                     {
                         base.Response.Redirect("UserRegSuccess.aspx", true);
                     }
                 }
             }
         }
     }
 }
Exemple #5
0
    protected void btnReg_Click(object sender, EventArgs e)
    {
        if (tbRegCheckCode.Text.Trim() == "")
        {
            Shove._Web.JavaScript.Alert(this.Page, "请输入验证码!");

            return;
        }

        string RegCode = tbRegCheckCode.Text.Trim().ToLower();

        if (Shove._Web.Cache.GetCacheAsString("CheckCode_" + Request.Cookies["ASP.NET_SessionId"].Value, "") != Shove._Security.Encrypt.MD5(PF.GetCallCert() + RegCode))
        {
            Shove._Web.JavaScript.Alert(this.Page, "验证码输入错误,请重新输入!");

            return;
        }

        long CpsID = -1;
        long CommenderID = -1;
        string Memo = "";

        FirstUrl firstUrl = new FirstUrl();
        string URL = firstUrl.Get();

        if (!URL.StartsWith("http://"))
        {
            URL = "http://" + URL;
            URL = URL.Split('?'.ToString().ToCharArray())[0];
        }

        DataTable dt = new DAL.Tables.T_Cps().Open("id, [ON], [Name]", "SiteID = " + _Site.ID.ToString() + " and( DomainName = '" + URL + "' or DomainName='" + Shove._Web.Utility.GetUrl() + "')", "");

        if (Shove._Convert.StrToLong(firstUrl.CpsID, -1) > 0) //读取第一次访问页面时保存的CPS ID
        {
            CpsID = Shove._Convert.StrToLong(firstUrl.CpsID, -1);
        }
        else if ((dt != null) && (dt.Rows.Count > 0))
        {
            CpsID = Shove._Convert.StrToLong(dt.Rows[0]["ID"].ToString(), -1);
            Memo = firstUrl.PID;//联盟商推广URL的PID
        }

        System.Threading.Thread.Sleep(500);

        string Name = TBUserName.Text.Trim();
        string Password = TBPwdOne.Text.Trim();
        string Password2 = TBPwdTwo.Text.Trim();
        string Email = TBUserMail.Text.Trim();
        string RealityName = tbRealityName.Text.Trim();
        string Mobile = TBMobile.Text.Trim();

        Users user = new Users(_Site.ID);

        user.Name = Name;
        user.Password = Password;
        user.Email = Email;
        user.RealityName = RealityName;
        user.UserType = 2;
        user.Mobile = Mobile;

        if (!string.IsNullOrEmpty(hidCity.Value))
        {
            DataTable dtCity = new DAL.Views.V_Citys().Open("ID", "City='" + hidCity.Value.Substring(0, hidCity.Value.Length - 1) + "'", "");

            if (dtCity != null && dtCity.Rows.Count == 1)
            {
                user.CityID = Shove._Convert.StrToInt(dtCity.Rows[0]["ID"].ToString(), 1);
            }
        }

        dt = new DAL.Tables.T_Users().Open("", "id=" + Shove._Web.Utility.GetRequest("CID") + " and Name='" + Shove._Web.Utility.GetRequest("CN") + "'", "");

        if ((dt != null) && (dt.Rows.Count == 1))
        {
            CommenderID = Shove._Convert.StrToLong(Shove._Web.Utility.GetRequest("CID"), -1);
        }

        user.CommenderID = CommenderID;
        user.CpsID = CpsID;
        user.Memo = Memo;

        string ReturnDescription = "";
        int Result = user.Add(ref ReturnDescription);

        if (Result < 0)
        {
            new Log("Users").Write("会员注册不成功:" + ReturnDescription);
            Shove._Web.JavaScript.Alert(this, ReturnDescription);

            return;
        }

        Result = user.Login(ref ReturnDescription);

        if (Result < 0)
        {
            new Log("Users").Write("注册成功后登录失败:" + ReturnDescription);
            Shove._Web.JavaScript.Alert(this, ReturnDescription);

            return;
        }
     
        Response.Redirect("Home/Room/UserRegSuccess.aspx");
    }