public ExcuteResultEnum DeleteSysMenu(int menuId) { if (GetCountByFatherNode(menuId) > 0) { return(ExcuteResultEnum.IsOccupied); } SysMenuEntity entity = new SysMenuEntity() { MenuId = menuId, DeleteFlag = true }; entity.Update(); return(ExcuteResultEnum.Success); }
public void UpdateSysMenu(SysMenuEntity entity, int orgFatherNode) { if (entity.FatherNode != orgFatherNode) { if (entity.FatherNode == 0) { entity.MenuLevel = 1; } else { SysMenuEntity fatherNode = GetSysMenuEntity(entity.FatherNode); entity.MenuLevel = fatherNode.MenuLevel + 1; } entity.Seq = GetCountByFatherNode(entity.FatherNode) + 1; } entity.Update(); if (entity.FatherNode != orgFatherNode) { SeqRecal(); } }