protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            BSSetting bsSettingWidgetPositions = BSSetting.GetSetting("widgetpositions");

            if (bsSettingWidgetPositions != null)
            {
                string[] strPositions = bsSettingWidgetPositions.Value.Split('|');
                if (strPositions.Length > 1)
                {
                    string[] strLeft  = strPositions[0].Split(',');
                    string[] strRight = strPositions[1].Split(',');
                    for (int i = 0; i < strLeft.Length; i++)
                    {
                        try
                        {
                            if (strLeft[i].Trim() != "")
                            {
                                phLeftPanel.Controls.Add(Page.LoadControl("Widgets/" + strLeft[i] + ".ascx"));
                            }
                        }
                        catch { }
                    }
                    for (int i = 0; i < strRight.Length; i++)
                    {
                        try
                        {
                            if (strRight[i].Trim() != "")
                            {
                                phRightPanel.Controls.Add(Page.LoadControl("Widgets/" + strRight[i] + ".ascx"));
                            }
                        }
                        catch { }
                    }
                }
            }
            else
            {
                try
                {
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/Now.ascx"));
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/RecentComments.ascx"));
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/HitPosts.ascx"));
                    phRightPanel.Controls.Add(Page.LoadControl("Widgets/QuickPost.ascx"));
                    phRightPanel.Controls.Add(Page.LoadControl("Widgets/BlogsaNews.ascx"));
                }
                catch { }

                BSSetting bsSetting = new BSSetting();
                bsSetting.Name  = "widgetpositions";
                bsSetting.Value = "Now,RecentComments,HitPosts|QuickPost,BlogsaNews";
                bsSetting.Save();
            }
        }
        catch (System.Exception ex)
        {
            ltError.Text = ex.Message;
        }
    }
    public static BSSetting GetSetting(int iSettingID)
    {
        BSSetting bsSetting = new BSSetting();

        using (DataProcess dp = new DataProcess())
        {
            dp.AddParameter("SettingID", iSettingID);

            dp.ExecuteReader("SELECT * FROM Settings WHERE SettingID = @SettingID");

            if (dp.Return.Status == DataProcessState.Success)
            {
                using (IDataReader dr = dp.Return.Value as IDataReader)
                {
                    if (dr.Read())
                    {
                        FillValue(dr, bsSetting);

                        return(bsSetting);
                    }
                }
            }
        }

        return(null);
    }
    public static List <BSSetting> GetThemeSettings(string themeName)
    {
        List <BSSetting> _Settings = new List <BSSetting>();

        using (DataProcess dp = new DataProcess())
        {
            dp.AddParameter("Name", themeName);

            dp.ExecuteReader("SELECT * FROM Settings WHERE Name LIKE @Name + '_%'");

            if (dp.Return.Status == DataProcessState.Success)
            {
                using (IDataReader dr = dp.Return.Value as IDataReader)
                {
                    while (dr.Read())
                    {
                        BSSetting bsSetting = new BSSetting();

                        FillValue(dr, bsSetting);

                        _Settings.Add(bsSetting);
                    }
                }
            }
        }

        return(_Settings);
    }
    public static BSSettings GetSettings()
    {
        BSSettings settings = new BSSettings();

        using (DataProcess dp = new DataProcess())
        {
            dp.ExecuteReader("SELECT * FROM Settings");

            if (dp.Return.Status == DataProcessState.Success)
            {
                using (IDataReader dr = dp.Return.Value as IDataReader)
                {
                    while (dr.Read())
                    {
                        BSSetting bsSetting = new BSSetting();

                        FillValue(dr, bsSetting);

                        settings.Add(bsSetting);
                    }
                }
            }
        }

        return(settings);
    }
Beispiel #5
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        foreach (Control control in phThemeSettings.Controls)
        {
            Admin_Content_EditControl ec = (Admin_Content_EditControl)control;

            string settingName = String.Format("{0}_{1}", BSTheme.Current.Name, ec.Key);

            BSSetting s = BSSetting.GetSetting(settingName) ?? new BSSetting();

            s.Main    = false;
            s.Title   = ec.Title;
            s.Name    = settingName;
            s.Value   = ec.Value;
            s.Visible = false;

            if (s.Save())
            {
                if (Blogsa.Settings[settingName] != null)
                {
                    Blogsa.Settings[settingName] = s;
                }
                else
                {
                    Blogsa.Settings.Add(s);
                }

                BSTheme.Current.Settings[ec.Key].Value = s.Value;
            }
        }

        MessageBox1.Message = Language.Admin["SettingSaved"];
        MessageBox1.Type    = MessageBox.ShowType.Information;
    }
 private static void FillValue(IDataReader dr, BSSetting bsSetting)
 {
     bsSetting.SettingID   = Convert.ToInt32(dr["SettingID"]);
     bsSetting.Name        = dr["Name"].ToString();
     bsSetting.Value       = dr["Value"].ToString();
     bsSetting.Title       = dr["Title"].ToString();
     bsSetting.Description = dr["Description"].ToString();
     bsSetting.Main        = Convert.ToBoolean(dr["Main"]);
     bsSetting.Sort        = Convert.ToInt32(dr["Sort"]);
     bsSetting.Visible     = Convert.ToBoolean(dr["Visible"]);
 }
Beispiel #7
0
    void Hanlde_ArcInsertCoin(uint count, int ctrllerID)
    {
        if (!mIsEnteringBackstage)
        {
            int num = (int)count;

            Players[mPControllerIDToPlayerID[ctrllerID]].ChangeScore(num * BSSetting.InsertCoinScoreRatio.Val);

            BSSetting.His_CoinInsert.Val  += num;
            BSSetting.His_GainCurrent.Val += num;
            BSSetting.UpdateGainCurrentAndTotal();
        }
    }
    private void SaveValue(string name, string value)
    {
        BSSetting setting = BSSetting.GetSetting(name);

        if (setting != null)
        {
            setting.Value = value;
            if (setting.Save())
            {
                Blogsa.Settings[setting.Name].Value = value;
            }
        }
    }
