示例#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();
        }
示例#2
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);
            }
        }
示例#3
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);
            }
        }