Exemple #1
0
        public OptionValue this[string Key]
        {
            get
            {
                DataTable dt = null;

                try
                {
                    dt = new DAL.Tables.T_Sites().Open(ConnectionString, "[" + Key + "]", "[ID] = " + SiteID.ToString(), "");
                }
                catch { }

                if (dt == null)
                {
                    throw new Exception("T_Sites 表读取发生错误,请检查数据连接或者数据库是否完整");
                }

                if (dt.Rows.Count < 1)
                {
                    throw new Exception("没有读到站点 ID 为 " + SiteID.ToString() + " 的站点信息");
                }

                return(new OptionValue(dt.Rows[0][Key]));
            }
        }
Exemple #2
0
        public OptionValue this[string Key]
        {
            get
            {
                DataTable dt = null;

                try
                {
                    dt = new DAL.Tables.T_Sites().Open(ConnectionString, "[" + Key + "]", "[ID] = " + SiteID.ToString(), "");
                }
                catch { }

                if (dt == null)
                {
                    throw new Exception("T_Sites 表读取发生错误,请检查数据连接或者数据库是否完整");
                }

                if (dt.Rows.Count < 1)
                {
                    throw new Exception("没有读到站点 ID 为 " + SiteID.ToString() + " 的站点信息");
                }

                return new OptionValue(dt.Rows[0][Key]);
            }
        }
Exemple #3
0
    private void MenuByStatus()
    {
        bool isLogin = _User == null ? false : true;

        bool      isAllowPromotion = false;
        DataTable dt = new DAL.Tables.T_Sites().Open("Opt_Promotion_Status_ON", "", "");

        if (dt != null && dt.Rows.Count > 0)
        {
            isAllowPromotion = bool.Parse(dt.Rows[0]["Opt_Promotion_Status_ON"].ToString());
        }
    }
Exemple #4
0
    private void BindData()
    {
        DataTable dt = new DAL.Tables.T_Sites().Open("[ID], [Name]", "", "[Level], [ID]");

        if (dt == null)
        {
            PF.GoError(ErrorNumber.DataReadWrite, "数据库繁忙,请重试", "Admin_UserAddMoney");

            return;
        }

        Shove.ControlExt.FillDropDownList(ddlSites, dt, "Name", "ID");
    }
Exemple #5
0
    private void GetSchemeBonusScalec()
    {
        string bScalec;
        //获得站点选项中的佣金比率
        DataTable dt = new DAL.Tables.T_Sites().Open("Opt_InitiateSchemeBonusScale,Opt_InitiateSchemeLimitLowerScaleMoney,Opt_InitiateSchemeLimitLowerScale,Opt_InitiateSchemeLimitUpperScaleMoney,Opt_InitiateSchemeLimitUpperScale", "", "");

        //把佣金比率换成整数
        bScalec = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeBonusScale"].ToString(), 0) * 100).ToString();

        //发起方案条件
        string Opt_InitiateSchemeLimitLowerScaleMoney = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitLowerScaleMoney"].ToString(), 100)).ToString();
        string Opt_InitiateSchemeLimitLowerScale      = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitLowerScale"].ToString(), 0.2)).ToString();
        string Opt_InitiateSchemeLimitUpperScaleMoney = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitUpperScaleMoney"].ToString(), 10000)).ToString();
        string Opt_InitiateSchemeLimitUpperScale      = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitUpperScale"].ToString(), 0.05)).ToString();

        SchemeSchemeBonusScalec.Value = "{'bScalec': '" + bScalec + "','LScaleMoney': '" + Opt_InitiateSchemeLimitLowerScaleMoney + "','LScale': '" + Opt_InitiateSchemeLimitLowerScale + "' ,'UScaleMoney': '" + Opt_InitiateSchemeLimitUpperScaleMoney + "', 'UpperScale': '" + Opt_InitiateSchemeLimitUpperScale + "'}";
    }