Beispiel #9
0
    protected void rpAllThemes_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "UseTheme")
        {
            BSSetting bsSetting = BSSetting.GetSetting("theme");
            bsSetting.Value = e.CommandArgument.ToString();

            if (bsSetting.Save())
            {
                Blogsa.ActiveTheme  = bsSetting.Value;
                BSTheme.Current     = null;
                MessageBox1.Message = Language.Admin["ThemeUpgraded"];
                Response.Redirect("Design.aspx");
            }
        }
    }
Beispiel #10
0
    //检查游戏剩余时间
    IEnumerator _Coro_CheckRemainRunTime()
    {
        yield return(0);

        while (true)
        {
            if (BSSetting.GetRemainRuntime() <= 0)
            {
                //显示到时消息
                for (int i = 0; i != ScreenNumUsing; ++i)
                {
                    GameObject goErrBG = Instantiate(Prefab_SprGameErrorBG) as GameObject;
                    goErrBG.transform.parent = transform;

                    goErrBG.transform.localPosition = new Vector3(WorldDimension.x + (0.5F + i) * Defines.WorldDimensionUnit.width, mLocalY_remainTimeZero, 0.03F);
                    tk2dTextMesh textErr = Instantiate(Prefab_TextGameError) as tk2dTextMesh;
                    textErr.transform.parent        = goErrBG.transform;
                    textErr.transform.localPosition = new Vector3(0F, 0F, -0.001F);
                    textErr.text = LI_RunTimeout.CurrentText;// "运行时间到,    请延时 21";
                    textErr.Commit();
                }


                while (true)
                {
                    foreach (Player p in Players)
                    {
                        p.GunInst.Fireable = false;
                    }

                    yield return(0);
                }
            }

            yield return(new WaitForSeconds(30F));
        }
    }
Beispiel #11
0
    public static BSSetting GetSetting(int iSettingID)
    {
        BSSetting bsSetting = new BSSetting();

        using (DataProcess dp = new DataProcess())
        {
            dp.AddParameter("SettingID", iSettingID);

            dp.ExecuteReader("SELECT * FROM Settings WHERE SettingID = @SettingID");

            if (dp.Return.Status == DataProcessState.Success)
            {
                using (IDataReader dr = dp.Return.Value as IDataReader)
                {
                    if (dr.Read())
                    {
                        FillValue(dr, bsSetting);

                        return bsSetting;
                    }
                }
            }
        }

        return null;
    }
Beispiel #12
0
 private static void FillValue(IDataReader dr, BSSetting bsSetting)
 {
     bsSetting.SettingID = Convert.ToInt32(dr["SettingID"]);
     bsSetting.Name = dr["Name"].ToString();
     bsSetting.Value = dr["Value"].ToString();
     bsSetting.Title = dr["Title"].ToString();
     bsSetting.Description = dr["Description"].ToString();
     bsSetting.Main = Convert.ToBoolean(dr["Main"]);
     bsSetting.Sort = Convert.ToInt32(dr["Sort"]);
     bsSetting.Visible = Convert.ToBoolean(dr["Visible"]);
 }
Beispiel #13
0
    public static BSSettings GetSettings()
    {
        BSSettings settings = new BSSettings();

        using (DataProcess dp = new DataProcess())
        {
            dp.ExecuteReader("SELECT * FROM Settings");

            if (dp.Return.Status == DataProcessState.Success)
            {
                using (IDataReader dr = dp.Return.Value as IDataReader)
                {
                    while (dr.Read())
                    {
                        BSSetting bsSetting = new BSSetting();

                        FillValue(dr, bsSetting);

                        settings.Add(bsSetting);
                    }
                }
            }
        }

        return settings;
    }
Beispiel #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            BSSetting bsSettingWidgetPositions = BSSetting.GetSetting("widgetpositions");

            if (bsSettingWidgetPositions != null)
            {
                string[] strPositions = bsSettingWidgetPositions.Value.Split('|');
                if (strPositions.Length > 1)
                {
                    string[] strLeft = strPositions[0].Split(',');
                    string[] strRight = strPositions[1].Split(',');
                    for (int i = 0; i < strLeft.Length; i++)
                    {
                        try
                        {
                            if (strLeft[i].Trim() != "")
                            {
                                phLeftPanel.Controls.Add(Page.LoadControl("Widgets/" + strLeft[i] + ".ascx"));
                            }
                        }
                        catch { }

                    }
                    for (int i = 0; i < strRight.Length; i++)
                    {
                        try
                        {
                            if (strRight[i].Trim() != "")
                            {
                                phRightPanel.Controls.Add(Page.LoadControl("Widgets/" + strRight[i] + ".ascx"));
                            }
                        }
                        catch { }
                    }
                }
            }
            else
            {
                try
                {
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/Now.ascx"));
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/RecentComments.ascx"));
                    phLeftPanel.Controls.Add(Page.LoadControl("Widgets/HitPosts.ascx"));
                    phRightPanel.Controls.Add(Page.LoadControl("Widgets/QuickPost.ascx"));
                    phRightPanel.Controls.Add(Page.LoadControl("Widgets/BlogsaNews.ascx"));
                }
                catch { }

                BSSetting bsSetting = new BSSetting();
                bsSetting.Name = "widgetpositions";
                bsSetting.Value = "Now,RecentComments,HitPosts|QuickPost,BlogsaNews";
                bsSetting.Save();
            }
        }
        catch (System.Exception ex)
        {
            ltError.Text = ex.Message;
        }
    }