コード例 #1
0
        public static KitComponent Load(Int32 kitComponentId, bool useCache)
        {
            if (kitComponentId == 0)
            {
                return(null);
            }
            KitComponent kitComponent = null;
            string       key          = "KitComponent_" + kitComponentId.ToString();

            if (useCache)
            {
                kitComponent = ContextCache.GetObject(key) as KitComponent;
                if (kitComponent != null)
                {
                    return(kitComponent);
                }
            }
            kitComponent = new KitComponent();
            if (kitComponent.Load(kitComponentId))
            {
                if (useCache)
                {
                    ContextCache.SetObject(key, kitComponent);
                }
                return(kitComponent);
            }
            return(null);
        }
コード例 #2
0
        public static bool Delete(Int32 kitComponentId)
        {
            KitComponent kitComponent = new KitComponent();

            if (kitComponent.Load(kitComponentId))
            {
                return(kitComponent.Delete());
            }
            return(false);
        }