Beispiel #1
0
 protected void btn_OK_Click(object sender, EventArgs e)
 {
     if (!PF.IsSystemRegister())
     {
         PF.GoError(ErrorNumber.DataReadWrite, "请联系网站管理员输入软件序列号", this.GetType().BaseType.FullName);
         return;
     }
     Buy(_User);
 }
Beispiel #2
0
 protected void btn_OK_Click(object sender, EventArgs e)
 {
     if (!PF.IsSystemRegister())
     {
         PF.GoError(4, "请联系网站管理员输入软件序列号", base.GetType().BaseType.FullName);
     }
     else
     {
         this.Buy(base._User);
     }
 }
Beispiel #3
0
    /// <summary>
    /// 注册提交
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnReg_Click(object sender, EventArgs e)
    {
        if (!PF.IsSystemRegister())
        {
            PF.GoError(ErrorNumber.DataReadWrite, "请联系网站管理员输入软件序列号", this.GetType().BaseType.FullName);
            return;
        }

        if (ckbAgree.Visible)
        {
            if (YZMcode.Value.Trim() == "")
            {
                Shove._Web.JavaScript.Alert(this.Page, "请输入验证码!");
                return;
            }
            else
            {
                string CheckCode = "";
                try
                {
                    CheckCode = this.Session["CheckCode"].ToString();
                }
                catch
                {
                    Shove._Web.JavaScript.Alert(this.Page, "验证码输入错误!");
                    return;
                }

                if (YZMcode.Value.Trim().ToUpper() != CheckCode.ToUpper())
                {
                    Shove._Web.JavaScript.Alert(this.Page, "验证码输入错误!");
                }
            }
        }

        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      = this.userName.Value.Trim();
        string Password  = this.passwordOne.Value.Trim();
        string Password2 = this.passwordTwo.Value.Trim();
        string Email     = this.email.Value.Trim();
        Users  user      = new Users(_Site.ID);

        user.Name     = Name;
        user.Password = Password;
        user.Email    = Email;
        user.UserType = 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("UserRegemail.aspx");
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        if (!PF.IsSystemRegister())
        {
            PF.GoError(4, "请联系网站管理员输入软件序列号", base.GetType().BaseType.FullName);
        }
        else
        {
            int    isuseCount = _Convert.StrToInt(this.HidIsuseCount.Value, -1);
            int    lotteryID  = _Convert.StrToInt(this.HidLotteryID.Value, -1);
            short  type       = _Convert.StrToShort(this.HidType.Value, -1);
            int    multiple   = _Convert.StrToInt(this.HidMultiple.Value, -1);
            int    nums       = _Convert.StrToInt(this.HidNums.Value, -1);
            short  betType    = _Convert.StrToShort(this.HidBetType.Value, -1);
            double money      = _Convert.StrToDouble(this.HidMoney.Value, -1.0);
            string request    = Shove._Web.Utility.GetRequest("tbTitle1");
            int    playType   = _Convert.StrToInt(this.HidPlayTypeID.Value, -1);
            if (string.IsNullOrEmpty(request))
            {
                request = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            }
            if ((((isuseCount < 0) || (lotteryID < 0)) || ((type < 0) || (multiple < 0))) || (((nums < 0) || (betType < 0)) || ((money < 0.0) || (playType < 0))))
            {
                JavaScript.Alert(this.Page, "投注信息有误!");
            }
            else if (base._User.Balance < money)
            {
                JavaScript.Alert(this.Page, "您的余额不足,请充值!");
            }
            else
            {
                int price = 2;
                if (playType == 0xf3f)
                {
                    price = 3;
                }
                if ((((isuseCount * multiple) * nums) * price) != money)
                {
                    JavaScript.Alert(this.Page, "投注总金额与投注倍数、注数、期数不相符!");
                }
                else
                {
                    DateTime now = DateTime.Now;
                    switch (type)
                    {
                    case 1:
                        now = now.AddMonths(1);
                        break;

                    case 2:
                        now = now.AddMonths(3);
                        break;

                    case 3:
                        now = now.AddMonths(6);
                        break;

                    case 4:
                        now = now.AddYears(1);
                        break;
                    }
                    string chaseXML = "";
                    if (betType != 1)
                    {
                        if (string.IsNullOrEmpty(this.HidLotteryNumber.Value))
                        {
                            JavaScript.Alert(this.Page, "发起追号套餐有异常!");
                            return;
                        }
                        if (multiple != _Convert.StrToInt(Shove._Web.Utility.GetRequest("selectMultiple"), 0))
                        {
                            JavaScript.Alert(this.Page, "投注倍数出现异常!");
                            return;
                        }
                        Lottery  lottery2  = new Lottery();
                        string[] strArray6 = this.SplitLotteryNumber(this.HidLotteryNumber.Value);
                        if ((strArray6 == null) || (strArray6.Length < 1))
                        {
                            JavaScript.Alert(this.Page, "选号发生异常,请重新选择号码投注,谢谢。");
                            return;
                        }
                        int num15 = 0;
                        foreach (string str5 in strArray6)
                        {
                            string str6 = lottery2[lotteryID].AnalyseScheme(str5, playType);
                            if (!string.IsNullOrEmpty(str6))
                            {
                                string[] strArray8 = str6.Split(new char[] { '|' });
                                if ((strArray8 != null) && (strArray8.Length >= 1))
                                {
                                    num15 += _Convert.StrToInt(strArray8[strArray8.Length - 1], 0);
                                }
                            }
                        }
                        if (num15 != nums)
                        {
                            JavaScript.Alert(this.Page, "选号发生异常,请重新选择号码投注,谢谢。");
                            return;
                        }
                    }
                    else
                    {
                        string[] strArray2;
                        if (nums != _Convert.StrToInt(Shove._Web.Utility.GetRequest("selectMultiple"), 0))
                        {
                            JavaScript.Alert(this.Page, "投注注数出现异常!");
                            return;
                        }
                        if (multiple != 1)
                        {
                            JavaScript.Alert(this.Page, "投注倍数出现异常!");
                            return;
                        }
                        this.HidLotteryNumber.Value = "";
                        chaseXML = "<ChaseDetails>";
                        Lottery lottery = new Lottery();
                        switch (lotteryID)
                        {
                        case 5:
                            strArray2 = lottery[5].BuildNumber(6, 1, nums * isuseCount).Split(new string[] { "\n" }, StringSplitOptions.None);
                            break;

                        case 0x27:
                            strArray2 = lottery[0x27].BuildNumber(5, 2, nums * isuseCount).Split(new string[] { "\n" }, StringSplitOptions.None);
                            break;

                        default:
                            strArray2 = lottery[lotteryID].BuildNumber(nums * isuseCount).Split(new string[] { "\n" }, StringSplitOptions.None);
                            break;
                        }
                        if (strArray2.Length != (nums * isuseCount))
                        {
                            JavaScript.Alert(this.Page, "随机生成号码时出现异常!");
                            return;
                        }
                        int    num12 = 1;
                        int    num13 = 0;
                        string str3  = "";
                        foreach (string str4 in strArray2)
                        {
                            str3 = str3 + str4 + "\n";
                            if ((num12 % nums) == 0)
                            {
                                chaseXML = chaseXML + "<Chase ChaseLotteryNumber=\"" + str3 + "\"/>";
                                num13++;
                                str3 = "";
                            }
                            num12++;
                        }
                        if (num13 != isuseCount)
                        {
                            JavaScript.Alert(this.Page, "随机生成号码时出现异常!");
                            return;
                        }
                        chaseXML = chaseXML + "</ChaseDetails>";
                    }
                    string returnDescription = "";
                    if (base._User.InitiateCustomChase(lotteryID, playType, price, type, now, isuseCount, multiple, nums, betType, this.HidLotteryNumber.Value, 1, 0.0, money, request, chaseXML, ref returnDescription) < 0)
                    {
                        JavaScript.Alert(this.Page, returnDescription);
                    }
                    else
                    {
                        Shove._Web.Cache.ClearCache("LotteryPackage_BindUsers");
                        Shove._Web.Cache.ClearCache(base._Site.ID.ToString() + "AccountFreezeDetail_" + base._User.ID.ToString());
                        Shove._Web.Cache.ClearCache("Home_Room_ViewChaseCombo_BindData" + base._User.ID.ToString());
                        JavaScript.Alert(this.Page, "定制追号套餐成功!", "LotteryPackage.aspx");
                    }
                }
            }
        }
    }
Beispiel #5
0
 protected void btnReg_Click(object sender, EventArgs e)
 {
     if (!PF.IsSystemRegister())
     {
         PF.GoError(4, "请联系网站管理员输入软件序列号", base.GetType().BaseType.FullName);
     }
     else if (this.CheckCodeReg.Visible && (this.tbRegCheckCode.Text.Trim() == ""))
     {
         JavaScript.Alert(this.Page, "请输入验证码!");
     }
     else
     {
         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("Home/Room/UserRegSuccess.aspx");
         }
     }
 }