示例#1
0
        private void DeleteVariable(HttpContext context)
        {
            string path = context.Request.Params["Path"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            DefinitionObject item = new DefinitionObject(Global.Core, source, path);

            item.Delete();

            if (source.Contains("ReportDefinitions"))
            {
                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.Load(source);

                XmlNode xmlNodeResults = xmlDocument.DocumentElement.SelectSingleNode("Results");

                if (xmlNodeResults != null)
                {
                    xmlNodeResults.ParentNode.RemoveChild(xmlNodeResults);

                    xmlDocument.Save(source);
                }
            }
        }
示例#2
0
        private void RemoveScoreFromGroup(HttpContext context)
        {
            string path      = context.Request.Params["Path"];
            string groupPath = context.Request.Params["GroupPath"];

            // Get the source string from the http request's parameters.
            string source      = context.Request.Params["Source"];
            string groupSource = context.Request.Params["GroupSource"];

            DefinitionObject score = new DefinitionObject(Global.Core, source, path);
            DefinitionObject group = new DefinitionObject(Global.Core, groupSource, groupPath);

            if (score.StorageType == DatabaseCore.StorageMethodType.Database)
            {
                // Delete the score group link.
                Global.Core.TaxonomyCategoryLinks.Delete((Guid)Global.Core.TaxonomyCategoryLinks.GetValue(
                                                             "Id",
                                                             new string[] { "IdScoreGroup", "IdTaxonomyCategory" },
                                                             new object[] { group.GetValue("Id"), score.GetValue("Id") }
                                                             ));
            }
            else
            {
                score.Delete();
            }
        }
示例#3
0
        private void DeleteScoreGroup(HttpContext context)
        {
            string xPath = context.Request.Params["XPath"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            DefinitionObject scoreGroup = new DefinitionObject(Global.Core, source, xPath);

            if (scoreGroup.StorageType == DatabaseCore.StorageMethodType.Database)
            {
                // Get all categories of the score group.
                List <object[]> scoreGroupCategories = Global.Core.TaxonomyCategoryLinks.GetValues(
                    new string[] { "Id" },
                    new string[] { "IdScoreGroup" },
                    new object[] { scoreGroup.GetValue("Id") }
                    );

                // Run through all categories of the scrore group.
                foreach (object[] scoreGroupCategory in scoreGroupCategories)
                {
                    // Remove the category from the score group.
                    Global.Core.TaxonomyCategoryLinks.Delete((Guid)scoreGroupCategory[0]);
                }
            }

            scoreGroup.Delete();
        }
示例#4
0
        private void DeleteScore(HttpContext context)
        {
            string xPath = context.Request.Params["XPath"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            DefinitionObject obj = new DefinitionObject(Global.Core, source, xPath);

            obj.Delete();
        }