/// <summary>
        /// 删除操作分组
        /// </summary>
        /// <param name="deleteInfo">删除信息</param>
        public static Result DeleteAuthorityOperationGroup(IEnumerable <long> groupIds)
        {
            #region 参数判断

            if (groupIds.IsNullOrEmpty())
            {
                return(Result.FailedResult("没有指定任何要删除的信息"));
            }

            #endregion

            //删除分组信息
            IQuery parentRemoveCondition = QueryFactory.Create();
            parentRemoveCondition.In <AuthorityOperationGroupQuery>(r => r.SysNo, groupIds);
            authorityOperationGroupRepository.Remove(parentRemoveCondition);
            //删除下级
            IQuery childQuery = QueryFactory.Create();
            childQuery.In <AuthorityOperationGroupQuery>(r => r.Parent, groupIds);
            childQuery.AddQueryFields <AuthorityOperationGroupQuery>(r => r.SysNo);
            List <AuthorityOperationGroup> authorityOperationGroupList = authorityOperationGroupRepository.GetList(childQuery);
            if (authorityOperationGroupList.IsNullOrEmpty())
            {
                return(Result.SuccessResult("没有任何要删除的下级分组"));
            }
            return(DeleteAuthorityOperationGroup(authorityOperationGroupList.Select(r => r.SysNo)));
        }
Example #2
0
        /// <summary>
        /// 删除操作分组
        /// </summary>
        /// <param name="deleteInfo">删除信息</param>
        public Result DeleteAuthorityOperationGroup(IEnumerable <long> groupIds)
        {
            #region 参数判断

            if (groupIds.IsNullOrEmpty())
            {
                return(Result.FailedResult("没有指定任何要删除的信息"));
            }

            #endregion

            //删除分组信息
            IQuery removeQuery = QueryManager.Create <AuthorityOperationGroupQuery>(c => groupIds.Contains(c.SysNo));
            removeQuery.SetRecurve <AuthorityOperationGroupQuery>(c => c.SysNo, c => c.Parent);
            authorityOperationGroupRepository.Remove(removeQuery);
            return(Result.SuccessResult("删除成功"));
        }