예제 #1
0
        public static Kit Load(Int32 productId, bool useCache)
        {
            if (productId == 0)
            {
                return(null);
            }
            Kit    kit = null;
            string key = "Kit_" + productId.ToString();

            if (useCache)
            {
                kit = ContextCache.GetObject(key) as Kit;
                if (kit != null)
                {
                    return(kit);
                }
            }
            kit = new Kit();
            if (kit.Load(productId))
            {
                if (useCache)
                {
                    ContextCache.SetObject(key, kit);
                }
                return(kit);
            }
            return(null);
        }
예제 #2
0
        public static bool Delete(Int32 productId)
        {
            Kit kit = new Kit();

            if (kit.Load(productId))
            {
                return(kit.Delete());
            }
            return(false);
        }