private static string GetFormula(int langItemId, IEnumerable <int> valuesInt) { List <string> formulaItemNameList = new List <string>(); foreach (int valueInt in valuesInt) { string formulaItemName = TaskItem.GetNameByValueInt(langItemId, valueInt); formulaItemNameList.Add(formulaItemName); } string result = string.Empty; result += "[ "; string formula = string.Join(" + ", formulaItemNameList); if (string.IsNullOrWhiteSpace(formula)) { result += "Пусто"; } else { result += formula; } result += " ]"; return(result); }