private void RestoreModule(int moduleId, int tabId)
        {
            var eventLogController = new EventLogController();
            var moduleController = new ModuleController();

            // restore module
            var module = moduleController.GetModule(moduleId, tabId, false);
            if ((module != null))
            {
                if (DeletedTabs.Any(t => t.TabID == module.TabID))
                {
                    var title = !string.IsNullOrEmpty(module.ModuleTitle) ? module.ModuleTitle : module.DesktopModule.FriendlyName;
                    Skin.AddModuleMessage(this, string.Format(Localization.GetString("TabDeleted.ErrorMessage", LocalResourceFile), title),
                                                   ModuleMessage.ModuleMessageType.RedError);
                    return;
                }
                moduleController.RestoreModule(module);
                eventLogController.AddLog(module, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_RESTORED);
            }
        }
		/// <summary>
		///   Restores selected modules in the listbox
		/// </summary>
		/// <param name = "sender"></param>
		/// <param name = "e"></param>
		/// <remarks>
		///   Adds a log entry for each restored module to the EventLog
		/// </remarks>
		/// <history>
		///   [VMasanas]	18/08/2004	Added support for multiselect listbox
		/// </history>
		protected void OnModuleRestoreClick(Object sender, EventArgs e)
		{
			var objEventLog = new EventLogController();
			var objModules = new ModuleController();

			foreach (ListItem item in lstModules.Items)
			{
				if (item.Selected)
				{
					var values = item.Value.Split('-');
					var tabId = int.Parse(values[0]);
					var moduleId = int.Parse(values[1]);

					// restore module
					var objModule = objModules.GetModule(moduleId, tabId, false);
					if ((objModule != null))
					{
						objModules.RestoreModule(objModule);
						objEventLog.AddLog(objModule, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_RESTORED);
					}
				}
			}
			BindData();
		}
        private void RestoreModule(int moduleId, int tabId)
        {
            var eventLogController = new EventLogController();
            var moduleController = new ModuleController();

            // restore module
            var module = moduleController.GetModule(moduleId, tabId, false);
            if ((module != null))
            {
                moduleController.RestoreModule(module);
                eventLogController.AddLog(module, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_RESTORED);
            }
        }
示例#4
0
        private void RestoreModule(int moduleId, int tabId)
        {
            var objEventLog = new EventLogController();
            var objModules = new ModuleController();

            // restore module
            var objModule = objModules.GetModule(moduleId, tabId, false);
            if ((objModule != null))
            {
                objModules.RestoreModule(objModule);
                objEventLog.AddLog(objModule, PortalSettings, UserId, "", EventLogController.EventLogType.MODULE_RESTORED);
            }
        }