Exemple #6
0
    public string GetSchemeBonusScalec()
    {
        string bScalec;
        //获得站点选项中的佣金比率
        DataTable dt = new DAL.Tables.T_Sites().Open("Opt_InitiateSchemeBonusScale,Opt_InitiateSchemeLimitLowerScaleMoney,Opt_InitiateSchemeLimitLowerScale,Opt_InitiateSchemeLimitUpperScaleMoney,Opt_InitiateSchemeLimitUpperScale", "", "");

        //把佣金比率换成整数
        bScalec = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeBonusScale"].ToString(), 0) * 100).ToString();

        //发起方案条件
        string Opt_InitiateSchemeLimitLowerScaleMoney = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitLowerScaleMoney"].ToString(), 100)).ToString();
        string Opt_InitiateSchemeLimitLowerScale      = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitLowerScale"].ToString(), 0.2)).ToString();
        string Opt_InitiateSchemeLimitUpperScaleMoney = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitUpperScaleMoney"].ToString(), 10000)).ToString();
        string Opt_InitiateSchemeLimitUpperScale      = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitUpperScale"].ToString(), 0.05)).ToString();

        return(bScalec + "|" + Opt_InitiateSchemeLimitLowerScaleMoney + "|" + Opt_InitiateSchemeLimitLowerScale + "|" + Opt_InitiateSchemeLimitUpperScaleMoney + "|" + Opt_InitiateSchemeLimitUpperScale + "|时时彩");
    }
    public string GetSchemeBonusScalec(int lotteryId)
    {
        string bScalec;
        //获得站点选项中的佣金比率
        DataTable dt = new DAL.Tables.T_Sites().Open("Opt_InitiateSchemeBonusScale,Opt_InitiateSchemeLimitLowerScaleMoney,Opt_InitiateSchemeLimitLowerScale,Opt_InitiateSchemeLimitUpperScaleMoney,Opt_InitiateSchemeLimitUpperScale", "", "");

        //把佣金比率换成整数
        bScalec = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeBonusScale"].ToString(), 0) * 100).ToString();

        //发起方案条件
        string Opt_InitiateSchemeLimitLowerScaleMoney = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitLowerScaleMoney"].ToString(), 100)).ToString();
        string Opt_InitiateSchemeLimitLowerScale      = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitLowerScale"].ToString(), 0.2)).ToString();
        string Opt_InitiateSchemeLimitUpperScaleMoney = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitUpperScaleMoney"].ToString(), 10000)).ToString();
        string Opt_InitiateSchemeLimitUpperScale      = (Shove._Convert.StrToDouble(dt.Rows[0]["Opt_InitiateSchemeLimitUpperScale"].ToString(), 0.05)).ToString();

        string lotteryName = DataCache.Lotteries[lotteryId];
        int    number      = 0;

        return(bScalec + "|" + Opt_InitiateSchemeLimitLowerScaleMoney + "|" + Opt_InitiateSchemeLimitLowerScale + "|" + Opt_InitiateSchemeLimitUpperScaleMoney + "|" + Opt_InitiateSchemeLimitUpperScale + "|" + lotteryId.ToString() + "|" + lotteryName + "|" + number.ToString());
    }
Exemple #8
0
    public string this[string Manner, string NotificationType]
    {
        get
        {
            if ((Site == null) || (Site.ID < 1))
            {
                throw new Exception("没有初始化 SiteNotificationTemplates 类的 Site 变量");
            }

            if ((Manner != "SMS") && (Manner != "Email") && (Manner != "StationSMS"))
            {
                throw new Exception("SiteNotificationTemplates 类的通知方式 Manner 变量的值超出的范围,它的范围是:1 (SMS)手机短信 2 Email 3 (StationSMS)站内信");
            }

            string    SystemPreFix  = "SiteOptions_";
            DataTable dt            = null;
            bool      InApplication = true;

            try
            {
                dt = (DataTable)System.Web.HttpContext.Current.Application[SystemPreFix + this.Site.ID.ToString()];
            }
            catch { }

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                InApplication = false;

                dt = new DAL.Tables.T_Sites().Open("", "[ID] = " + Site.ID.ToString(), "");
            }

            if (dt == null)
            {
                throw new Exception("SiteNotificationTemplates 类读取数据错误,请检查数据库连接设置");
            }

            if (dt.Rows.Count < 1)
            {
                throw new Exception("SiteNotificationTemplates 类的 Site 变量值不在有效范围之内");
            }

            if (!InApplication)
            {
                try
                {
                    System.Web.HttpContext.Current.Application.Lock();
                    System.Web.HttpContext.Current.Application.Add(SystemPreFix + this.Site.ID.ToString(), dt);
                }
                catch { }
                finally
                {
                    try
                    {
                        System.Web.HttpContext.Current.Application.UnLock();
                    }
                    catch { }
                }
            }

            string Result = dt.Rows[0]["Template" + Manner + "_" + NotificationType].ToString().Replace("[SiteName]", Site.Name).Replace("[SiteUrl]", Site.Url);

            return(Result);
        }
        set
        {
            if ((Site == null) || (Site.ID < 1))
            {
                throw new Exception("没有初始化 SiteNotificationTemplates 类的 Site 变量");
            }

            string sql    = @"update T_Sites set [Template" + Manner + "_" + NotificationType + "] = @Value where [ID]=@ID";
            int    Result = MSSQL.ExecuteNonQuery(sql,
                                                  new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, value),
                                                  new MSSQL.Parameter("ID", SqlDbType.BigInt, 0, ParameterDirection.Input, Site.ID));
            if (Result < 0)
            {
                throw new Exception("SiteNotificationTemplates 类读取数据错误,请检查数据库连接设置。如果数据库连接设置没有问题,可能是 NotificationType 变量的值不在有效范围之内");
            }

            string SystemPreFix = "SiteOptions_";

            try
            {
                System.Web.HttpContext.Current.Application.Lock();
                System.Web.HttpContext.Current.Application.Remove(SystemPreFix + this.Site.ID.ToString());
            }
            catch { }
            finally
            {
                try
                {
                    System.Web.HttpContext.Current.Application.UnLock();
                }
                catch { }
            }
        }
    }
