Exemple #1
0
        //------------------------------------------------------------------
        public bool UpdateModule(ItemsModulesOptions itemsModule)
        {
            bool        res       = false;
            XmlNodeList nodesList = XmlDoc.SelectNodes("/SiteItemsModules/Module[@ModuleTypeID='" + itemsModule.ModuleTypeID + "']");

            if (nodesList.Count == 1)
            {
                XmlElement oldModuleNode = (XmlElement)nodesList[0];
                oldModuleNode.Attributes.RemoveAll();
                PopulateXmlNodeFromModule(itemsModule, oldModuleNode);
                //XmlDoc.Save(DCServer.MapPath("~") + SiteDesign.ModulesOptionsConfigs+"SiteItemsModules.config");
                SiteConfigurationManager.UpdateSiteItemsModules(XmlDoc);
                res = true;
            }
            return(res);
        }
Exemple #2
0
        //------------------------------------------------------------------
        public bool DeleteModule(int moduleID)
        {
            bool        res       = false;
            XmlNodeList nodesList = XmlDoc.SelectNodes("/SiteItemsModules/Module[@ModuleTypeID='" + moduleID + "']");

            if (nodesList.Count > 0)
            {
                foreach (XmlNode module in nodesList)
                {
                    XmlNode parentnode = module.ParentNode;
                    parentnode.RemoveChild(module);
                }
                //XmlDoc.Save(DCServer.MapPath("~") + SiteDesign.ModulesOptionsConfigs + "SiteItemsModules.config");
                SiteConfigurationManager.UpdateSiteItemsModules(XmlDoc);
                res = true;
            }
            return(res);
        }
Exemple #3
0
        public bool AddModule(ItemsModulesOptions itemsModule)
        {
            bool        res      = false;
            XmlNodeList nodeList = XmlDoc.SelectNodes("/SiteItemsModules/Module[@ModuleTypeID='" + itemsModule.ModuleTypeID + "']");

            if (nodeList.Count == 0)
            {
                //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                XmlElement xmlNewModule = XmlDoc.CreateElement("Module");
                xmlNewModule = PopulateXmlNodeFromModule(itemsModule, xmlNewModule);
                XmlNode commonParent = XmlDoc.SelectSingleNode("/SiteItemsModules");
                commonParent.AppendChild(xmlNewModule);
                //XmlDoc.Save(DCServer.MapPath("~") + SiteDesign.ModulesOptionsConfigs+"SiteItemsModules.config");
                SiteConfigurationManager.UpdateSiteItemsModules(XmlDoc);
                //xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                res = true;
            }
            return(res);
        }