/// <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))); }
/// <summary> /// 修改下级分组 /// </summary> void ModifyChildAuthorityGroupParentGroup() { if (IsNew) { return; } IQuery query = QueryFactory.Create <AuthorityOperationGroupQuery>(r => r.Parent == SysNo); List <AuthorityOperationGroup> childGroupList = authorityOperationGroupRepository.GetList(query); foreach (var group in childGroupList) { group.SetParentGroup(this); group.Save(); } }
/// <summary> /// 获取授权操作组列表 /// </summary> /// <param name="query">查询对象</param> /// <returns></returns> public List <AuthorityOperationGroup> GetAuthorityOperationGroupList(IQuery query) { var authorityOperationGroupList = authorityOperationGroupRepository.GetList(query); return(authorityOperationGroupList); }