/// <summary> /// cmdDeleteDefinition_Click runs when the Delete Definition Button is clicked /// </summary> /// <history> /// [cnurse] 9/28/2004 Updated to reflect design changes for Help, 508 support /// and localisation /// </history> protected void cmdDeleteDefinition_Click(object sender, EventArgs e) { ModuleDefinitionController objModuleDefinitions = new ModuleDefinitionController(); objModuleDefinitions.DeleteModuleDefinition(int.Parse(cboDefinitions.SelectedItem.Value)); LoadDefinitions(); }
private static void RemoveLegacyModuleDefinitions(string moduleName, string currentModuleDefinitionName) { var mdc = new ModuleDefinitionController(); var desktopModule = DesktopModuleController.GetDesktopModuleByModuleName(moduleName, Null.NullInteger); if (desktopModule == null) { return; } var desktopModuleId = desktopModule.DesktopModuleID; var modDefs = ModuleDefinitionController.GetModuleDefinitionsByDesktopModuleID(desktopModuleId); var currentModDefId = 0; foreach (var modDefKeyPair in modDefs) { if (modDefKeyPair.Value.FriendlyName.Equals(currentModuleDefinitionName, StringComparison.InvariantCultureIgnoreCase)) { currentModDefId = modDefKeyPair.Value.ModuleDefID; } } foreach (var modDefKeyPair in modDefs) { var oldModDefId = modDefKeyPair.Value.ModuleDefID; if (oldModDefId != currentModDefId) { foreach (ModuleInfo mod in ModuleController.Instance.GetAllModules()) { if (mod.ModuleDefID == oldModDefId) { mod.ModuleDefID = currentModDefId; ModuleController.Instance.UpdateModule(mod); } } mdc.DeleteModuleDefinition(oldModDefId); } } modDefs = ModuleDefinitionController.GetModuleDefinitionsByDesktopModuleID(desktopModuleId); if (modDefs.Count == 0) { new DesktopModuleController().DeleteDesktopModule(desktopModuleId); } }
protected void cmdDeleteDefinition_Click(object sender, EventArgs e) { var objModuleDefinitions = new ModuleDefinitionController(); objModuleDefinitions.DeleteModuleDefinition(ModuleDefinitionID); //Force Definitions list to refresh by rebinding DesktopModule ModuleDefinitionID = Null.NullInteger; _ModuleDefinition = null; _DesktopModule = null; //empty definition form's content definitionsEditor.Items.ForEach(i => { i.Value = null; }); BindDesktopModule(true); }