Exemple #1
0
        private void MenuByStatus()
        {
            Users     users1 = base._User;
            DataTable table  = new Tables.T_Sites().Open("Opt_Promotion_Status_ON", "", "");

            if ((table != null) && (table.Rows.Count > 0))
            {
                bool.Parse(table.Rows[0]["Opt_Promotion_Status_ON"].ToString());
            }
        }
    public string GetSchemeBonusScalec()
    {
        DataTable table = new Tables.T_Sites().Open("Opt_InitiateSchemeBonusScale,Opt_InitiateSchemeLimitLowerScaleMoney,Opt_InitiateSchemeLimitLowerScale,Opt_InitiateSchemeLimitUpperScaleMoney,Opt_InitiateSchemeLimitUpperScale", "", "");
        string    str   = (_Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeBonusScale"].ToString(), 0.0) * 100.0).ToString();
        string    str2  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitLowerScaleMoney"].ToString(), 100.0).ToString();
        string    str3  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitLowerScale"].ToString(), 0.2).ToString();
        string    str4  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitUpperScaleMoney"].ToString(), 10000.0).ToString();
        string    str5  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitUpperScale"].ToString(), 0.05).ToString();

        return(str + "|" + str2 + "|" + str3 + "|" + str4 + "|" + str5 + "|浙江体彩6+1");
    }
Exemple #3
0
        public string GetSchemeBonusScalec(int lotteryId)
        {
            DataTable table = new Tables.T_Sites().Open("Opt_InitiateSchemeBonusScale,Opt_InitiateSchemeLimitLowerScaleMoney,Opt_InitiateSchemeLimitLowerScale,Opt_InitiateSchemeLimitUpperScaleMoney,Opt_InitiateSchemeLimitUpperScale", "", "");
            string    str   = (_Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeBonusScale"].ToString(), 0.0) * 100.0).ToString();
            string    str2  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitLowerScaleMoney"].ToString(), 100.0).ToString();
            string    str3  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitLowerScale"].ToString(), 0.2).ToString();
            string    str4  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitUpperScaleMoney"].ToString(), 10000.0).ToString();
            string    str5  = _Convert.StrToDouble(table.Rows[0]["Opt_InitiateSchemeLimitUpperScale"].ToString(), 0.05).ToString();
            string    str6  = DataCache.Lotteries[lotteryId];
            int       num6  = 0;

            return(str + "|" + str2 + "|" + str3 + "|" + str4 + "|" + str5 + "|" + lotteryId.ToString() + "|" + str6 + "|" + num6.ToString());
        }
    private void BindData()
    {
        DataTable dt = new Tables.T_Sites().Open("[ID], [Name]", "", "[Level], [ID]");

        if (dt == null)
        {
            PF.GoError(4, "数据库繁忙,请重试", "Admin_UserAddMoney");
        }
        else
        {
            ControlExt.FillDropDownList(this.ddlSites, dt, "Name", "ID");
        }
    }
Exemple #5
0
    public OptionValue this[string Key]
    {
        get
        {
            string    str   = "SiteOptions_";
            DataTable table = null;
            bool      flag  = true;
            try
            {
                table = (DataTable)HttpContext.Current.Application[str + this.Site.ID.ToString()];
            }
            catch
            {
            }
            if ((table == null) || (table.Rows.Count < 1))
            {
                flag  = false;
                table = new Tables.T_Sites().Open("", "[ID] = " + this.Site.ID.ToString(), "");
            }
            if (table == null)
            {
                throw new Exception("T_Sites 表读取发生错误,请检查数据连接或者数据库是否完整");
            }
            if (table.Rows.Count < 1)
            {
                throw new Exception("没有读到站点 ID 为 " + this.Site.ID.ToString() + " 的站点信息");
            }
            if (!flag)
            {
                try
                {
                    HttpContext.Current.Application.Lock();
                    HttpContext.Current.Application.Add(str + this.Site.ID.ToString(), table);
                }
                catch
                {
                }
                finally
                {
                    try
                    {
                        HttpContext.Current.Application.UnLock();
                    }
                    catch
                    {
                    }
                }
            }
            return(new OptionValue(table.Rows[0][Key]));
        }
        set
        {
            if ((this.Site == null) || (this.Site.ID < 1L))
            {
                throw new Exception("没有初始化 SiteOptions 类的 Site 变量");
            }
            DataTable table = new Tables.T_Sites().Open(Key, "[ID] = " + this.Site.ID.ToString(), "");
            if (table == null)
            {
                throw new Exception("T_Sites 表读取发生错误,请检查数据连接或者是否该表拥有 " + Key + " 字段");
            }
            if (table.Rows.Count < 1)
            {
                throw new Exception("没有读到站点 ID 为 " + this.Site.ID.ToString() + " 的站点信息");
            }
            switch (table.Columns[0].DataType.Name)
            {
            case "Byte[]":
                if (MSSQL.ExecuteNonQuery("update T_Sites set " + Key + " = @Value where [ID] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { 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] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { 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] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { 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] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { 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] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { 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] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { 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] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { 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] = " + this.Site.ID.ToString(), new MSSQL.Parameter[] { new MSSQL.Parameter("Value", SqlDbType.Float, 0, ParameterDirection.Input, value.Value) }) < 0)
                {
                    throw new Exception("设置站点属性 " + Key + " 发生异常");
                }
                break;

            default:
                throw new Exception("设置站点属性 " + Key + " 发生异常");
            }
            string str2 = "SiteOptions_";
            try
            {
                HttpContext.Current.Application.Lock();
                HttpContext.Current.Application.Remove(str2 + this.Site.ID.ToString());
            }
            catch
            {
            }
            finally
            {
                try
                {
                    HttpContext.Current.Application.UnLock();
                }
                catch
                {
                }
            }
        }
    }
Exemple #6
0
    protected void btnReg_Click(object sender, EventArgs e)
    {
        string str = "";

        if (!PF.CheckUserName(this.tbUserName.Text))
        {
            str = str + "对不起用户名中含有禁止使用的字符.\r\n";
        }
        if ((_String.GetLength(this.tbUserName.Text) < 5) || (_String.GetLength(this.tbUserName.Text) > 0x10))
        {
            str = str + "用户名长度在 5-16 个英文字符或数字、中文 3-8 之间.\r\n";
        }
        if ((this.tbPassword.Text.Length < 6) || (this.tbPassword.Text.Length > 0x10))
        {
            str = str + "密码长度必须在 6-16 位之间.\r\n";
        }
        if (this.tbSiteName.Text.Trim().Length == 0)
        {
            str = str + "网站名称不能为空.\r\n";
        }
        if (this.tbSiteURL.Text.Trim().Length == 0)
        {
            str = str + "网站地址不能为空.\r\n";
        }
        if (!_String.Valid.isEmail(this.tbEmail.Text))
        {
            str = str + "电子邮件地址格式不正确.\r\n";
        }
        if (!this.ckbAgree.Checked)
        {
            str = str + "必须同意本站会员注册协议才能注册会员。\r\n";
        }
        if (this.CheckCode2.Visible)
        {
            if (this.tbCheckCode.Text.Trim() == "")
            {
                str = str + "请输入验证码!\n";
            }
            else if (!this.ShoveCheckCode1.Valid(this.tbCheckCode.Text.Trim()))
            {
                str = str + "验证码输入有误!\n";
            }
        }
        if (str != "")
        {
            this.lblInputError.Visible = true;
            this.lblInputError.Text    = "输入资料错误:\r\n" + str;
        }
        else
        {
            long num  = -1L;
            long num2 = -1L;
            if (this.Session[this.KeyPromotionUserID] != null)
            {
                num2 = _Convert.StrToLong(this.Session[this.KeyPromotionUserID].ToString(), -1L);
            }
            object obj2 = MSSQL.ExecuteScalar("select ID from T_Cps where OwnerUserID=" + num2, new MSSQL.Parameter[0]);
            if (obj2 != null)
            {
                num = _Convert.StrToLong(obj2.ToString(), -1L);
            }
            Thread.Sleep(500);
            string str2  = this.tbUserName.Text.Trim();
            string str3  = this.tbPassword.Text.Trim();
            string str4  = this.tbEmail.Text.Trim();
            string str5  = this.tbTel.Text.Trim();
            string str6  = this.tbQQ.Text.Trim();
            Users  users = new Users(base._Site.ID)
            {
                Name     = str2,
                Password = str3,
                Email    = str4,
                Mobile   = str5,
                QQ       = str6,
                UserType = 2
            };
            if (num > 0L)
            {
                users.CommenderID = -1L;
                users.CpsID       = num;
            }
            else
            {
                users.CommenderID = num2;
                users.CpsID       = -1L;
            }
            string returnDescription = "";
            if (users.Add(ref returnDescription) < 0)
            {
                JavaScript.Alert(this, returnDescription);
            }
            else
            {
                double    num4  = 0.0;
                DataTable table = new Tables.T_Sites().Open("Opt_CpsBonusScale", "", "");
                if ((table != null) && (table.Rows.Count > 0))
                {
                    num4 = double.Parse(table.Rows[0]["Opt_CpsBonusScale"].ToString());
                }
                users.cps.SiteID     = 1L;
                users.cps.CommendID  = num2;
                users.cps.Name       = this.tbSiteName.Text;
                users.cps.Url        = this.tbSiteURL.Text;
                users.cps.BonusScale = num4;
                users.cps.ON         = true;
                users.cps.Telephone  = this.tbTel.Text.Trim();
                users.cps.Email      = str4;
                users.cps.QQ         = str6;
                users.cps.Type       = 2;
                users.cps.DomainName = users.GetPromotionURL(0);
                if (users.cps.Add(ref returnDescription) < 0)
                {
                    JavaScript.Alert(this, returnDescription);
                }
                else if (users.Login(ref returnDescription) < 0)
                {
                    JavaScript.Alert(this, returnDescription);
                }
                else
                {
                    base.Response.Redirect("../../Default.aspx");
                }
            }
        }
    }
Exemple #7
0
 public string this[string Manner, string NotificationType]
 {
     get
     {
         if ((this.Site == null) || (this.Site.ID < 1L))
         {
             throw new Exception("没有初始化 SiteNotificationTemplates 类的 Site 变量");
         }
         if (((Manner != "SMS") && (Manner != "Email")) && (Manner != "StationSMS"))
         {
             throw new Exception("SiteNotificationTemplates 类的通知方式 Manner 变量的值超出的范围,它的范围是:1 (SMS)手机短信 2 Email 3 (StationSMS)站内信");
         }
         string    str   = "SiteOptions_";
         DataTable table = null;
         bool      flag  = true;
         try
         {
             table = (DataTable)HttpContext.Current.Application[str + this.Site.ID.ToString()];
         }
         catch
         {
         }
         if ((table == null) || (table.Rows.Count < 1))
         {
             flag  = false;
             table = new Tables.T_Sites().Open("", "[ID] = " + this.Site.ID.ToString(), "");
         }
         if (table == null)
         {
             throw new Exception("SiteNotificationTemplates 类读取数据错误,请检查数据库连接设置");
         }
         if (table.Rows.Count < 1)
         {
             throw new Exception("SiteNotificationTemplates 类的 Site 变量值不在有效范围之内");
         }
         if (!flag)
         {
             try
             {
                 HttpContext.Current.Application.Lock();
                 HttpContext.Current.Application.Add(str + this.Site.ID.ToString(), table);
             }
             catch
             {
             }
             finally
             {
                 try
                 {
                     HttpContext.Current.Application.UnLock();
                 }
                 catch
                 {
                 }
             }
         }
         return(table.Rows[0]["Template" + Manner + "_" + NotificationType].ToString().Replace("[SiteName]", this.Site.Name).Replace("[SiteUrl]", this.Site.Url));
     }
     set
     {
         if ((this.Site == null) || (this.Site.ID < 1L))
         {
             throw new Exception("没有初始化 SiteNotificationTemplates 类的 Site 变量");
         }
         if ((!(Manner == "SMS") && !(Manner == "Email")) && !(Manner == "StationSMS"))
         {
             throw new Exception("SiteNotificationTemplates 类的通知方式 Manner 变量的值超出的范围,它的范围是:1 (SMS)手机短信 2 Email 3 (StationSMS)站内信");
         }
         if (MSSQL.ExecuteNonQuery("update T_Sites set [Template" + Manner + "_" + NotificationType + "] = @Value where [ID]=@ID", new MSSQL.Parameter[] { new MSSQL.Parameter("Value", SqlDbType.VarChar, 0, ParameterDirection.Input, value), new MSSQL.Parameter("ID", SqlDbType.BigInt, 0, ParameterDirection.Input, this.Site.ID) }) < 0)
         {
             throw new Exception("SiteNotificationTemplates 类读取数据错误,请检查数据库连接设置。如果数据库连接设置没有问题,可能是 NotificationType 变量的值不在有效范围之内");
         }
         string str2 = "SiteOptions_";
         try
         {
             HttpContext.Current.Application.Lock();
             HttpContext.Current.Application.Remove(str2 + this.Site.ID.ToString());
         }
         catch
         {
         }
         finally
         {
             try
             {
                 HttpContext.Current.Application.UnLock();
             }
             catch
             {
             }
         }
     }
 }