Exemplo n.º 1
0
        public static PageView Load(Int32 pageViewId, bool useCache)
        {
            if (pageViewId == 0)
            {
                return(null);
            }
            PageView pageView = null;
            string   key      = "PageView_" + pageViewId.ToString();

            if (useCache)
            {
                pageView = ContextCache.GetObject(key) as PageView;
                if (pageView != null)
                {
                    return(pageView);
                }
            }
            pageView = new PageView();
            if (pageView.Load(pageViewId))
            {
                if (useCache)
                {
                    ContextCache.SetObject(key, pageView);
                }
                return(pageView);
            }
            return(null);
        }
Exemplo n.º 2
0
        public static bool Delete(Int32 pageViewId)
        {
            PageView pageView = new PageView();

            if (pageView.Load(pageViewId))
            {
                return(pageView.Delete());
            }
            return(false);
        }