Example #1
0
        public static IList <ArticleTitle> GetArticleTitle(string strAritcleTypeCode, string strUpdatedByUserID, string strSortField, bool bIsAsc, bool IsReturnAll, int intPageSize, int intPageIndex)
        {
            IList <ArticleTitle> listArtTitle = null;

            Expose178.Com.BLL.ArticleTitle bllArtTitle = null;
            try
            {
                bllArtTitle = new BLL.ArticleTitle();
                bllArtTitle.AritcleTypeCode = strAritcleTypeCode;
                bllArtTitle.IsAsc           = bIsAsc;
                bllArtTitle.IsReturnAll     = IsReturnAll;
                bllArtTitle.PageIndex       = intPageIndex;
                bllArtTitle.PageSize        = intPageSize;
                bllArtTitle.SortField       = strSortField;
                bllArtTitle.UpdatedByUserID = strUpdatedByUserID;
                if (IsEnableCache)
                {
                    if (System.Web.HttpRuntime.Cache["articletitle"] == null)
                    {
                        listArtTitle = bllArtTitle.GetArticleTitle();
                        AggregateCacheDependency dependency = Expose178.Com.CacheDependencyFactory.DependencyFacade.GetArticleTitleDependency();
                        if (bllArtTitle != null)
                        {
                            System.Web.HttpRuntime.Cache.Add("articletitle", bllArtTitle, dependency, DateTime.Now.AddSeconds(IntArticleTitleDuration), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                        }
                    }
                    if (listArtTitle == null)
                    {
                        listArtTitle = (List <ArticleTitle>)System.Web.HttpRuntime.Cache["articletitle"];
                    }
                }
                else
                {
                    listArtTitle = bllArtTitle.GetArticleTitle();
                }
            }
            catch (EvaluateException ex)
            {
                Hashtable hshParam = new Hashtable();
                hshParam.Add("Error", ex.Message);
                hshParam.Add("UID", Expose178.Com.GadgetScripts.Gadget.GetUserID());
                Expose178.Com.UtilityFactory.Log.WriteLog(hshParam, "ProxyArticle.GetArticleTitle", UtilityFactory.LogType.LogToDB);
            }
            return(listArtTitle);
        }
Example #2
0
        public static IList <ArticleTitle> GetArticleTitle()
        {
            IList <ArticleTitle> listArtTitle = null;

            Expose178.Com.BLL.ArticleTitle bllArtTitle = null;
            try
            {
                bllArtTitle = new BLL.ArticleTitle();
                if (IsEnableCache)
                {
                    if (System.Web.HttpRuntime.Cache["articletitle"] == null)
                    {
                        listArtTitle = bllArtTitle.GetArticleTitle();
                        AggregateCacheDependency dependency = Expose178.Com.CacheDependencyFactory.DependencyFacade.GetArticleTitleDependency();
                        if (bllArtTitle != null)
                        {
                            System.Web.HttpRuntime.Cache.Add("articletitle", bllArtTitle, dependency, DateTime.Now.AddSeconds(IntArticleTitleDuration), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null);
                        }
                    }
                    if (listArtTitle == null)
                    {
                        listArtTitle = (List <ArticleTitle>)System.Web.HttpRuntime.Cache["articletitle"];
                    }
                }
                else
                {
                    listArtTitle = bllArtTitle.GetArticleTitle();
                }
            }
            catch (EvaluateException ex)
            {
                Hashtable hshParam = new Hashtable();
                hshParam.Add("Error", ex.Message);
                hshParam.Add("UID", Expose178.Com.GadgetScripts.Gadget.GetUserID());
                Expose178.Com.UtilityFactory.Log.WriteLog(hshParam, "ProxyArticle.GetArticleTitle", UtilityFactory.LogType.LogToDB);
            }
            return(listArtTitle);
        }