예제 #1
0
        /// <summary>
        /// Deletes child tabs for the given Tab
        /// </summary>
        /// <param name="intTabid">ID of the parent tab</param>
        /// <returns>True is all child tabs could be deleted</returns>
        /// <remarks>
        /// Will delete child tabs recursively
        /// </remarks>
        /// <history>
        /// 	[VMasanas]	30/09/2004	Created
        ///     [VMasanas]  01/09/2005  A tab will be deleted only if all descendants can be deleted
        /// </history>
        private bool DeleteChildTabs( int intTabid )
        {
            TabController objtabs = new TabController();
            ArrayList arrTabs = objtabs.GetTabsByParentId( intTabid, PortalId );

            bool bDeleted = true;

            foreach( TabInfo objtab in arrTabs )
            {
                if( objtab.TabID != PortalSettings.AdminTabId && objtab.TabID != PortalSettings.SplashTabId && objtab.TabID != PortalSettings.HomeTabId && objtab.TabID != PortalSettings.LoginTabId && objtab.TabID != PortalSettings.UserTabId )
                {
                    //delete child tabs
                    if( DeleteChildTabs( objtab.TabID ) )
                    {
                        objtab.IsDeleted = true;
                        objtabs.UpdateTab( objtab );

                        EventLogController objEventLog = new EventLogController();
                        objEventLog.AddLog( objtab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_SENT_TO_RECYCLE_BIN );
                    }
                    else
                    {
                        //cannot delete tab, stop deleting and exit
                        bDeleted = false;
                        break;
                    }
                }
                else
                {
                    //cannot delete tab, stop deleting and exit
                    bDeleted = false;
                    break;
                }
            }
            

            return bDeleted;
        }