Exemple #9
0
    public OptionValue this[string Key]
    {
        get
        {
            //if (Site == null)
            //{
            //    throw new Exception("没有初始化 SiteOptions 类的 Site 变量");
            //}

            string    SystemPreFix  = "SiteOptions_";
            DataTable dt            = null;
            bool      InApplication = true;

            try
            {
                dt = (DataTable)System.Web.HttpContext.Current.Application[SystemPreFix + this.Site.ID.ToString()];
            }
            catch { }

            if ((dt == null) || (dt.Rows.Count < 1))
            {
                InApplication = false;

                dt = new DAL.Tables.T_Sites().Open("", "[ID] = " + Site.ID.ToString(), "");
            }

            if (dt == null)
            {
                throw new Exception("T_Sites 表读取发生错误,请检查数据连接或者数据库是否完整");
            }

            if (dt.Rows.Count < 1)
            {
                throw new Exception("没有读到站点 ID 为 " + Site.ID.ToString() + " 的站点信息");
            }

            if (!InApplication)
            {
                try
                {
                    System.Web.HttpContext.Current.Application.Lock();
                    System.Web.HttpContext.Current.Application.Add(SystemPreFix + this.Site.ID.ToString(), dt);
                }
                catch { }
                finally
                {
                    try
                    {
                        System.Web.HttpContext.Current.Application.UnLock();
                    }
                    catch { }
                }
            }

            return(new OptionValue(dt.Rows[0][Key]));
        }
        set
        {
            if ((Site == null) || (Site.ID < 1))
            {
                throw new Exception("没有初始化 SiteOptions 类的 Site 变量");
            }

            DataTable dt = new DAL.Tables.T_Sites().Open(Key, "[ID] = " + Site.ID.ToString(), "");

            if (dt == null)
            {
                throw new Exception("T_Sites 表读取发生错误,请检查数据连接或者是否该表拥有 " + Key + " 字段");
            }

            if (dt.Rows.Count < 1)
            {
                throw new Exception("没有读到站点 ID 为 " + Site.ID.ToString() + " 的站点信息");
            }

            switch (dt.Columns[0].DataType.Name)
            {
            case "Byte[]":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, value.Value.ToString())) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            case "String":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, value.Value)) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            case "Int16":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.SmallInt, 0, ParameterDirection.Input, value.Value)) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            case "Int32":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.Int, 0, ParameterDirection.Input, value.Value)) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            case "Int64":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.BigInt, 0, ParameterDirection.Input, value.Value)) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            case "Decimal":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.Money, 0, ParameterDirection.Input, value.Value)) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            case "Boolean":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.Bit, 0, ParameterDirection.Input, value.Value)) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            case "Double":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + Site.ID.ToString(),
                                          new MSSQL.Parameter("Value", SqlDbType.Float, 0, ParameterDirection.Input, value.Value)) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            default:
                throw new Exception("设置站点属性 " + Key + " 发生异常");
            }

            string SystemPreFix = "SiteOptions_";

            try
            {
                System.Web.HttpContext.Current.Application.Lock();
                System.Web.HttpContext.Current.Application.Remove(SystemPreFix + this.Site.ID.ToString());
            }
            catch { }
            finally
            {
                try
                {
                    System.Web.HttpContext.Current.Application.UnLock();
                }
                catch { }
            }
        }
    }
    protected void btnReg_Click(object sender, EventArgs e)
    {
        //检查输入
        string inputErrorInfo = "";

        if (!PF.CheckUserName(tbUserName.Text))
        {
            inputErrorInfo += "对不起用户名中含有禁止使用的字符.\r\n";
        }

        if (Shove._String.GetLength(tbUserName.Text) < 5 || Shove._String.GetLength(tbUserName.Text) > 16)
        {
            inputErrorInfo += "用户名长度在 5-16 个英文字符或数字、中文 3-8 之间.\r\n";
        }

        if (tbPassword.Text.Length < 6 || tbPassword.Text.Length > 16)
        {
            inputErrorInfo += "密码长度必须在 6-16 位之间.\r\n";
        }

        if (tbSiteName.Text.Trim().Length == 0)
        {
            inputErrorInfo += "网站名称不能为空.\r\n";
        }
        if (tbSiteURL.Text.Trim().Length == 0)
        {
            inputErrorInfo += "网站地址不能为空.\r\n";
        }

        if (!Shove._String.Valid.isEmail(tbEmail.Text))
        {
            inputErrorInfo += "电子邮件地址格式不正确.\r\n";
        }
        if (!ckbAgree.Checked)
        {
            inputErrorInfo += "必须同意本站会员注册协议才能注册会员。\r\n";
        }

        if (CheckCode2.Visible)
        {
            if (tbCheckCode.Text.Trim() == "")
            {
                inputErrorInfo += "请输入验证码!\n";
            }
            else
            {
                if (!ShoveCheckCode1.Valid(tbCheckCode.Text.Trim()))
                {
                    inputErrorInfo += "验证码输入有误!\n";
                }
            }
        }

        if (inputErrorInfo != "")
        {
            lblInputError.Visible = true;
            lblInputError.Text    = "输入资料错误:\r\n" + inputErrorInfo;
            return;
        }

        long CpsID       = -1;
        long CommenderID = -1;

        if (Session[KeyPromotionUserID] != null)
        {
            CommenderID = Shove._Convert.StrToLong(Session[KeyPromotionUserID].ToString(), -1);
        }


        //检查推荐人是否为CPS商家,是就把此会员标记CSPID
        object tempOjb = Shove.Database.MSSQL.ExecuteScalar("select ID from T_Cps where OwnerUserID=" + CommenderID, new Shove.Database.MSSQL.Parameter[0]);

        if (tempOjb != null)
        {
            CpsID = Shove._Convert.StrToLong(tempOjb.ToString(), -1);
        }

        System.Threading.Thread.Sleep(500);

        string Name     = tbUserName.Text.Trim();
        string Password = tbPassword.Text.Trim();
        string Email    = tbEmail.Text.Trim();
        string Mobile   = tbTel.Text.Trim();
        string QQ       = tbQQ.Text.Trim();


        Users user = new Users(_Site.ID);

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


        if (CpsID > 0)//推荐人为cps商家就填CpsID字段
        {
            user.CommenderID = -1;
            user.CpsID       = CpsID;
        }
        else
        {
            user.CommenderID = CommenderID;
            user.CpsID       = -1;
        }

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

        if (Result < 0)
        {
            Shove._Web.JavaScript.Alert(this, ReturnDescription);

            return;
        }
        else //注册成功,加入CPS站长商家
        {
            double    cpsBonusScale = 0.00;
            DataTable dtTemp        = new DAL.Tables.T_Sites().Open("Opt_CpsBonusScale", "", "");
            if (dtTemp != null && dtTemp.Rows.Count > 0)
            {
                cpsBonusScale = double.Parse(dtTemp.Rows[0]["Opt_CpsBonusScale"].ToString());
            }
            user.cps.SiteID    = 1;
            user.cps.CommendID = CommenderID;

            user.cps.Name       = tbSiteName.Text;
            user.cps.Url        = tbSiteURL.Text;
            user.cps.BonusScale = cpsBonusScale;
            user.cps.ON         = true;

            user.cps.Telephone  = tbTel.Text.Trim();
            user.cps.Email      = Email;
            user.cps.QQ         = QQ;
            user.cps.Type       = 2;
            user.cps.DomainName = user.GetPromotionURL(0);

            if (user.cps.Add(ref ReturnDescription) < 0)
            {
                Shove._Web.JavaScript.Alert(this, ReturnDescription);

                return;
            }
        }

        Result = user.Login(ref ReturnDescription);

        if (Result < 0)
        {
            Shove._Web.JavaScript.Alert(this, ReturnDescription);

            return;
        }

        Response.Redirect("../../Default.aspx");
    }