public bool executeValidationLogic(Criterial criterial, JObject matchData) { if (criterial.Operator == "equal_to") { string matchValue = matchData.SelectToken(criterial.Field).Value <string>().ToLower(); if (matchValue == criterial.Value) { return(true); } } else if (criterial.Operator == "greater_than") { int matchValue = matchData.SelectToken(criterial.Field).Value <int>(); if (matchValue >= Int32.Parse(criterial.Value)) { return(true); } } else if (criterial.Operator == "lower_than") { int matchValue = matchData.SelectToken(criterial.Field).Value <int>(); if (matchValue <= Int32.Parse(criterial.Value)) { return(true); } } return(false); }
/// <summary> /// Составление маршрута /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ПараметрыМаршрутаToolStripMenuItem_Click(object sender, EventArgs e) { OptionsRouteForm optionsRouteForm = new OptionsRouteForm(); optionsRouteForm.ShowDialog(); if (optionsRouteForm.DialogResult == DialogResult.OK) { Criterial criterial = optionsRouteForm.Criterial; driver = optionsRouteForm.Drive; optionsRouteForm.Close(); Map.Way = new List <Vertex>(); foreach (var item in Map.edges.List) { item.IsInWay = false; } new Route().FindMinLengthWay(Map.vertexes, Map.edges, criterial, driver); MakeMap.ViewPort.StatusLabel.Text = "Маршрут построен..."; ToolStripMenuItem_StaticView.Enabled = true; ToolStripMenuItem_DynamicView.Enabled = true; } }