public static void AddModule(IWebSiteControllerModule module, string fullyQualifiedClassName)
        {
            WebSiteControllerConfig config = GetFromConfigDB();

            PersistedWebSiteControllerModule mod = new PersistedWebSiteControllerModule(Guid.NewGuid(), module.RuleType, fullyQualifiedClassName, config);

            mod.Update();

            //config.modules.Add(new PersistedWebSiteControllerModule(module.Id, module.RuleType, fullyQualifiedClassName, config));
        }
        /// <summary>
        /// Gets the module.
        /// </summary>
        /// <param name="id">The id of the module</param>
        /// <returns>A page controller module</returns>
        public static IWebSiteControllerModule GetModule(SPWebApplication Webapp, Guid id)
        {
            WebApp = Webapp;
            PersistedWebSiteControllerModule module = GetFromConfigDB().modules[id] as PersistedWebSiteControllerModule;

            if (module != null)
            {
                IWebSiteControllerModule imodule = GetModuleFromClassName(module.FullyQualifiedClassName);
                imodule.Id = id;
                return(imodule);// GetModuleFromClassName(module.FullyQualifiedClassName);
            }
            return(null);
        }
        public static void AddModule(SPWebApplication Webapp, IWebSiteControllerModule module, string fullyQualifiedClassName)
        {
            try
            {
                WebApp = Webapp;
                WebSiteControllerConfig config = GetFromConfigDB();

                PersistedWebSiteControllerModule mod = new PersistedWebSiteControllerModule(Guid.NewGuid(), module.RuleType, fullyQualifiedClassName, config);
                mod.Update();
            }
            catch (Exception ex)
            {
                SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory(ex.Source, TraceSeverity.High, EventSeverity.Error), TraceSeverity.High, ex.Message, ex.Data);
                //ex.ToString();
            }

            //config.modules.Add(new PersistedWebSiteControllerModule(module.Id, module.RuleType, fullyQualifiedClassName, config));
        }