Пример #1
0
        public ActionResult DeleteDictionary(DictionaryType type, int dictionaryId)
        {
            if (!CurrentCustomer.IsSuperAdmin())
            {
                return(NoAuthorityJson());
            }

            Dictionary dictionary;

            if (type != DictionaryType.FirstCommentType)
            {
                var list = DictionaryService.GetDictionaryList(type.GetDescription());
                dictionary = list.Find(e => e.Id == dictionaryId);

                new DictionaryService().DeleteDictionary(dictionary);
            }
            else
            {
                dictionary = DictionaryService.DesignCommentTypeDictionary.FirstOrDefault(e => e.Id == dictionaryId);
                if (dictionary == null)
                {
                    dictionary = DictionaryService.IntegralityCommentTypeDictionary.Find(e => e.Id == dictionaryId);
                }

                new DictionaryService().DeleteDictionary(dictionary);
            }

            return(Json(new { result = true, dictionaryId = dictionaryId, type = type, level = dictionary.DisplayName }));
        }