Beispiel #1
0
        /// <summary>
        /// 删除成员
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> RemoveEmployee(EntityRequest entityRequest)
        {
            var relationOrgEmpIds = await _relationOrganizationEmployeeAppService.GetIdsByEmployeeIds(entityRequest.Ids);

            var relationRoleEmpIds = await _relationEmployeeRoleAppService.GetIdsByEmployeeIds(entityRequest.Ids);

            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _employeeAppService.RemoveAsync(entityRequest);
                await _relationOrganizationEmployeeAppService.RemoveAsync(new EntityRequest()
                {
                    Ids            = relationOrgEmpIds,
                    CreateDate     = DateTime.Now,
                    CreateUserId   = entityRequest.CreateUserId,
                    CreateUserName = entityRequest.CreateUserName
                });
                await _relationEmployeeRoleAppService.RemoveAsync(new EntityRequest()
                {
                    Ids            = relationRoleEmpIds,
                    CreateDate     = DateTime.Now,
                    CreateUserId   = entityRequest.CreateUserId,
                    CreateUserName = entityRequest.CreateUserName
                });
            });

            return(resJson);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> Remove(EntityRequest input)
        {
            input.InitModifyRequest();
            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _relationEmployeeRoleAppService.RemoveAsync(input);
            });

            return(resJson);
        }