Пример #1
0
        public IActionResult DelAdminMenu(int id)
        {
            AdminMenu entity = AdminMenu.Find(AdminMenu._.Id == id);

            if (entity == null)
            {
                tip.Message = "系统找不到本记录!";
                return(Json(tip));
            }
            if (AdminMenu.FindCount(AdminMenu._.PId == entity.Id, null, null, 0, 0) > 0)
            {
                tip.Message = "本菜单有下级菜单,不允许删除!";
                return(Json(tip));
            }
            entity.Delete();
            tip.Status  = JsonTip.SUCCESS;
            tip.Message = "删除后台菜单成功";
            return(Json(tip));
        }