当前位置: 首页>>代码示例>>C#>>正文


C# ModuleController.DeleteModule方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Modules.ModuleController.DeleteModule方法的典型用法代码示例。如果您正苦于以下问题:C# ModuleController.DeleteModule方法的具体用法?C# ModuleController.DeleteModule怎么用?C# ModuleController.DeleteModule使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Modules.ModuleController的用法示例。


在下文中一共展示了ModuleController.DeleteModule方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteTab

        public void DeleteTab(TabInfo t)
        {
            PortalSettings portalSettings = new PortalSettings();
            int portalId = portalSettings.PortalId;

            if (t != null)
            {
                TabController tc = new TabController();
                if (t != null)
                {
                    if (t.Modules != null)
                    {
                        foreach (ModuleInfo mod in t.Modules)
                        {
                            ModuleController moduleC = new ModuleController();
                            moduleC.DeleteModule(mod.ModuleID);
                            moduleC.DeleteModuleSettings(mod.ModuleID);
                        }
                    }

                    tc.DeleteTab(t.TabID, portalId);
                    tc.DeleteTabSettings(t.TabID);
                    DataCache.ClearModuleCache(t.TabID);
                }
            }
        }
开发者ID:Jochumzen,项目名称:DisplayPluggOld,代码行数:26,代码来源:DNN.cs

示例2: DeleteTab

	    private void DeleteTab(TabInfo tab, bool deleteDescendants)
		{
			var eventLogController = new EventLogController();
			var tabController = new TabController();
			var moduleController = new ModuleController();

			//get tab modules before deleting page
			var tabModules = moduleController.GetTabModules(tab.TabID);

			//hard delete the tab
			tabController.DeleteTab(tab.TabID, tab.PortalID, deleteDescendants);
			
			//delete modules that do not have other instances
			foreach (var kvp in tabModules)
			{
				//check if all modules instances have been deleted
				var delModule = moduleController.GetModule(kvp.Value.ModuleID, Null.NullInteger, false);
				if (delModule == null || delModule.TabID == Null.NullInteger)
				{
					moduleController.DeleteModule(kvp.Value.ModuleID);
				}
			}
			eventLogController.AddLog(tab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_DELETED);
		}
开发者ID:RichardHowells,项目名称:dnnextensions,代码行数:24,代码来源:RecycleBin.ascx.cs

示例3: DeleteTab

		/// <summary>
		/// Deletes a tab
		/// </summary>
		/// <param name="objTab">The tab to be deleted</param>
		/// <remarks>
		/// Adds a log entry for the action to the EventLog
		/// </remarks>
		/// <history>
		/// 	[VMasanas]	18/08/2004	Created
		///                 19/09/2004  Remove skin deassignment. BLL takes care of this.
		///                 30/09/2004  Change logic so log is only added when tab is actually deleted
		///                 28/02/2005  Remove modules when deleting pages
		/// </history>
		private void DeleteTab(TabInfo objTab, bool deleteDescendants)
		{
			var objEventLog = new EventLogController();
			var objTabs = new TabController();
			var objModules = new ModuleController();

			//get tab modules before deleting page
			var dicTabModules = objModules.GetTabModules(objTab.TabID);

			//hard delete the tab
			objTabs.DeleteTab(objTab.TabID, objTab.PortalID, deleteDescendants);
			
			//delete modules that do not have other instances
			foreach (var kvp in dicTabModules)
			{
				//check if all modules instances have been deleted
				var objDelModule = objModules.GetModule(kvp.Value.ModuleID, Null.NullInteger, false);
				if (objDelModule == null || objDelModule.TabID == Null.NullInteger)
				{
					objModules.DeleteModule(kvp.Value.ModuleID);
				}
			}
			objEventLog.AddLog(objTab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_DELETED);
		}
开发者ID:marceltoben,项目名称:evandrix.github.com,代码行数:37,代码来源:RecycleBin.ascx.cs

