Ejemplo n.º 1
0
        public static void CacheOrganization()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("Organization", "Organization_Read");
            cacheManager.RemoveItems("OPSOrganization", "Organization_Read");
        }
Ejemplo n.º 2
0
        public static void CacheIntran()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("Inventory", "InTran_Read");
            cacheManager.RemoveItems("InventorySKU", "InTran_Read");
        }
Ejemplo n.º 3
0
        public static void CacheSMS()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("SMSMT", "SMSMT_Read");
            cacheManager.RemoveItems("SMSMO", "SMSMO_Read");
        }
Ejemplo n.º 4
0
        public static void CacheCCR()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("CustomerCreationRequest");
            cacheManager.RemoveItems("ManageCreationRequest");
        }
Ejemplo n.º 5
0
        public static void CacheCreditRequest()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("CreditRequest");
            cacheManager.RemoveItems("ManageCreditRequest");
            cacheManager.RemoveItems("AddOrder");
        }
Ejemplo n.º 6
0
        public static void CacheBadDebt()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("CustomerResigned", "CustomerResigned_Read");
            cacheManager.RemoveItems("CustomerResigned", "RemindDayResigned_Read");
            cacheManager.RemoveItems("CustomerResigned", "RemindMinuteResigned_Read");
        }
Ejemplo n.º 7
0
        public static void CacheArea()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("Area");
            cacheManager.RemoveItems("MOPRegion");
            cacheManager.RemoveItems("MOPBranhch");
        }
Ejemplo n.º 8
0
        public void RemoveOutputCacheOnIndex()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems(ControllerName, "Index");
            cacheManager.RemoveItems(ControllerName, "List");
            cacheManager = null;
            GC.Collect();
        }
Ejemplo n.º 9
0
        public static void CacheOrders()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("Orders");
            cacheManager.RemoveItems("OrdersProcessing");
            cacheManager.RemoveItems("OrdersTransfer");
            cacheManager.RemoveItems("OrdersTrouble");
            cacheManager.RemoveItems("OrdersPayment");
        }
