예제 #1
0
        /// <summary>
        /// 执行事件
        /// </summary>
        public ActionResult Execute(string key = "")
        {
            EventInfo eventInfo = BSPConfig.EventConfig.BSPEventList.Find(x => x.Key == key);

            if (eventInfo == null)
            {
                return(PromptView("事件不存在"));
            }

            BSPEvent.Execute(eventInfo.Key);

            ViewData["referer"] = ShopUtils.GetAdminRefererCookie();
            return(PromptView("事件执行成功"));
        }
예제 #2
0
        protected void Application_Start()
        {
            //将默认视图引擎替换为ThemeRazorViewEngine引擎
            ViewEngines.Engines.Clear();
            ViewEngines.Engines.Add(new ThemeRazorViewEngine());

            AreaRegistration.RegisterAllAreas();
            RegisterRoutes(RouteTable.Routes);

            //启动事件机制
            BSPEvent.Start();
            //服务器宕机启动后重置在线用户表
            if (Environment.TickCount > 0 && Environment.TickCount < 900000)
            {
                OnlineUsers.ResetOnlineUserTable();
            }
        }