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(); }
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(); }
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(); }
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(); }
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()); }
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(); }
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(); }