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

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

                    c.Save();

                    ConfigGlobal.Refresh();
                }

                gvSysConfig.EditIndex = -1;

                BindData();
            }
            catch (Exception ex)
            {
                ClientScript.RegisterClientScriptBlock(typeof(string), "failed", $"alert('{ex.Message}');", true);
            }
        }
Exemplo n.º 2
0
        // GET: Home/Refresh
        public ActionResult Refresh()
        {
            Service.Model.Config.UpdateAssemblyInfo(Assembly.GetExecutingAssembly());

            ConfigGlobal.Refresh();
            Service.Scheduler.Schedule.Cache.RefreshCache();

            CameraSource.Cache.RefreshCache();

            return(RedirectToAction("Index", "Home"));
        }
Exemplo n.º 3
0
        public void Execute(object state)
        {
            try
            {
                ConfigGlobal.Refresh();
                Schedule.Cache.RefreshCache();

                CameraSource.Cache.RefreshCache();

                ExamineSchedulerException();

                _log.Info("Scheduler executed: (RefreshCache)");
            }
            catch (Exception ex)
            {
                _log.Warn("Scheduler failed: (RefreshCache)");
                _log.Error(ex);
            }
        }
Exemplo n.º 4
0
        public JsonResult Config(string key, string value)
        {
            if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value))
            {
                var config = _repo.Single <Config>(x => x.ConfigKey == key && x.ConfigSystem == ConfigSystem.Reservation.ToString());

                if (config != null)
                {
                    config.ConfigValue = value;

                    config.Save();

                    ConfigGlobal.Refresh();
                    ConfigGlobalSecureNode.Refresh();

                    return(Json("Success"));
                }
            }

            return(Json("Failed"));
        }
Exemplo n.º 5
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.iArsenal);

                ConfigGlobal.Refresh();

                Arsenal_Match.Cache.RefreshCache();
                Arsenal_Player.Cache.RefreshCache();
                Arsenal_Team.Cache.RefreshCache();

                MatchTicket.Cache.RefreshCache();
                Member.Cache.RefreshCache();
                Product.Cache.RefreshCache();
                Showcase.Cache.RefreshCache();

                // Clean Log
                Log.Clean();

                // Clean QrCode Files
                CleanQrCodeFiles();

                _log.Info("Scheduler End: (RefreshCache)", logInfo);
            }
            catch (Exception ex)
            {
                _log.Warn(ex, logInfo);
            }
        }
Exemplo n.º 6
0
        protected void btnRefreshCache_Click(object sender, EventArgs e)
        {
            try
            {
                ConfigGlobal.Refresh();

                Arsenal_Match.Cache.RefreshCache();
                Arsenal_Player.Cache.RefreshCache();
                Arsenal_Team.Cache.RefreshCache();

                MatchTicket.Cache.RefreshCache();
                Member.Cache.RefreshCache();
                Product.Cache.RefreshCache();
                Showcase.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);
            }
        }
Exemplo n.º 7
0
        public JsonResult Config(string key, string value)
        {
            if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value))
            {
                using (IRepository repo = new Repository())
                {
                    var config = repo.Single <Config>(x => x.ConfigKey == key);

                    if (config != null)
                    {
                        config.ConfigValue = value;

                        repo.Save(config);

                        ConfigGlobal.Refresh();

                        return(Json("Success"));
                    }
                }
            }

            return(Json("Failed"));
        }
Exemplo n.º 8
0
        public void Execute(object state)
        {
            var logInfo = new LogInfo
            {
                MethodInstance = MethodBase.GetCurrentMethod(),
                ThreadInstance = Thread.CurrentThread
            };

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

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

                ConfigGlobal.Refresh();
                ConfigGlobalSecureNode.Refresh();

                Delivery.Cache.RefreshCache();
                Menu.Cache.RefreshCache();

                // 删除30天前的无效订单记录
                Order.Clean(-30);

                OperationStandard.Cache.RefreshCache();
                OperationStandardDto.Cache.RefreshCache();

                // 删除30天前的无效安全检查记录
                CheckList.Clean(-30);

                _log.Info("Scheduler End: (RefreshCache)", logInfo);
            }
            catch (Exception ex)
            {
                _log.Warn(ex, logInfo);
            }
        }