/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Application_BeginRequest(Object sender, EventArgs e) { //if ((DateTime.Now - new DateTime(2011, 4, 29)).TotalSeconds > 0) //{ // Response.Redirect("http://www.cdleichi.com/"); // Response.End(); //} //获取当前用户所在的IP城市 //string NowLoginCityName = new DealMvc.Core.Base.BLL_SiteCity.GetCityModel_New().city; //if (string.IsNullOrEmpty(DealMvc.Common.Globals.getCookie("SiteCityNewID"))) //{ // Model.SiteCity m_site = Model.SiteCity.GetModel(t => t.C_Title.lb_Like(NowLoginCityName) && t.C_Level==2); // if (m_site.C_Title != "西安市") // { // m_site = Model.SiteCity.GetModel(t => t.C_Title == "西安市"); // } // DealMvc.Common.Globals.setCookie("SiteCityNewID", m_site.id.ToString2()); //} Model.SiteInfo _SiteInfo = WebCacheHelper.GetSiteInfo(); if (DealMvc.WebCache.WebCache.IsUseWebCache != _SiteInfo.IsOpenDataCache) { DealMvc.WebCache.WebCache.IsUseWebCache = _SiteInfo.IsOpenDataCache; } if (DealMvc.WebCache.WebCache.WebCacheTime != (_SiteInfo.DataCacheTime ?? 0)) { DealMvc.WebCache.WebCache.WebCacheTime = _SiteInfo.DataCacheTime ?? 0; } }
/// <summary> /// 【网站配置】 /// </summary> /// <returns></returns> public static Model.SiteInfo GetSiteInfo() { SiteInfo _SiteInfo = new Model.SiteInfo(); string key_gc = "GetSiteInfoByModel"; object o_model = DealMvc.WebCache.WebCache.Get(key_gc); if (o_model == null) { _SiteInfo = Model.SiteInfo.GetModel(t => t.id != 0); DealMvc.WebCache.WebCache.Add(key_gc, _SiteInfo, WebCacheTime); } else { _SiteInfo = (Model.SiteInfo)o_model; } return(_SiteInfo ?? new Model.SiteInfo()); }