//*********************************************************************
        //
        // DeleteModuleDefinition() Method <a name="DeleteModuleDefinition"></a>
        //
        // The DeleteModuleDefinition method deletes the specified module type
        // definition from the portal.  Each module which is related to the
        // ModuleDefinition is deleted from each tab in the configuration
        // file, and all data relating to each module is deleted from the
        // database.
        //
        // Other relevant sources:
        //    + <a href="#SaveSiteSettings" style="color:green">SaveSiteSettings() method</a>
        //      + <a href="PortalCfg.xml" style="color:green">PortalCfg.xml</a>
        //    + <a href="DeleteModule.htm" style="color:green">DeleteModule Stored Procedure</a>
        //
        //*********************************************************************
        public void DeleteModuleDefinition(int defId)
        {
            // Obtain SiteSettings from Current Context
            SiteConfiguration siteSettings = (SiteConfiguration) HttpContext.Current.Items["SiteSettings"];

            //
            // Delete information in the Database relating to each Module being deleted
            //
            AdminFacade facade = new AdminFacade();
            foreach (SiteConfiguration.ModuleRow moduleRow in siteSettings.Module.Select())
            {
                if (moduleRow.ModuleDefId == defId)
                {
                    facade.DeletePortalModule(moduleRow.ModuleId);
                    // Delete the xml module associated with the ModuleDef
                    // in the configuration file
                    siteSettings.Module.RemoveModuleRow(moduleRow);
                }
            }

            // Finish removing Module Definition
            siteSettings.ModuleDefinition.RemoveModuleDefinitionRow(
                siteSettings.ModuleDefinition.FindByModuleDefId(defId));

            //Update the cache
            HttpContext.Current.Cache["SiteSettings"] = siteSettings;

            // Save the changes
            SaveSiteSettings();
        }
        //*********************************************************************
        //
        // DeleteTab Method <a name="DeleteTab"></a>
        //
        // The DeleteTab method deletes the selected tab and its modules from
        // the settings which are stored in the Xml file PortalCfg.xml.  This
        // method also deletes any data from the database associated with all
        // modules within this tab.
        //
        // Other relevant sources:
        //    + <a href="#SaveSiteSettings" style="color:green">SaveSiteSettings() method</a>
        //      + <a href="PortalCfg.xml" style="color:green">PortalCfg.xml</a>
        //      + <a href="DeleteModule.htm" style="color:green">DeleteModule stored procedure</a>
        //
        //*********************************************************************
        public void DeleteTab(int tabId)
        {
            //
            // Delete the Tab in the XML file
            //

            // Obtain SiteSettings from Current Context
            SiteConfiguration siteSettings = (SiteConfiguration) HttpContext.Current.Items["SiteSettings"];

            // Find the appropriate tab in the Tab table
            SiteConfiguration.TabDataTable tabTable = siteSettings.Tab;
            SiteConfiguration.TabRow tabRow = siteSettings.Tab.FindByTabId(tabId);

            //
            // Delete information in the Database relating to each Module being deleted
            //

            List<int> ModuleIdList = new List<int>();
            foreach (SiteConfiguration.ModuleRow moduleRow in tabRow.GetModuleRows())
            {
                ModuleIdList.Add(moduleRow.ModuleId);
            }
            AdminFacade facade = new AdminFacade();
            facade.DeletePortalModule(ModuleIdList.ToArray());

            // Finish removing the Tab row from the Xml file
            tabTable.RemoveTabRow(tabRow);

            //Update the cache
            HttpContext.Current.Cache["SiteSettings"] = siteSettings;

            // Save the changes
            SaveSiteSettings();
        }
        //*********************************************************************
        //
        // DeleteModule Method  <a name="DeleteModule"></a>
        //
        // The DeleteModule method deletes a specified Module from the settings
        // stored in the Xml file PortalCfg.xml.  This method also deletes any
        // data from the database associated with this module.
        //
        // Other relevant sources:
        //    + <a href="#SaveSiteSettings" style="color:green">SaveSiteSettings() method</a>
        //      + <a href="PortalCfg.xml" style="color:green">PortalCfg.xml</a>
        //      + <a href="DeleteModule.htm" style="color:green">DeleteModule stored procedure</a>
        //
        //*********************************************************************
        public void DeleteModule(int moduleId)
        {
            // Obtain SiteSettings from Current Context
            SiteConfiguration siteSettings = (SiteConfiguration) HttpContext.Current.Items["SiteSettings"];

            //
            // Delete information in the Database relating to Module being deleted
            //
            AdminFacade facade = new AdminFacade();
            facade.DeletePortalModule(moduleId);

            // Finish removing Module
            siteSettings.Module.RemoveModuleRow(siteSettings.Module.FindByModuleId(moduleId));

            //Update the cache
            HttpContext.Current.Cache["SiteSettings"] = siteSettings;

            // Save the changes
            SaveSiteSettings();
        }