private void AddAllTabsModules(TabInfo objTab) { ModuleController objmodules = new ModuleController(); foreach (ModuleInfo allTabsModule in objmodules.GetAllTabsModules(objTab.PortalID, true)) { bool canAdd = false; foreach (ModuleInfo allTabsInstance in objmodules.GetModuleTabs(allTabsModule.ModuleID)) { TabInfo tab = new TabController().GetTab(allTabsInstance.TabID, objTab.PortalID, false); if (!tab.IsDeleted) { canAdd = true; break; } } if (canAdd) { objmodules.CopyModule(allTabsModule.ModuleID, allTabsModule.TabID, objTab.TabID, "", true); } } }
public static void RestoreTab(TabInfo objTab, PortalSettings PortalSettings, int UserId) { Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); TabController objController = new TabController(); objTab.IsDeleted = false; objController.UpdateTab(objTab); List<TabInfo> siblingTabs = objController.GetTabsByPortal(objTab.PortalID).WithParentId(objTab.ParentId); int siblingCount = siblingTabs.Count; objTab.TabOrder = 2 * siblingTabs.Count + 1; objController.UpdateTabOrder(objTab, false); objEventLog.AddLog(objTab, PortalSettings, UserId, "", Services.Log.EventLog.EventLogController.EventLogType.TAB_RESTORED); ModuleController objmodules = new ModuleController(); ArrayList arrMods = objmodules.GetAllTabsModules(objTab.PortalID, true); foreach (ModuleInfo objModule in arrMods) { objmodules.CopyModule(objModule.ModuleID, objModule.TabID, objTab.TabID, "", true); } objController.ClearCache(objTab.PortalID); }