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 })); }
public ActionResult AddDictionary(DictionaryModel model) { if (!CurrentCustomer.IsSuperAdmin()) { return(NoAuthorityJson()); } var dictionary = DictionaryModelToEntity(model); new DictionaryService().InsertOrUpdateDictionary(dictionary); var htmlStr = PrepareDictionaryAddHtmlStr(dictionary, model); return(Json(new { result = true, htmlStr = htmlStr, dictionary = model })); }