Пример #1
0
        public IActionResult GetParentalOrgUnit(string id, int categoryTypeID, string text)
        {
            var decryptedID = id == "" ? 0 : Convert.ToInt32(EncryptionHelper.DecryptUrlParam(id));
            var data        = _organizationUnitProvider.GetParentalOrgUnits(decryptedID, categoryTypeID);

            if (!string.IsNullOrEmpty(text))
            {
                data = data.Where(s => s.Name.IndexOf(text, StringComparison.OrdinalIgnoreCase) >= 0);
            }

            return(Ok(data.Select(x => new { Value = x.Id, Text = x.Name })));
        }