コード例 #1
0
        /// <summary>
        /// 修改分组排序
        /// </summary>
        /// <param name="modifyPermissionGroupSortDto">权限分组排序修改信息</param>
        /// <returns>返回执行结果</returns>
        public Result ModifyPermissionGroupSort(ModifyPermissionGroupSortDto modifyPermissionGroupSortDto)
        {
            #region 参数判断

            if (modifyPermissionGroupSortDto?.Id < 1)
            {
                return(Result.FailedResult("没有指定要修改的分组"));
            }

            #endregion

            using (var businessWork = WorkManager.Create())
            {
                #region 修改分组状态信息

                var modifyResult = permissionGroupService.ModifySort(modifyPermissionGroupSortDto.Id, modifyPermissionGroupSortDto.NewSort);
                if (!modifyResult.Success)
                {
                    return(modifyResult);
                }

                #endregion

                var executeVal = businessWork.Commit();
                return(executeVal.ExecutedSuccess ? Result.SuccessResult("排序修改成功") : Result.FailedResult("排序修改失败"));
            }
        }