/// <summary> /// 删除类别 /// </summary> public static void DeleteCategory(int sysNo) { var currentCategory = CategoryDA.LoadCategory(sysNo); var categorys = CategoryDA.GetCategoryList(); CategoryDA.DeleteCategory(sysNo); //如果父节点下无子节点 则将父节点重置为叶子节点 if (!string.IsNullOrEmpty(currentCategory.ParentCategoryCode)) { var parentChildrens = categorys.Where(a => a.ParentCategoryCode == currentCategory.ParentCategoryCode && a.CommonStatus == CommonStatus.Actived); if (parentChildrens != null && parentChildrens.Count() == 1) { CategoryDA.UpdateCategoryIsLeaf(currentCategory.ParentCategoryCode, CommonYesOrNo.Yes); } } }