Example #1
0
        public async Task <ResultEntity> AddOrUpdateAsync(ClientEditDto editDto)
        {
            var barcodeRule = Mapper.Map <Client>(editDto);
            var result      = await _clientManager.AddOrUpdateAsync(barcodeRule);

            if (result.Success)
            {
                await _unitOfWork.CommitAsync();

                if (editDto.Id > 0)
                {
                    await _logManager.LogInfomationAsync(EnumLogType.Audit, LogTitleConstString.ClientEdit,
                                                         $"【{editDto.Name}】", JsonConvert.SerializeObject(barcodeRule), editDto.CreateBy);
                }
                else
                {
                    await _logManager.LogInfomationAsync(EnumLogType.Audit, LogTitleConstString.ClientAdd,
                                                         $"【{editDto.Name}】", JsonConvert.SerializeObject(barcodeRule), editDto.CreateBy);
                }
            }
            return(result);
        }