Ejemplo n.º 1
0
        public static void DeleteAssetType(int assetTypeId)
        {
            AssetType at = AssetType.Get(assetTypeId);

            if (at.AssetTypeFileExtensionList.Count > 0)
            {
                throw new SystemException("This asset type cannot be deleted as it has file extensions assigned to it");
            }

            AssetFinder finder = new AssetFinder {
                AssetTypeId = assetTypeId
            };
            int count = Asset.GetCount(finder);

            if (count > 0)
            {
                throw new SystemException("This asset type cannot be deleted as assets of this type have been uploaded");
            }

            at.IsDeleted = true;
            AssetType.Update(at);
            CacheManager.InvalidateCache("AssetType", CacheType.All);
        }
Ejemplo n.º 2
0
 public static void SaveAssetType(AssetType assetType)
 {
     Validate(assetType);
     AssetType.Update(assetType);
     CacheManager.InvalidateCache("AssetType", CacheType.All);
 }