public static DataTable GetAllChildCategories(int parentItemId, int portalId)
{
// return DataProvider.Instance().GetAllChildCategories(parentItemId, portalId);
string cacheKey = Utility.CacheKeyPublishAllChildCategories + parentItemId.ToString(CultureInfo.InvariantCulture);
DataTable dt;
if (ModuleBase.UseCachePortal(portalId))
{
object o = DataCache.GetCache(cacheKey);
if (o != null)
{
dt = (DataTable)o;
}
else
{
dt = DataProvider.Instance().GetAllChildCategories(parentItemId, portalId);
}
if (dt != null)
{
DataCache.SetCache(cacheKey, dt, DateTime.Now.AddMinutes(ModuleBase.CacheTimePortal(portalId)));
Utility.AddCacheKey(cacheKey, portalId);
}
}
else
{
dt = DataProvider.Instance().GetAllChildCategories(parentItemId, portalId);
}
return dt;
}