Example #1
0
        /// <summary>
        /// 保存成员模块元素
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> SaveEmployeeModuleElement(EmployeeElementRequestDto input)
        {
            var result = await GetAddOrRemoveEmployeeElementRequest(input);

            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _employeeElementAppService.BatchCreateAsync(result.Item1);
                await _employeeElementAppService.BatchRemoveAsync(result.Item2);
            });

            return(resJson);
        }
Example #2
0
        /// <summary>
        /// 批量新增
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> BatchCreate(EmployeeElementBatchRequestDto input)
        {
            foreach (var employeeElementRequestDto in input.EmployeeElementRequestList)
            {
                employeeElementRequestDto.InitCreateRequest(input.Payload);
            }
            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _employeeElementAppService.BatchCreateAsync(input.EmployeeElementRequestList);
            });

            return(resJson);
        }