Ejemplo n.º 10
0
        protected override void OnException(ExceptionContext filterContext)
        {
            //Log the exception.
            LogHelper.Error <RenderMvcController>("Exception On Render", filterContext.Exception);
            ErrorSignal.FromCurrentContext().Raise(filterContext.Exception);
            //Email out
            var message      = $"<p>Url: {filterContext.HttpContext.Request.Url}  <br/><br/>" + $"Exception occured: {filterContext.Exception}</p>";
            var user         = WebConfigurationManager.AppSettings["ErrorEmailAddress"];
            var defaultEmail = WebConfigurationManager.AppSettings["DefaultSenderEmailAddress"] ?? "*****@*****.**";

            library.SendMail(defaultEmail, user, "Error Occurred", message, true);

            //Check if its been handled
            if (filterContext.ExceptionHandled)
            {
                return;
            }

            //Clear the cache if an error occurs.
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems();

            //Show the view error.
            filterContext.Result           = View("Error");
            filterContext.ExceptionHandled = true;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 清除缓存
        /// </summary>
        public ActionResult _ResetCache()
        {
            ICacheService cacheService = DIContainer.Resolve <ICacheService>();

            cacheService.Clear();
            OutputCacheManager outputCacheManager = new OutputCacheManager();

            outputCacheManager.RemoveItems();
            return(Redirect(SiteUrls.Instance().ControlPanelSuccess("执行成功", SiteUrls.Instance().ControlPanelTool())));
        }
Ejemplo n.º 12
0
        public virtual ActionResult Update(Series series)
        {
            if (!ModelState.IsValid)
            {
                return(View("Edit", series));
            }

            RavenSession.Store(series);

            OutputCacheManager.RemoveItems(MVC.Series.Name);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 13
0
 private void ClearCache()
 {
     try
     {
         //Clear all output cache so everything is refreshed.
         var cacheManager = new OutputCacheManager();
         cacheManager.RemoveItems();
     }
     catch (Exception ex)
     {
         LogHelper.Error <UmbracoEvents>(string.Format("Exception: {0} - StackTrace: {1}", ex.Message, ex.StackTrace), ex);
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Clears the MvcDonutCache
 /// </summary>
 private static void ClearCache()
 {
     try
     {
         var cacheManager = new OutputCacheManager();
         cacheManager.RemoveItems();
     }
     catch (Exception ex)
     {
         LogHelper.Error <UmbracoEvents>("Failed to clear MvcDonutCache", ex);
         throw;
     }
 }
Ejemplo n.º 15
0
 private void ClearCache()
 {
     try
     {
         //Clear all output cache so everything is refreshed.
         cacheManager.RemoveItems();
         HttpContext.Current.Cache.Remove("CachedBlogPostNodes");
     }
     catch (Exception ex)
     {
         LogHelper.Error <UmbracoEvents>(string.Format("Exception: {0} - StackTrace: {1}", ex.Message, ex.StackTrace), ex);
     }
 }
 private void ClearCache()
 {
     try
     {
         //Clear all output cache so everything is refreshed.
         var cacheManager = new OutputCacheManager();
         cacheManager.RemoveItems();
     }
     catch (Exception ex)
     {
         Log.Add(LogTypes.Error, -1, string.Format("Exception: {0} - StackTrace: {1}", ex.Message, ex.StackTrace));
     }
 }
Ejemplo n.º 17
0
        public virtual ActionResult SetPosition(string id, int newPosition)
        {
            var series = RavenSession.Load <Series>(id);

            if (series == null)
            {
                return(Json(new { success = false, message = string.Format("There is no post with id {0}", id) }));
            }


            OutputCacheManager.RemoveItems(MVC.Series.Name);

            return(Json(new { success = true }));
        }
Ejemplo n.º 18
0
        public int Save()
        {
            string PROCEDURE = "p_SaveDC_ProductList_Detail";

            SqlParameter[] parameters = new SqlParameter[9];
            int            i          = 0;

            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@ProductListID";
            parameters[i].Value         = this.ProductListID;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@MSIN";
            parameters[i].Value         = this.MSIN;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@Note";
            parameters[i].Value         = this.Note;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@Status";
            parameters[i].Value         = this.Status;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@Priority";
            parameters[i].Value         = this.Priority;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@EffectiveDate";
            parameters[i].Value         = this.EffectiveDate;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@RowCreatedTime";
            parameters[i].Value         = this.RowCreatedTime;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@RowCreatedUser";
            parameters[i].Value         = this.RowCreatedUser;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@Commission";
            parameters[i].Value         = this.Commission;
            i++;

            int result       = SqlHelperAsync.ExecuteNonQuery(Constants.AllConstants().CONNECTION_STRING, CommandType.StoredProcedure, PROCEDURE, parameters);
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("TelesalePluginCode", "ProductList_Detail_Read");
            return(result);
        }
Ejemplo n.º 19
0
        public int Delete()
        {
            string PROCEDURE = "p_DeleteDC_Tele_Hint";

            SqlParameter[] parameters = new SqlParameter[1];
            parameters[0] = new SqlParameter();
            parameters[0].ParameterName = "@ArticleID";
            parameters[0].Value         = ArticleID;

            int result       = SqlHelperAsync.ExecuteNonQuery(Constants.AllConstants().CONNECTION_STRING, CommandType.StoredProcedure, PROCEDURE, parameters);
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("TelesalePluginCode", "ReadByType");
            return(result);
        }
Ejemplo n.º 20
0
        public virtual ActionResult Activate(string id, bool activate)
        {
            var series = RavenSession.Load <Series>(id);

            if (series == null)
            {
                return(HttpNotFound("Series does not exist."));
            }



            OutputCacheManager.RemoveItems(MVC.Series.Name);

            return(new HttpStatusCodeResult(HttpStatusCode.OK));
        }
        private void ClearCache()
        {
            try
            {
                //Clear all output cache so everything is refreshed.
                var cacheManager = new OutputCacheManager();
                cacheManager.RemoveItems();

                //Clear the content finder cache.
                HttpContext.Current.Cache.Remove("CachedNewsNodes");
            }
            catch (Exception ex)
            {
                LogHelper.Error <UmbracoEvents>(string.Format("Exception: {0} - StackTrace: {1}", ex.Message, ex.StackTrace), ex);
            }
        }
Ejemplo n.º 22
0
        public virtual ActionResult SetPosition(string id, int newPosition)
        {
            var section = RavenSession.Load <Section>(id);

            if (section == null)
            {
                return(Json(new { success = false, message = string.Format("There is no post with id {0}", id) }));
            }

            if (section.Position == newPosition)
            {
                return(Json(new { success = false, message = string.Format("The {0} section has already this position", section.Title) }));
            }

            if (section.Position > newPosition)
            {
                var sections = RavenSession.Query <Section>()
                               .Where(s => s.Position >= newPosition && s.Position < section.Position)
                               .OrderBy(s => s.Position)
                               .ToList();

                foreach (var s in sections)
                {
                    s.Position++;
                }
            }
            else if (section.Position < newPosition)
            {
                var sections = RavenSession.Query <Section>()
                               .Where(s => s.Position < newPosition && s.Position >= section.Position)
                               .OrderBy(s => s.Position)
                               .ToList();

                foreach (var s in sections)
                {
                    s.Position--;
                }
            }

            section.Position = newPosition;

            OutputCacheManager.RemoveItems(MVC.Section.Name);

            return(Json(new { success = true }));
        }
        protected override void OnException(ExceptionContext filterContext)
        {
            if (filterContext.ExceptionHandled)
            {
                return;
            }

            //Log the exception.
            Umbraco.LogException(filterContext.Exception);

            //Clear the cache if an error occurs.
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems();

            //Show the view error.
            filterContext.Result           = View("Error");
            filterContext.ExceptionHandled = true;
        }
Ejemplo n.º 24
0
        public virtual ActionResult Delete(string id)
        {
            var series = RavenSession.Load <Series>(id);

            if (series == null)
            {
                return(HttpNotFound("Series does not exist."));
            }

            RavenSession.Delete(series);

            OutputCacheManager.RemoveItems(MVC.Series.Name);

            if (Request.IsAjaxRequest())
            {
                return(Json(new { Success = true }));
            }
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 25
0
        public virtual ActionResult Update(Section section)
        {
            if (!ModelState.IsValid)
            {
                return(View("Edit", section));
            }

            if (section.Position == 0)
            {
                section.Position = RavenSession.Query <Section>()
                                   .OrderByDescending(sec => sec.Position)
                                   .Select(sec => sec.Position)
                                   .FirstOrDefault() + 1;
            }
            RavenSession.Store(section);

            OutputCacheManager.RemoveItems(MVC.Section.Name);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 26
0
        public override void ProcessRequest(HttpRequest req, HttpResponse res)
        {
            if (req.QueryString.Count == 0)
            {
                res.Write("<p><h1>网站当前缓存列表:</h1><p>");

                var cacheItemList = new List <string>();
                var s             = "<a href='?cacheclear=true' target='_blank'>!点击清除所有缓存</a>";
                cacheItemList.Add(s);

                var cacheEnumerator = HttpRuntime.Cache.GetEnumerator();
                while (cacheEnumerator.MoveNext())
                {
                    var key = cacheEnumerator.Key.ToString();
                    s = string.Format("<b>{0}</b>:{1}(<a href='?key={0}' target='_blank'>查看数据</a>)", key, cacheEnumerator.Value.GetType());
                    cacheItemList.Add(s);
                }

                cacheItemList.Sort();

                res.Write(string.Join("<hr>", cacheItemList));
            }
            else if (req["cacheclear"] != null)
            {
                CacheHelper.Clear();

                // 清空所有输出缓存[OutputCache]
                var cacheManager = new OutputCacheManager();
                cacheManager.RemoveItems();

                res.Write("清除缓存成功!");
            }
            else if (req["key"] != null)
            {
                var data = CacheHelper.Get(req["key"]);
                if (data != null)
                {
                    res.Write(SerializationHelper.Newtonsoft_Serialize(data));
                }
            }
        }
Ejemplo n.º 27
0
        public int Save()
        {
            string PROCEDURE = "p_SaveDC_Tele_Hint";

            SqlParameter[] parameters = new SqlParameter[6];
            int            i          = 0;

            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@ArticleID";
            parameters[i].Value         = this._articleid;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@Description";
            parameters[i].Value         = this._description;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@ShowAll";
            parameters[i].Value         = this._showall;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@Active";
            parameters[i].Value         = this._active;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@RowCreatedTime";
            parameters[i].Value         = this._rowcreatedtime;
            i++;
            parameters[i] = new SqlParameter();
            parameters[i].ParameterName = "@RowCreatedUser";
            parameters[i].Value         = this._rowcreateduser;
            i++;

            int result       = SqlHelperAsync.ExecuteNonQuery(Constants.AllConstants().CONNECTION_STRING, CommandType.StoredProcedure, PROCEDURE, parameters);
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("TelesalePluginCode", "ReadByType");
            return(result);
        }
Ejemplo n.º 28
0
        public static void CacheTelesalesKPI()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("TelesalePluginCode", "_KPIAndActualForTelesale");
        }
Ejemplo n.º 29
0
        public static void CacheTopUp()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("TopUpMonitoring", "Read");
        }
Ejemplo n.º 30
0
        public static void CachePromptedPersonal()
        {
            var cacheManager = new OutputCacheManager();

            cacheManager.RemoveItems("PromptedPersonal", "PromptedPersonals_Read");
        }