Exemplo n.º 1
0
        private void ShowScore(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 item = new DefinitionObject(Global.Core, source, xPath);

            item.SetValue("Enabled", true);

            item.Save();
        }
Exemplo n.º 2
0
        private void SetEquation(HttpContext context)
        {
            string path = context.Request.Params["Path"];

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

            string equation = context.Request.Params["Equation"];

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

            item.SetValue("Equation", equation);

            item.Save();
        }
Exemplo n.º 3
0
        private void SetScoreName(HttpContext context)
        {
            string xPath = context.Request.Params["Path"];

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

            string value = context.Request.Params["Value"];

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

            item.SetValue("Name", value);

            item.Save();
        }
Exemplo n.º 4
0
        private void SetScoreFactor(HttpContext context)
        {
            string xPath = context.Request.Params["Path"];

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

            double value = 0.0;

            double.TryParse(context.Request.Params["Value"], out value);

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

            item.SetValue("Value", value);

            item.Save();
        }
Exemplo n.º 5
0
        private void ReorderScale(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 score = new DefinitionObject(Global.Core, source, xPath);

            int order = int.Parse(context.Request.Params["Order"]);

            int oldOrder = int.Parse(score.GetValue("Order").ToString());

            score.SetValue("Order", order);
            score.Save();

            DefinitionObject[] scores = score.GetParent().GetChilds();
            foreach (DefinitionObject _score in scores)
            {
                int _order = int.Parse(_score.GetValue("Order").ToString());

                if (_order < order)
                {
                    continue;
                }

                if (_order >= oldOrder)
                {
                    continue;
                }

                if (_score.GetValue("Id") == score.GetValue("Id"))
                {
                    continue;
                }

                _score.SetValue(
                    "Order",
                    (_order + 1)
                    );

                _score.Save();
            }

            ReOrderScores(scores.OrderBy(x => int.Parse(x.GetValue("Order").ToString())).ToArray());
        }
Exemplo n.º 6
0
        private void UpdateScoreLabel(HttpContext context)
        {
            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            string xPath = context.Request.Params["XPath"];

            string label = context.Request.Params["Value"];

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

            // Set the default for the language to english GB.
            int idLanguage = 2057;

            // Check if a specific language is defined.
            if (context.Request.Params["IdLanguage"] != null)
            {
                idLanguage = int.Parse(context.Request.Params["IdLanguage"]);
            }

            item.SetLabel(idLanguage, label);

            item.Save();
        }
Exemplo n.º 7
0
        private void UpdateScoreGroupName(HttpContext context)
        {
            string path = context.Request.Params["Path"];

            string name = context.Request.Params["Value"];

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

            // Set the default for the language to english GB.
            int idLanguage = 2057;

            // Check if a specific language is defined.
            if (context.Request.Params["IdLanguage"] != null)
            {
                idLanguage = int.Parse(context.Request.Params["IdLanguage"]);
            }

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

            score.SetLabel(idLanguage, name);

            score.Save();
        }