public AjaxResponse DoDeleteThreadCategory(int id) { AjaxResponse resp = new AjaxResponse(); resp.rs2 = id.ToString(); var threads = new List <Thread>(); var category = ForumDataProvider.GetCategoryByID(TenantProvider.CurrentTenantID, id, out threads); if (category == null || !ForumManager.Instance.ValidateAccessSecurityAction(ForumAction.GetAccessForumEditor, null)) { resp.rs1 = "0"; resp.rs3 = Resources.ForumResource.ErrorAccessDenied; } try { var removedPostIDs = new List <int>(); ForumDataProvider.RemoveThreadCategory(TenantProvider.CurrentTenantID, category.ID, out removedPostIDs); ForumManager.Instance.RemoveAttachments(category); removedPostIDs.ForEach(idPost => CommonControlsConfigurer.FCKUploadsRemoveForItem(ForumManager.Settings.FileStoreModuleID, idPost.ToString())); resp.rs1 = "1"; } catch (Exception ex) { resp.rs1 = "0"; resp.rs3 = ex.Message.HtmlEncode(); } return(resp); }