示例4: RemoveCoreModule

        /// <summary>
        /// RemoveCoreModule removes a Core Module from the system
        /// </summary>
        /// <remarks>
        /// </remarks>
        ///	<param name="DesktopModuleName">The Friendly Name of the Module to Remove</param>
        ///	<param name="ParentTabName">The Name of the parent Tab/Page for this module</param>
        ///	<param name="TabName">The Name to tab that contains the Module</param>
        ///	<param name="TabRemove">A flag to determine whether to remove the Tab if it has no
        ///	other modules</param>
        private static void RemoveCoreModule(string DesktopModuleName, string ParentTabName, string TabName, bool TabRemove)
        {
            TabController objTabs = new TabController();
            ModuleController objModules = new ModuleController();
            int intIndex;
            int intModuleDefId = 0;
            int intDesktopModuleId;

            //Find and remove the Module from the Tab
            switch (ParentTabName)
            {
                case "Host":
                    //TODO - when we have a need to remove a Host Module
                    break;
                case "Admin":
                    PortalController objPortals = new PortalController();

                    ArrayList arrPortals = objPortals.GetPortals();                  

                    //Iterate through the Portals to remove the Module from the Tab
                    for (int intPortal = 0; intPortal < arrPortals.Count; intPortal++)
                    {
                        PortalInfo objPortal = (PortalInfo)(arrPortals[intPortal]);

                        int ParentId = objPortal.AdminTabId;
                        TabInfo objTab = objTabs.GetTabByName(TabName, objPortal.PortalID, ParentId);
                        int intCount = 0;

                        //Get the Modules on the Tab
                        foreach (KeyValuePair<int, ModuleInfo> kvp in objModules.GetTabModules(objTab.TabID))
                        {
                            ModuleInfo objModule = kvp.Value;
                            if (objModule.FriendlyName == DesktopModuleName)
                            {
                                //Delete the Module from the Modules list
                                objModules.DeleteModule(objModule.ModuleID);
                                intModuleDefId = objModule.ModuleDefID;
                            }
                            else
                            {
                                intCount += 1;
                            }
                        }

                        //If Tab has no modules optionally remove tab
                        if (intCount == 0 & TabRemove)
                        {
                            objTabs.DeleteTab(objTab.TabID, objTab.PortalID);
                        }
                    }
                    break;
            }

            //Delete all the Module Controls for this Definition
            ModuleControlController objModuleControls = new ModuleControlController();
            ArrayList arrModuleControls = objModuleControls.GetModuleControls(intModuleDefId);
            for (intIndex = 0; intIndex <= arrModuleControls.Count - 1; intIndex++)
            {
                ModuleControlInfo objModuleControl = (ModuleControlInfo)arrModuleControls[intIndex];
                objModuleControls.DeleteModuleControl(objModuleControl.ModuleControlID);
            }

            //Get the Module Definition
            ModuleDefinitionController objModuleDefinitions = new ModuleDefinitionController();
            ModuleDefinitionInfo objModuleDefinition;
            objModuleDefinition = objModuleDefinitions.GetModuleDefinition(intModuleDefId);
            intDesktopModuleId = objModuleDefinition.DesktopModuleID;

            //Delete the Module Definition
            objModuleDefinitions.DeleteModuleDefinition(intModuleDefId);

            //Delete the Desktop Module Control
            DesktopModuleController objDesktopModules = new DesktopModuleController();
            objDesktopModules.DeleteDesktopModule(intDesktopModuleId);
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:85,代码来源:Upgrade.cs

示例5: DeleteTab

        /// <summary>
        /// Deletes a tab
        /// </summary>
        /// <param name="intTabid">TabId of the tab to be deleted</param>
        /// <remarks>
        /// Adds a log entry for the action to the EventLog
        /// </remarks>
        /// <history>
        /// 	[VMasanas]	18/08/2004	Created
        ///                 19/09/2004  Remove skin deassignment. BLL takes care of this.
        ///                 30/09/2004  Change logic so log is only added when tab is actually deleted
        ///                 28/02/2005  Remove modules when deleting pages
        /// </history>
        private void DeleteTab( int intTabid )
        {
            EventLogController objEventLog = new EventLogController();

            // delete tab
            TabController objTabs = new TabController();
            ModuleController objModules = new ModuleController();

            TabInfo objTab = objTabs.GetTab( intTabid );
            if( objTab != null )
            {
                //save tab modules before deleting page
                ArrayList arrTabModules = objModules.GetPortalTabModules( objTab.PortalID, objTab.TabID );

                // hard delete the tab
                objTabs.DeleteTab( objTab.TabID, objTab.PortalID );

                // check if it's deleted
                TabInfo objTabDeleted = objTabs.GetTab( intTabid );
                if( objTabDeleted == null )
                {
                    //delete modules that do not have other instances
                    foreach( ModuleInfo objmodule in arrTabModules )
                    {
                        // check if all modules instances have been deleted
                        ModuleInfo objDelModule = objModules.GetModule( objmodule.ModuleID, Null.NullInteger );
                        if( objDelModule == null || objDelModule.TabID == Null.NullInteger )
                        {
                            objModules.DeleteModule( objmodule.ModuleID );
                        }
                    }
                    objEventLog.AddLog( objTab, PortalSettings, UserId, "", EventLogController.EventLogType.TAB_DELETED );
                }
                else
                {
                    // should be a parent tab
                    UI.Skins.Skin.AddModuleMessage( this, string.Format( Localization.GetString( "ParentTab.ErrorMessage", this.LocalResourceFile ), objTab.TabName ), ModuleMessageType.YellowWarning );
                }
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:53,代码来源:RecycleBin.ascx.cs

示例6: DeleteModule

        /// <summary>
        /// Deletes a module
        /// </summary>
        /// <param name="intModuleId">ModuleId of the module to be deleted</param>
        /// <remarks>
        /// Adds a log entry for the action to the EvenLog
        /// </remarks>
        /// <history>
        /// 	[VMasanas]	18/08/2004	Created
        /// </history>
        private void DeleteModule( int intModuleId )
        {
            EventLogController objEventLog = new EventLogController();

            // delete module
            ModuleController objModules = new ModuleController();
            ModuleInfo objModule = objModules.GetModule( intModuleId, Null.NullInteger );
            if( objModule != null )
            {
                objModules.DeleteModule( objModule.ModuleID );
                objEventLog.AddLog( objModule, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_DELETED );
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:23,代码来源:RecycleBin.ascx.cs

示例7: DeleteMe

 void DeleteMe()
 {
     var m = new ModuleController();
     m.DeleteTabModule(ModuleContext.TabId, ModuleContext.ModuleId, false);
     m.DeleteModule(ModuleContext.ModuleId);
     Response.Redirect(Globals.NavigateURL(ModuleContext.TabId), true);
 }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:7,代码来源:TemplateList.ascx.cs


注:本文中的DotNetNuke.Entities.Modules.ModuleController.DeleteModule方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。