public JsonResult GetStatField(StatComplexFieldRepository repository, string fieldName) { StatValueChoice valueChoice = fieldName.GetStatValueIndex(); StatRuChoice ruChoice = fieldName.GetStatRuIndex(); int index = (valueChoice == StatValueChoice.Undefined) ? (int)ruChoice + StatValueChoiceQueries.Choices.Count() : (int)valueChoice; StatValueField field = repository.FieldList[index]; return(Json(field.IntervalList.Select(x => new { L = x.IntervalLowLevel, H = x.IntervalUpLevel, C = x.Color.ColorStringForHtml, K = x.Color.ColorStringForKml }).ToArray(), JsonRequestBehavior.AllowGet)); }
public static string GetStatRuDescription(this StatRuChoice choice) { return(list[choice]); }