Example #1
0
        protected void gvSysConfig_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            var tbConfigValue = gvSysConfig.Rows[gvSysConfig.EditIndex].Cells[1].Controls[0] as TextBox;

            if (tbConfigValue != null)
            {
                try
                {
                    var c = new Config
                    {
                        ConfigSystem = ConfigSystem.Arsenal,
                        ConfigKey    = gvSysConfig.DataKeys[gvSysConfig.EditIndex]?.Value.ToString(),
                        ConfigValue  = tbConfigValue.Text.Trim()
                    };

                    c.Save();

                    ConfigGlobal_Arsenal.Refresh();
                }
                catch (Exception ex)
                {
                    ClientScript.RegisterClientScriptBlock(typeof(string), "failed", $"alert('{ex.Message}');", true);
                }
            }

            gvSysConfig.EditIndex = -1;

            BindData();
        }
Example #2
0
        protected override void OnInitComplete(EventArgs e)
        {
            _adminPage        = true;
            AnonymousRedirect = true;

            base.OnInitComplete(e);

            if (!ConfigGlobal_Arsenal.IsPluginAdmin(UID))
            {
                Response.Redirect("Default.aspx");
            }
        }
Example #3
0
        public void Execute(object state)
        {
            var logInfo = new LogInfo
            {
                MethodInstance = MethodBase.GetCurrentMethod(),
                ThreadInstance = Thread.CurrentThread
            };

            //string _scheduleType = this.GetType().DeclaringType.FullName;

            try
            {
                log.Info("Scheduler Start: (RefreshCache)", logInfo);

                Config.UpdateAssemblyInfo(Assembly.GetExecutingAssembly(), ConfigSystem.Arsenal);

                ConfigGlobal_Arsenal.Refresh();

                RelationLeagueTeam.Clean();
                RelationLeagueTeam.Cache.RefreshCache();

                RelationGroupTeam.Clean();
                RelationLeagueTeam.Cache.RefreshCache();

                League.Cache.RefreshCache();
                Match.Cache.RefreshCache();
                Player.Cache.RefreshCache();
                Team.Cache.RefreshCache();
                Video.Cache.RefreshCache();

                //AcnCasino
                CasinoItem.Clean();
                ChoiceOption.Clean();
                Bet.Clean();
                BetDetail.Clean();

                // Clean Log
                Log.Clean();

                log.Info("Scheduler End: (RefreshCache)", logInfo);
            }
            catch (Exception ex)
            {
                log.Warn(ex, logInfo);
            }
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (UserID == -1)
            {
                phAnonymous.Visible = true;
            }
            else
            {
                phAnonymous.Visible = false;
            }

            if (ConfigGlobal_Arsenal.IsPluginAdmin(UserID))
            {
                pnlFuncLink.Visible = true;
            }
            else
            {
                pnlFuncLink.Visible = false;
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (ConfigGlobal_Arsenal.PluginActive)
            {
                //Response.Redirect("ArsenalPortal.aspx");
                //Response.Redirect("http://bbs.arsenalcn.com/plugin/acncasino/");
            }
            else
            {
                ltrlPluginName.Text = $"<strong>欢迎进入{ConfigGlobal_Arsenal.PluginDisplayName}</strong>";

                if (ConfigGlobal_Arsenal.IsPluginAdmin(UID))
                {
                    pnlAdmin.Visible = true;
                }
                else
                {
                    pnlAdmin.Visible = false;
                }
            }
        }
Example #6
0
        protected void btnRefreshCache_Click(object sender, EventArgs e)
        {
            try
            {
                ConfigGlobal_Arsenal.Refresh();

                RelationLeagueTeam.Clean();
                RelationLeagueTeam.Cache.RefreshCache();

                League.Cache.RefreshCache();
                Match.Cache.RefreshCache();
                Player.Cache.RefreshCache();
                Team.Cache.RefreshCache();
                Video.Cache.RefreshCache();

                ClientScript.RegisterClientScriptBlock(typeof(string), "succeed",
                                                       "alert('更新全部缓存成功');window.location.href=window.location.href", true);
            }
            catch (Exception ex)
            {
                ClientScript.RegisterClientScriptBlock(typeof(string), "failed", $"alert('{ex.Message}');", true);
            }
        }